mercoledì 18 aprile 2018

WGET: OTTENERE LISTA DI FILE HTTP E USARE FILE DI TESTO PER SCARICARE LA LISTA OTTENUTA

Per ottenere la lista:

wget -d -r -np -N --spider -e robots=off --no-check-certificate \
  https://tcga-data.nci.nih.gov/tcgafiles/ftp_auth/distro_ftpusers/anonymous/tumor/ \
  2>&1 | grep " -> " | grep -Ev "\/\?C=" | sed "s/.* -> //" > output.txt

Cambiare la parte in rosso con l'URL che si vuole consultare.
Cambiare la parte in verde con il nome file che si vuole dare all'output (e il percorso se si vuole).

Ora che abbiamo il nostro txt possiamo formattarlo e consultarlo, eventualmente individuando quei file che non ci interessano. Per esempio, utilizzando i filtri su Excel.

Infine, avuto il nostro txt definitivo basterà lanciare wget:

wget -i nostro.txt

Dove ovviamente, nostro.txt, sta per il nome del file che avevamo creato come lista degli url da scaricare.

CREDITS:

https://superuser.com/questions/545316/getting-all-the-filenames-not-content-recursively-from-an-http-directory?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

https://stackoverflow.com/questions/40986340/how-to-wget-a-list-of-urls-in-a-text-file?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa



Nessun commento:

Posta un commento