2012-11-23 17 views

risposta

83

Il comando è:

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

Opzioni significato:

-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. 
+11

I -nd' (nessuna directory) ' flag è utile se non vuoi creare directory aggiuntive (cioè, tutti i file si troveranno nella cartella principale). –

+0

Come posso modificare questa soluzione affinché diventi più profonda dalla pagina specificata? Ho provato -l 20, ma wget si ferma immediatamente. – Wrench

47

Sopra soluzione non funziona per me. Per me solo questo funziona:

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

Opzioni significato:

-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 
+1

Fonte: http://www.commandlinefu.com/commands/view/12498/download-all-music-files-off-of-a-website-using-wget –

+0

sì, grazie! Non ricordavo da dove venisse, ho appena mentito nei miei copioni. –

+0

non so scusa. fai una nuova domanda! ;) –

1

Per altri scenari con qualche magia parallelo che uso:

curl [url] | grep -i [filending] | sed -n 's/.*href="\([^"]*\).*/\1/p' | parallel -N5 wget - 
Problemi correlati