Batch file to pull links from text doc

June 16, 2013 at 23:33:04
Specs: Windows 7 HomePremium 64bit, I5 3570k / 16GB
Looking for a way to pull links from a text file.
Each link could/n't have a space in it.
Each link will be on a separate line.
Links being called to work in wget.

What I currently have:

Title WGET Downloader
REM Location to download files to. (Current Dir)
CD /D %~dp0
REM SETs wget locations.
SET wg="C:\Program Files (x86)\GnuWin32\bin\wget.exe"
REM SETs URL to download from.
SET url0=
SET url1=
SET url2=
SET url3=
SET url4=
SET url5=
SET url6=
SET url7=
REM SET referal link.
SET ref=
REM SET the user agent.
SET uagent="-U Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0"
REM Logging and Debug
SET lode=-d -a Log.log
REM Robots?
SET norob=-e robots=off
REM Mirror a website
SET mir=-r -c
REM Wget command line
%WG% %norob% %mir% %url0%
%WG% %norob% %mir% %url1%
%WG% %norob% %mir% %url2%
%WG% %norob% %mir% %url3%
%WG% %norob% %mir% %url4%
%WG% %norob% %mir% %url5%
%WG% %norob% %mir% %url6%
%WG% %norob% %mir% %url7%

Also maybe some way to grab link main url and place as referral and a text file containing user agents, one agent on each line, and one line from the list is called at random.

See More: Batch file to pull links from text doc

Report •

June 17, 2013 at 00:16:34
You probably have, but why haven't you...?
-i, --input-file=FILE download URLs found in FILE.
-F, --force-html treat input file as HTML.
-B, --base=URL prepends URL to relative links in -F -i file.

Report •

June 17, 2013 at 00:24:20
Thanks for the info, seems I skipped those options when looking over wget. I will modify my code and get back with this question afterwords.

Report •

Related Solutions

Ask Question