Skip to content

Commit

Permalink
Update to work in the aftermath
Browse files Browse the repository at this point in the history
Update batch files to continue downloading after the DNS stopped.
  • Loading branch information
WRtux committed Feb 6, 2021
1 parent 8de4ef5 commit a333fc7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
9 changes: 8 additions & 1 deletion source/standalone/getraw.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
@echo off
set Proxy=http://proxy.example.com:8888
set Host=203.119.244.126
set Agent=Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
set /p T=Type:
set /p L=List:
if not exist "%L%" exit
if not exist "%T%" mkdir "%T%"
for /f %%I in (%L%) do (
if not exist %T%\%%I.html (
echo Get %T% %%I
curl -x http://proxy.example.com:8888 -A "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko" -m 20 --retry 2 https://www.xiami.com/%T%/%%I >%T%\%%I.html
curl -x "%Proxy%" -m 20 --retry 2 -A "%Agent%" -H "Host:www.xiami.com" -k https://%Host%/%T%/%%I >%T%\%%I.html
) else (
echo Found %T% %%I
)
)
pause
5 changes: 4 additions & 1 deletion source/standalone/media.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
@echo off
set Agent=Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
set /p L=List:
if not exist "%L%" exit
for /f "tokens=1,2 delims= " %%E in (%L%) do (
if not exist media\%%F (
echo Get %%E
mkdir media\%%F
rmdir media\%%F
curl -A "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko" -m 10 --retry 2 https:%%E >media\%%F
curl -m 10 --retry 2 -A "%Agent%" https:%%E >media\%%F
) else (
echo Found %%F
)
)
pause
5 changes: 4 additions & 1 deletion source/standalone/retry.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
@echo off
set Proxy=http://proxy.example.com:8888
set Host=203.119.244.126
set Agent=Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
set /p T=Type:
if not exist "%T%" exit
for %%F in (%T%\*.html) do (
if %%~zF lss 30720 (
echo Retry %T% %%~nF
curl -x http://proxy.example.com:8888 -A "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko" -m 20 --retry 3 https://www.xiami.com/%T%/%%~nF >%%F
curl -x "%Proxy%" -m 20 --retry 3 -A "%Agent%" -H "Host:www.xiami.com" -k https://%Host%/%T%/%%~nF >%%F
)
)
pause

0 comments on commit a333fc7

Please sign in to comment.