Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO off
- SETLOCAL EnableDelayedExpansion
- SET "Script=?:\???????\script_Batch_Remove_Special_Invalid_characters.py"
- SET "Single_File_Cli=?:\???????\SingleFile CLI webpage downloader\single-file.exe"
- SET "TimeNow=!time:~0,-3!"
- SET "TimeNow=!TimeNow::=-!"
- SET "DateTime=!date!_!TimeNow: =0!"
- SET "Special=!QUTE_TITLE!"
- SET "Dir=?:\???????\webpages"
- SET "LogFilePath=C:\Users\???????\AppData\Roaming\qutebrowser\config\userscripts"
- SET "LogFileName=\log_save-page.txt"
- REM Call Python script
- CALL :ESCAPE_V "the script" "%Special%"
- REM Read output from tempfile
- FOR /F "tokens=*" %%i IN (temp__batch_remove_invalid.txt) DO SET Validated=%%i
- DEL temp__batch_remove_invalid.txt
- SET "Filename=[!DateTime!] !Validated!.html"
- REM CALL ECHO result: !Filename! && EXIT
- REM Pass arguments
- "!Single_File_Cli!" !QUTE_URL! "!Filename!" --output-directory "!Dir!"
- ECHO "!Single_File_Cli!" !QUTE_URL! "!Filename!" --output-directory "!Dir!" > !LogFilePath!!LogFileName!
- ECHO :message-info 'Script Ended, save-page' >> !QUTE_FIFO!
- REM explorer "!Dir!"
- GOTO:EOF
- :ESCAPE_V
- SetLocal DisableDelayedExpansion
- ECHO %~1
- ECHO L1. Start
- SET "escaped=%~2"
- SET "escaped=%escaped:|=^|%"
- SET "escaped=%escaped:"=%"
- ECHO L2. Ended: %escaped%
- CALL "%Script%" -d ^"%escaped%^"
- SetLocal EnableDelayedExpansion
- GOTO:EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement