#1 Le 09/02/2013, à 02:08
- Mathal44
[RESOLU] script plowshare et multihoster
Bonjour,
J'utilise plowshare sous ubuntu depuis quelques mois et j'aimerai trouver le moyen d'automatiser des choses que je fais actuellement manuellement et on m'a conseiller de faire un script.
Le problème c'est que je n'y connais rien alors je viens chercher de l'aide
Voilà, mon point de départ est un liste d'URL de chez jheberg.net, qui contiennent une liste de liens hébergeant chacun un même fichier à télécharger.
Grâce à la commande "plowlist", je peux récupérer tous les liens contenu dans chaque URL jheberg.net (et les mettre si besoin dans un fichier texte).
Ce que je souhaite c'est un script (ou une commande ?) qui me récupère le premier lien valide pour chaque URL jheberg.net, et qui me le mette dans un fichier texte par exemple.
Avec la commande
cat list.txt | xargs plowlist >all_links.txt
j'ai déjà réussi à mettre tous les liens de chaque url jheberg.net dans un fichier texte,
puis la commande
plowdown -m -c all_links.txt
me permet de vérifier si chacun de ces liens est valide.
Mais j'obtiens quand même pas mal de liens valides pour un seul et même fichier à télécharger.
Donc il faudrait associer :
- plowlist qui prend en entrée un fichier texte contenant les URL jheberg.net
- plowdown -m -c qui va identifier si les liens de l'URL jheberg.net en cours sont valides ou non
- une commande que je ne connais pas qui me permet de dire que "si le lien est valide, mettre ce lien à la suite de fichier texte liens_valides_uniques.txt "
Je ne sais pas si je suis très clair ?
A vouloir trop expliquer des fois on s'y perd...
Merci d'avance de m'aider !
Mathal.
Dernière modification par Mathal44 (Le 18/02/2013, à 01:57)
Hors ligne
#2 Le 09/02/2013, à 02:48
- nesthib
Re : [RESOLU] script plowshare et multihoster
Quelques questions pour pouvoir t'aider :
à quoi ressemble ta liste de liens ? (peux-tu donner un extrait ?)
comment la commande plowdown -m -c signifie-t-elle la validité d'un URL (code de retour ? message texte ?)
Y a-t-il d'autres actions à lancer par la suite ? (comme le téléchargement ?)
GUL Bordeaux : Giroll – Services libres : TdCT.org
Hide in your shell, scripts & astuces : applications dans un tunnel – smart wget – trouver des pdf – install. auto de paquets – sauvegarde auto – ♥ awk
⃛ɹǝsn xnuᴉꞁ uʍop-ǝpᴉsdn
Hors ligne
#3 Le 11/02/2013, à 01:10
- Mathal44
Re : [RESOLU] script plowshare et multihoster
Bonjour nesthib,
Merci de m'aider
Voici un extrait des URL de départ:
http://www.jheberg.net/download/6E4gPW-naruto-shippuden-pisode-209-avi
http://www.jheberg.net/download/WAdI3x-naruto-shippuden-pisode-210-avi
http://www.jheberg.net/download/1FYdSL-naruto-shippuden-pisode-211-avi
http://www.jheberg.net/download/jcU0pL-naruto-shippuden-pisode-212-avi
http://www.jheberg.net/download/8kVVGt-naruto-shippuden-pisode-213-avi
http://www.jheberg.net/download/b1uWZw-naruto-shippuden-pisode-214-avi
http://www.jheberg.net/download/qdQXXU-naruto-shippuden-pisode-219-avi
http://www.jheberg.net/download/iglI4l-naruto-shippuden-pisode-220-avi
la commande plowdown -m -c me donne comme résultat "Link active" :
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$ plowdown -m -c Naruto260.txt
Starting download (uptobox): http://uptobox.com/fkiqhel7q3zn
Link is not alive: file not found
link marked in file `Naruto260.txt' (#NOTFOUND)
Starting download (dl_free_fr): http://dl.free.fr/hlTQ4GhAV
Link active: http://dl.free.fr/hlTQ4GhAV
http://dl.free.fr/hlTQ4GhAV
Starting download (rapidgator): http://rapidgator.net/file/61970187/Naruto_Shippuden_\u00c3\u00a9pisode_260.avi.html
Link active: http://rapidgator.net/file/61970187/Naruto_Shippuden_\u00c3\u00a9pisode_260.avi.html
http://rapidgator.net/file/61970187/Naruto_Shippuden_\u00c3\u00a9pisode_260.avi.html
Starting download (1fichier): http://h3jdpy.1fichier.com/
Link is not alive: file not found
link marked in file `Naruto260.txt' (#NOTFOUND)
Starting download (rapidshare): http://rapidshare.com/files/3623636316/Naruto%20Shippuden%20\u00c3\u00a9pisode%20260.avi
Remote error: Filename invalid. (a6febc74)
Failed inside rapidshare_download() [1]
Skip: no module for URL (http://filerio.in/)
link marked in file `Naruto260.txt' (#NOMODULE)
Starting download (uploaded_net): http://uploaded.to/file/oxy9vuwc
Link is not alive: file not found
link marked in file `Naruto260.txt' (#NOTFOUND)
Skip: no module for URL (http://filecloud.io/)
link marked in file `Naruto260.txt' (#NOMODULE)
Starting download (freakshare): http://freakshare.com/files/5un9cnc7/Naruto-Shippuden---pisode-260.avi.html
Link is not alive: file not found
link marked in file `Naruto260.txt' (#NOTFOUND)
Starting download (turbobit): http://turbobit.net/v8tfjpf2crf7.html
Link is not alive: file not found
link marked in file `Naruto260.txt' (#NOTFOUND)
Starting download (zippyshare): http://www31.zippyshare.com/v/97445180/file.html
Link is not alive: file not found
link marked in file `Naruto260.txt' (#NOTFOUND)
Starting download (depositfiles): http://depositfiles.com/files/nlvndwpyl
Link is not alive: file not found
link marked in file `Naruto260.txt' (#NOTFOUND)
Starting download (netload_in): http://netload.in/datei4y3AfjsUQq/NarutoShippudenÃpisode260.avi.htm
Link active: http://netload.in/datei4y3AfjsUQq/NarutoShippudenÃpisode260.avi.htm
http://netload.in/datei4y3AfjsUQq/NarutoShippudenÃpisode260.avi.htm
Starting download (2shared): http://www.2shared.com/video/PAUsVXBB/Naruto_Shippuden_pisode_260.html
Link active: http://www.2shared.com/video/PAUsVXBB/Naruto_Shippuden_pisode_260.html
http://www.2shared.com/video/PAUsVXBB/Naruto_Shippuden_pisode_260.html
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$
Du coup mon fichier texte devient:
# Uptobox
#NOTFOUND http://uptobox.com/n7dba7ubdkdm
# Free
http://dl.free.fr/kNL3uMqxz
# Rapidgator
http://rapidgator.net/file/62108214/Naruto_Shippuden_\u00c3\u00a9pisode_209.avi.html
# Freakshare
#NOTFOUND http://freakshare.com/files/7cq3j4zc/Naruto-Shippuden---pisode-209.avi.html
# Rapidshare
http://rapidshare.com/files/671889758/Naruto Shippuden \u00c3\u00a9pisode 209.avi
# 2shared
http://www.2shared.com/video/ymJKHoWN/Naruto_Shippuden_pisode_209.html
# Uploaded
#NOTFOUND http://uploaded.to/file/xhhpiutq
# Filecloud
#NOMODULE http://filecloud.io/0vqm4dzt
# 1fichier
http://xhc36f.1fichier.com/
# Filerio
#NOMODULE http://filerio.in/kjqduw6c9vjo
# Depositfiles
#NOTFOUND http://depositfiles.com/files/887edz3z3
# Turbobit
#NOTFOUND http://turbobit.net/ywj3onzs2e1c.html
# Netload
#NOTFOUND http://netload.in/dateiTjvY9vY2pE/NarutoShippudenÃpisode209.avi.htm
Dans le fichier texte c'est plutôt lorsque le lien est mort que c'est signalé (-m écrit dans mon fichier texte les résultats de chaque action, -c vérifie le lien).
Éventuellement on peut lancer le téléchargement ensuite à partir du fichier texte obtenu de la façon suivante :
plowdown -m -v3 --captchabhood='login:pass' resultats.txt
Merci !
Hors ligne
#4 Le 11/02/2013, à 06:14
- nesthib
Re : [RESOLU] script plowshare et multihoster
Il te faut donc faire une boucle qui lance la commande pour tester la validité pour chaque lien d'intérêt et vérifier dans la sortie si la chaîne « Link active ». De ce que je comprends la ligne contenant « Link active » donne l'url correspondante, qu'il faut récupérer (et par exemple l'ajouter dans un fichier texte). Enfin, pour chaque url collectée il te faudra une seconde boucle pour lancer le téléchargement. Je te suggère de proposer une ébauche de script pour que l'on puisse ensuite t'aider.
GUL Bordeaux : Giroll – Services libres : TdCT.org
Hide in your shell, scripts & astuces : applications dans un tunnel – smart wget – trouver des pdf – install. auto de paquets – sauvegarde auto – ♥ awk
⃛ɹǝsn xnuᴉꞁ uʍop-ǝpᴉsdn
Hors ligne
#5 Le 11/02/2013, à 14:41
- Mathal44
Re : [RESOLU] script plowshare et multihoster
C'est ça, enfin ce qui m'intéresse c'est surtout d'ajouter chaque lien actif dans un fichier texte, après le téléchargement c'est vraiment secondaire
Par contre je n'y connais rien en script !
Par quoi me conseilles-tu de commencer pour apprendre les bases et les éléments qui risquent de me servir pour ma requête ?
Hors ligne
#6 Le 13/02/2013, à 02:19
- Mathal44
Re : [RESOLU] script plowshare et multihoster
Bon alors voilà une solution que j'ai imaginé :
cat liens_entrée.txt | plowdown -m -c xargs grep -n '^Link active: $' && [commande qui m'envoie en sortie le lien correspondant à
la ligne où a été trouvé '^Link active: $' par grep] > Liens_sortie.txt
sauf que je n'ai pas trouvé la commande pour [commande qui m'envoie en sortie le lien correspondant à
la ligne où a été trouvé '^Link active: $' par grep]
Qu'en penses-tu ?
Edit: Par contre il va sans doute falloir aussi paramétrer l'arrêt de la recherche par grep, c'est à dire dés qu'il a trouvé '^Link active: $'
il faut écrire le lien dans le fichier texte de sortie et passer à la ligne suivante du cat de départ.
C'est là que ça se complique pour moi, j'étudie les options de xargs mais c'est pas simple !
^^
Dernière modification par Mathal44 (Le 13/02/2013, à 02:31)
Hors ligne
#7 Le 13/02/2013, à 03:01
- nesthib
Re : [RESOLU] script plowshare et multihoster
« cat fichier | commande » → « commande <fichier »
pour s'arrêter à la première occurrence : « grep -n -m1 "^Link active" fichier »
ou (encore mieux) pour avoir directement le numéro de ligne de la première occurrence : « awk '/^Link active/{print NR;exit}' fichier »
Je n'ai pas tout relu, mais commence par penser à ton algorithme (c'est à dire la façon dont ton programme fonctionne, ou comment tu ferais à la main) en pseudocode (en français), ensuite on mettra ça en application.
GUL Bordeaux : Giroll – Services libres : TdCT.org
Hide in your shell, scripts & astuces : applications dans un tunnel – smart wget – trouver des pdf – install. auto de paquets – sauvegarde auto – ♥ awk
⃛ɹǝsn xnuᴉꞁ uʍop-ǝpᴉsdn
Hors ligne
#8 Le 13/02/2013, à 23:59
- Mathal44
Re : [RESOLU] script plowshare et multihoster
cat liste_de_liens_jheberg.txt | plowlist > liens_provisoires.txt
# liste tous les liens du multihoster et les met dans un fichier texte provisoire
plowdown -c -m liens_provisoires.txt
# teste chaque lien et écrit dans le fichier texte provisoire si le lien est actif ou non
# grep -n -m1 "^Link active" liens_provisoires.txt
# cherche le premier lien valide
awk '/^Link active/{print NR;exit}' liens_provisoires.txt
# donne le numéro de ligne du premier lien valide
[commande manquante] < awk '/^Link active/{print NR;exit}' liens_provisoire.txt > liste-de-liens-valides.txt
# récupère le premier lien valide correspondant au numéro de ligne trouvé par 'awk'
et l'ajoute à la suite dans le fichier texte liste_de_liens_valides.txt
Est-ce que ça va comme algorythme ?
Dernière modification par Mathal44 (Le 13/02/2013, à 23:59)
Hors ligne
#9 Le 14/02/2013, à 01:42
- nesthib
Re : [RESOLU] script plowshare et multihoster
Ça n'est pas vraiment un algorithme, plutôt une suite de commandes .
Si je comprends bien « liste_de_liens_jheberg.txt », est une liste de liens potentiels pour UN fichier donné ?
Dans ce cas ton algo serait :
générer la liste de liens valides
pour chaque lien testé, vérifier si la ligne de sortie commence par « Link active »
si c'est le cas, s'arrêter et télécharger le fichier
ce que j'imagine correspondre à quelque chose comme :
wget "$(plowdown -c -m < <(plowlist <liste_de_liens_jheberg.txt) | awk '/^Link active/{$1="";print $0;exit}')"
(je mets ici wget, mais je ne sais pas si la sortie de plowlist est un lien ou autre chose, à remplacer éventuellement par ta commande de téléchargement, tu peux mettre un « echo » pour commencer et voir ce qui est retourné)
GUL Bordeaux : Giroll – Services libres : TdCT.org
Hide in your shell, scripts & astuces : applications dans un tunnel – smart wget – trouver des pdf – install. auto de paquets – sauvegarde auto – ♥ awk
⃛ɹǝsn xnuᴉꞁ uʍop-ǝpᴉsdn
Hors ligne
#10 Le 15/02/2013, à 03:26
- Mathal44
Re : [RESOLU] script plowshare et multihoster
Donc pour tester je lance la commande
echo "$(plowdown -c -m < <(plowlist <liste_de_liens_jheberg.txt) | awk '/^Link active/{$1="";print $0;exit}')"
c'est bien ça ?
le fichier "liste_de_liens_jheberg.txt" contient:
http://www.jheberg.net/download/6E4gPW- … de-209-avi
http://www.jheberg.net/download/WAdI3x- … de-210-avi
http://www.jheberg.net/download/1FYdSL- … de-211-avi
http://www.jheberg.net/download/jcU0pL- … de-212-avi
http://www.jheberg.net/download/8kVVGt- … de-213-avi
http://www.jheberg.net/download/b1uWZw- … de-214-avi
http://www.jheberg.net/download/qdQXXU- … de-219-avi
http://www.jheberg.net/download/iglI4l- … de-220-avi
pour chacun de ces liens, plowlist va sortir tous les liens qui hébergent le fichier correspondant,
par exemple, le lien "http://www.jheberg.net/download/6E4gPW- … de-209-avi" mis en entrée de plowlist va donner comme résultat:
# Uptobox
#NOTFOUND http://uptobox.com/n7dba7ubdkdm
# Free
http://dl.free.fr/kNL3uMqxz
# Rapidgator
http://rapidgator.net/file/62108214/Nar … 9.avi.html
# Freakshare
#NOTFOUND http://freakshare.com/files/7cq3j4zc/Na … 9.avi.html
# Rapidshare
http://rapidshare.com/files/671889758/Naruto Shippuden \u00c3\u00a9pisode 209.avi
# 2shared
http://www.2shared.com/video/ymJKHoWN/N … e_209.html
# Uploaded
#NOTFOUND http://uploaded.to/file/xhhpiutq
# Filecloud
#NOMODULE http://filecloud.io/0vqm4dzt
# 1fichier
http://xhc36f.1fichier.com/
# Filerio
#NOMODULE http://filerio.in/kjqduw6c9vjo
# Depositfiles
#NOTFOUND http://depositfiles.com/files/887edz3z3
# Turbobit
#NOTFOUND http://turbobit.net/ywj3onzs2e1c.html
# Netload
#NOTFOUND http://netload.in/dateiTjvY9vY2pE/Narut … 09.avi.htm
Tous ces liens hébergent le fichier "naruto-shippuden-pisode-209-avi", quand le lien est actif évidemment.
Hors ligne
#11 Le 15/02/2013, à 04:51
- nesthib
Re : [RESOLU] script plowshare et multihoster
Dans ce cas je suppose qu'il faut plutôt une boucle qui travaille indépendamment sur chaque ligne du fichier d'origine.
while read line
do
LIEN="$(plowdown -c -m "${lien}" | awk '/^Link active/{$1="";print $0;exit}')"
echo "On télécharge ${LIEN}"
ta_commande_de_téléchargement_de "${LIEN}"
done <liste_de_liens_jheberg.txt
GUL Bordeaux : Giroll – Services libres : TdCT.org
Hide in your shell, scripts & astuces : applications dans un tunnel – smart wget – trouver des pdf – install. auto de paquets – sauvegarde auto – ♥ awk
⃛ɹǝsn xnuᴉꞁ uʍop-ǝpᴉsdn
Hors ligne
#12 Le 16/02/2013, à 02:03
- Mathal44
Re : [RESOLU] script plowshare et multihoster
Voici le résultat de la commande avec "echo":
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$ echo "$(plowdown -c -m < <(plowlist <Naruto_jheberg.txt) | awk '/^Link active/{$1="";print $0;exit}')"
plowlist: no URL specified!
plowlist: try `plowlist --help' for more information.
plowdown: no URL specified!
plowdown: try `plowdown --help' for more information.
Il faut sans doute un "cat Naruto_jheberg.txt" ou utiliser xargs ?
Et pour la boucle indépendante:
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$ while read line
> do
> LIEN="$(plowdown -c -m "${lien}" | awk '/^Link active/{$1="";print $0;exit}')"
> echo "On télécharge ${LIEN}"
> plowdown -v3 --captchabhood='login:pass' "${LIEN}"
> done <Naruto_jheberg.txt
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
^C
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$
Ca avait l'air de boucler sur une erreur alors je l'ai stoppé avec Ctrl^C.
Qu'en penses-tu ?
Hors ligne
#13 Le 16/02/2013, à 02:12
- nesthib
Re : [RESOLU] script plowshare et multihoster
J'ai peut être interverti plowdown et plowlist, je n'utilise pas ces logiciels alors je te donne juste la démarche à suivre, à toi d'adapter.
En gros :
#pour chaque ligne de liste_de_liens_jheberg.txt
while read line
do
# on récupère le premier lien valide
LIEN="$(commande_qui_liste_les_liens_valides "${line}" | awk '/^Link active/{$1="";print $0;exit}')"
# et on lance son téléchargement
echo "On télécharge ${LIEN}"
commande_de_téléchargement_de "${LIEN}"
done <liste_de_liens_jheberg.txt
devrait correspondre à ce que tu veux, pour le reste je te laisse te débrouiller (j'avoue que je ne suis pas sûr de la légalité de ce script et donc qu'il ait vraiment sa place ici).
NB. il y avait une petite erreur de frappe s/lien/line dans mon message précédent.
GUL Bordeaux : Giroll – Services libres : TdCT.org
Hide in your shell, scripts & astuces : applications dans un tunnel – smart wget – trouver des pdf – install. auto de paquets – sauvegarde auto – ♥ awk
⃛ɹǝsn xnuᴉꞁ uʍop-ǝpᴉsdn
Hors ligne
#14 Le 16/02/2013, à 03:01
- Mathal44
Re : [RESOLU] script plowshare et multihoster
D'accord je comprends mieux ta logique.
Dans ce cas je pense qu'il faut intégrer la commande qui extrait tous les liens de chaque lien jheberg,
J'ai essayé 2 solutions:
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$ #pour chaque ligne de liste_de_liens_jheberg.txt
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$ cat Naruto_jheberg.txt | plowlist >liens_provisoires.txt | while read line
> do
> # on récupère le premier lien valide
> LIEN="$(plowdown -c -m liens_provisoires.txt "${line}" | awk '/^Link active/{$1="";print $0;exit}')"
> # et on lance son téléchargement
> echo "On télécharge ${LIEN}"
> plowdown -v3 --captchabhood='login:pass' "${LIEN}"
> done
plowlist: no URL specified!
plowlist: try `plowlist --help' for more information.
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$ # En entrée il faut un fichier texte provisoire dans le quel on aura extrait les réponses qu'on aura été cherchées dans les liens jheberg un par un
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$
la première sans "xargs" mais qui me retourne un erreur avec plowlist.
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$ cat Naruto_jheberg.txt | xargs plowlist >liens_provisoires.txt | while read line
> do
> # on récupère le premier lien valide
> LIEN="$(plowdown -c -m liens_provisoires.txt "${line}" | awk '/^Link active/{$1="";print $0;exit}')"
> # et on lance son téléchargement
> echo "On télécharge ${LIEN}"
> plowdown -v3 --captchabhood='login:pass' "${LIEN}"
> done
Retrieving list (jheberg): http://www.jheberg.net/download/6E4gPW-naruto-shippuden-pisode-209-avi
Retrieving list (jheberg): http://www.jheberg.net/download/WAdI3x-naruto-shippuden-pisode-210-avi
Retrieving list (jheberg): http://www.jheberg.net/download/1FYdSL-naruto-shippuden-pisode-211-avi
Retrieving list (jheberg): http://www.jheberg.net/download/jcU0pL-naruto-shippuden-pisode-212-avi
Retrieving list (jheberg): http://www.jheberg.net/download/8kVVGt-naruto-shippuden-pisode-213-avi
Retrieving list (jheberg): http://www.jheberg.net/download/b1uWZw-naruto-shippuden-pisode-214-avi
^C
Celle-ci avec "xargs" doit me rapprocher du but sauf que je cherche à avoir un fichier temporaire liens_provisoires.txt qui stockerait seulement les liens de chaque url jheberg, alors que là il me met tous les liens de toutes les url jheberg.
Pour moi il faut que ton script
while read line
> do
> # on récupère le premier lien valide
> LIEN="$(plowdown -c -m liens_provisoires.txt "${line}" | awk '/^Link active/{$1="";print $0;exit}')"
> # et on lance son téléchargement
> echo "On télécharge ${LIEN}"
> plowdown -v3 --captchabhood='login:pass' "${LIEN}"
> done
commence après chaque
Retrieving list (jheberg): http://www.jheberg.net/download/6E4gPW- … de-209-avi
Comment faire ?
Hors ligne
#15 Le 16/02/2013, à 03:44
- nesthib
Re : [RESOLU] script plowshare et multihoster
Tu ne lances pas du tout ce que je t'ai proposé, je ne sais pas pourquoi tu rajoutes ce « cat Naruto_jheberg.txt | xargs plowlist >liens_provisoires.txt | » mais ça n'a aucun sens. Tu ne devrais qu'avoir à insérer les deux commandes manquantes. Ma proposition lit déjà le fichier avec les liens. Il n'y a pas besoin de fichier temporaire.
GUL Bordeaux : Giroll – Services libres : TdCT.org
Hide in your shell, scripts & astuces : applications dans un tunnel – smart wget – trouver des pdf – install. auto de paquets – sauvegarde auto – ♥ awk
⃛ɹǝsn xnuᴉꞁ uʍop-ǝpᴉsdn
Hors ligne
#16 Le 16/02/2013, à 15:44
- Mathal44
Re : [RESOLU] script plowshare et multihoster
En fait c'est parce que j'avais essayé ta proposition tel quel mais ça ne marchait pas car il faut d'abord extraire les liens de chaque url jheberg avec plowlist :
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$ while read line
> do
> # on récupère le premier lien valide
> LIEN="$(plowdown -m -c "${line}" | awk '/^Link active/{$1="";print $0;exit}')"
> # et on lance son téléchargement
> echo "On télécharge ${LIEN}"
> plowdown -v3 --captchabhood='login:pass' "${LIEN}"
> done <Naruto_jheberg.txt
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: cannot stat '': No such file or directory
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
Skip: no module for URL (http://www.jheberg.net/)
Note: This URL (jheberg) is supported by plowlist
On télécharge
dbg: plowdown: --captchabhood selected
Skip: cannot stat '': No such file or directory
^C
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$
J'ai donc essayé d'ajouter l'extraction avant ta boucle mais avec le résultat que j'ai mis dans mon dernier message.
Comment ajouter cette extraction pour que ça marche ?
EDIT: Ha je vois d'où viens la discordance: en fait dans ma réponse #10, j'ai indiqué ce que donnait plowlist avec une url jheberg en entrée, mais le résultat que j'ai donné était passé entre temps par la commande "plowdown -c -m" d'abord pour vérifier si les liens étaient valides.
Voici le premier résultat de "plowlist" avec une url jheberg:
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$ plowlist http://www.jheberg.net/download/6E4gPW-naruto-shippuden-pisode-209-avi > Naruto209.txt
Retrieving list (jheberg): http://www.jheberg.net/download/6E4gPW-naruto-shippuden-pisode-209-avi
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$ cat Naruto209.txt
# Uptobox
http://uptobox.com/n7dba7ubdkdm
# Free
http://dl.free.fr/kNL3uMqxz
# Rapidgator
http://rapidgator.net/file/62108214/Naruto_Shippuden_\u00c3\u00a9pisode_209.avi.html
# Freakshare
http://freakshare.com/files/7cq3j4zc/Naruto-Shippuden---pisode-209.avi.html
# Rapidshare
http://rapidshare.com/files/671889758/Naruto Shippuden \u00c3\u00a9pisode 209.avi
# 2shared
http://www.2shared.com/video/ymJKHoWN/Naruto_Shippuden_pisode_209.html
# Uploaded
http://uploaded.to/file/xhhpiutq
# Filecloud
http://filecloud.io/0vqm4dzt
# 1fichier
http://xhc36f.1fichier.com/
# Filerio
http://filerio.in/kjqduw6c9vjo
# Depositfiles
http://depositfiles.com/files/887edz3z3
# Turbobit
http://turbobit.net/ywj3onzs2e1c.html
# Netload
http://netload.in/dateiTjvY9vY2pE/NarutoShippudenÃpisode209.avi.htm
Puis la commande "plowdown -c -m" qui vérifie les liens:
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$ plowdown -c -m Naruto209.txt
Starting download (uptobox): http://uptobox.com/n7dba7ubdkdm
Link is not alive: file not found
link marked in file `Naruto209.txt' (#NOTFOUND)
Starting download (dl_free_fr): http://dl.free.fr/kNL3uMqxz
Link active: http://dl.free.fr/kNL3uMqxz
http://dl.free.fr/kNL3uMqxz
Starting download (rapidgator): http://rapidgator.net/file/62108214/Naruto_Shippuden_\u00c3\u00a9pisode_209.avi.html
Link is not alive: file not found
link marked in file `Naruto209.txt' (#NOTFOUND)
Starting download (freakshare): http://freakshare.com/files/7cq3j4zc/Naruto-Shippuden---pisode-209.avi.html
Link is not alive: file not found
link marked in file `Naruto209.txt' (#NOTFOUND)
Starting download (rapidshare): http://rapidshare.com/files/671889758/Naruto%20Shippuden%20\u00c3\u00a9pisode%20209.avi
Link is not alive: file not found
link marked in file `Naruto209.txt' (#NOTFOUND)
Starting download (2shared): http://www.2shared.com/video/ymJKHoWN/Naruto_Shippuden_pisode_209.html
Link is not alive: file not found
link marked in file `Naruto209.txt' (#NOTFOUND)
Starting download (uploaded_net): http://uploaded.to/file/xhhpiutq
Link is not alive: file not found
link marked in file `Naruto209.txt' (#NOTFOUND)
Skip: no module for URL (http://filecloud.io/)
link marked in file `Naruto209.txt' (#NOMODULE)
Starting download (1fichier): http://xhc36f.1fichier.com/
Link active: http://xhc36f.1fichier.com/
http://xhc36f.1fichier.com/
Skip: no module for URL (http://filerio.in/)
link marked in file `Naruto209.txt' (#NOMODULE)
Starting download (depositfiles): http://depositfiles.com/files/887edz3z3
Link is not alive: file not found
link marked in file `Naruto209.txt' (#NOTFOUND)
Starting download (turbobit): http://turbobit.net/ywj3onzs2e1c.html
Link is not alive: file not found
link marked in file `Naruto209.txt' (#NOTFOUND)
Starting download (netload_in): http://netload.in/dateiTjvY9vY2pE/NarutoShippudenÃpisode209.avi.htm
Link is not alive: file not found
link marked in file `Naruto209.txt' (#NOTFOUND)
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$ cat Naruto209.txt
# Uptobox
#NOTFOUND http://uptobox.com/n7dba7ubdkdm
# Free
http://dl.free.fr/kNL3uMqxz
# Rapidgator
http://rapidgator.net/file/62108214/Naruto_Shippuden_\u00c3\u00a9pisode_209.avi.html
# Freakshare
#NOTFOUND http://freakshare.com/files/7cq3j4zc/Naruto-Shippuden---pisode-209.avi.html
# Rapidshare
http://rapidshare.com/files/671889758/Naruto Shippuden \u00c3\u00a9pisode 209.avi
# 2shared
#NOTFOUND http://www.2shared.com/video/ymJKHoWN/Naruto_Shippuden_pisode_209.html
# Uploaded
#NOTFOUND http://uploaded.to/file/xhhpiutq
# Filecloud
#NOMODULE http://filecloud.io/0vqm4dzt
# 1fichier
http://xhc36f.1fichier.com/
# Filerio
#NOMODULE http://filerio.in/kjqduw6c9vjo
# Depositfiles
#NOTFOUND http://depositfiles.com/files/887edz3z3
# Turbobit
#NOTFOUND http://turbobit.net/ywj3onzs2e1c.html
# Netload
#NOTFOUND http://netload.in/dateiTjvY9vY2pE/NarutoShippudenÃpisode209.avi.htm
mathal@Mathal-ubuntu:~/Téléchargements/Naruto$
Dernière modification par Mathal44 (Le 16/02/2013, à 16:01)
Hors ligne
#17 Le 16/02/2013, à 18:38
- nesthib
Re : [RESOLU] script plowshare et multihoster
[…] # on récupère le premier lien valide LIEN="$(commande_qui_liste_les_liens_valides "${line}" | awk '/^Link active/{$1="";print $0;exit}')" […]
[…] > # on récupère le premier lien valide > LIEN="$(plowdown -m -c "${line}" | awk '/^Link active/{$1="";print $0;exit}')" […]
Je n'avais pas compris ce que faisait plowdown (je pensais que c'était plowlist). Du coup je ne pense pas que l'entrée soit bonne.
Tu as toutes les clés en main pour faire ton script, il te suffit de faire un peu attention à ce que tu fais et de réfléchir logiquement. Effectivement le rôle de chaque commande tel que tu les présentais n'était pas clair.
Je t'ai fourni un squelette pour ton script, il ne te manque qu'à l'interfacer correctement avec l'API de ton plow{list,down}, ce que je ne peux pas faire à ta place (je ne connais pas leur fonctionnement, ni celui de ton jheberg). Tu auras éventuellement à modifier un peu les boucles 1- pour boucler sur les lignes de ton fichier avec les URL d'origine (et passer à plowlist) 2- pour boucler sur les liens retournés par plowlist et les envoyer à plowdown. Réfléchi bien à ce que fait chaque partie et chaque commande. Vérifie également comment chaque commande prend ses informations en entrée, soit en lisant un fichier (auquel cas tu devras passer par des fichiers temporaire) soit sur l'entrée standard ou en argument.
Comme je l'ai dit auparavant, je ne pense pas que ta demande (téléchargement d'animes) ait sa place ici (relire les règles du forum), je ne répondrai donc plus à ce fil. Si tu as d'autres questions plus spécifiques (comment traiter telle chaîne de caractères), tu peux les poser dans une autre discussion.
Bon courage.
GUL Bordeaux : Giroll – Services libres : TdCT.org
Hide in your shell, scripts & astuces : applications dans un tunnel – smart wget – trouver des pdf – install. auto de paquets – sauvegarde auto – ♥ awk
⃛ɹǝsn xnuᴉꞁ uʍop-ǝpᴉsdn
Hors ligne
#18 Le 17/02/2013, à 02:59
- Mathal44
Re : [RESOLU] script plowshare et multihoster
D'accord pas de souci, je comprends que cela puisse poser problème.
Note qu'à l'origine je ne demandais pas un script pour le téléchargement mais pour mettre le premier lien valide trouvé à la suite d'un fichier texte.
Du coup je pense qu'il faut je fasse deux boucles mais je ne sais pas si c'est possible :
while read line
> do
> # on récupère la liste de liens de chaque url jheberg
> plowlist liens_jheberg.txt "${line}" > liens_extraits.txt
while read line
> do
> # on récupère le premier lien valide
> LIEN="$(plowdown -c -m liens_extraits.txt "${line}" | awk '/^Link active/{$1="";print $0;exit}')"
> # et on ajoute le lien valide au fichier texte de sortie
> LIEN >>liens_valides.txt
> done liens_extraits.txt
> done liens_jheberg.txt
Je pense ouvrir une autre discussion pour cibler la boucle interne déjà
EDIT: ça y est j'ai trouvé une boucle qui marche !
while read line
do
plowlist "${line}" >liens_provisoires.txt
plowdown -m -c liens_provisoires.txt
grep -m 1 "^http://" liens_provisoires.txt >>liens_valides.txt
done <liens_jheberg.txt
extra, merci beaucoup nesthib
Dernière modification par Mathal44 (Le 18/02/2013, à 01:57)
Hors ligne