Jak pobrać wszystkie linki do.pliki zip na danej stronie za pomocą wget / curl?

Strona zawiera linki do zbioru .pliki zip, które chcę pobrać. Wiem, że można to zrobić przez wget i curl. Jak to się robi?

Author: uyetch, 2012-11-23

3 answers

Komenda brzmi:

wget -r -np -l 1 -A zip http://example.com/download/

Opcje Znaczenie:

-r,  --recursive          specify recursive download.
-np, --no-parent          don't ascend to the parent directory.
-l,  --level=NUMBER       maximum recursion depth (inf or 0 for infinite).
-A,  --accept=LIST        comma-separated list of accepted extensions.
 96
Author: creaktive,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-03-20 05:24:41

Powyższe rozwiązanie nie działa dla mnie. Dla mnie działa tylko ten:

wget -r -l1 -H -t1 -nd -N -np -A.mp3 -erobots=off [url of website]

Opcje Znaczenie:

-r            recursive
-l1           maximum recursion depth (1=use only this directory)
-H            span hosts (visit other hosts in the recursion)
-t1           Number of retries
-nd           Don't make new directories, put downloaded files in this one
-N            turn on timestamping
-A.mp3        download only mp3s
-erobots=off  execute "robots.off" as if it were a part of .wgetrc
 54
Author: K.-Michael Aye,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-03-09 04:43:37

Do innych scenariuszy z jakąś równoległą magią używam:

curl [url] | grep -i [filending] | sed -n 's/.*href="\([^"]*\).*/\1/p' |  parallel -N5 wget -
 1
Author: M Lindblad,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-01-11 20:34:49