This script allows you to:
- Store MegaUpload links in a file .list
- Run the script on a shell
- Stop and resume downloads at any time
- Add links to the files even when working
ubugnu@ubugnu-laptop:~$ cd Downloads/ ubugnu@ubugnu-laptop:~$ touch .listthan create the script file
ubugnu@ubugnu-laptop:~$ sudo nano /usr/bin/megaand put
#!/bin/bash
#for l in $@
list=`cat .list`
for l in $list
do
echo "downloading $l..."
url=`wget -qO- $l | grep -P "id=\"downloadlink\"" | grep -oP "(((http)\://){1}\S+)" | grep "megaupload.com\/files" | tr -d "\""`
echo "url found: [$url] sleeping 46 sec..."
sleep 46
wget -c $url
echo "$l downloaded" `date`
sed -i '1 d' .list
done;
make it executable
ubugnu@ubugnu-laptop:~$ sudo chmod +x /usr/bin/megaTo begin downloads, populate the .list file with MegaUpload links (line by line) than enter to the download folder and run the script
ubugnu@ubugnu-laptop:~$ cd Downloads/ ubugnu@ubugnu-laptop:~$ mega
5 commentaires:
le terminal me donne 2 erreurs en ligne 6 et 10
Megaupload a encore mis à jour son système de téléchargement, il faut attendre 46 secondes avant de démarrer les téléchargement, je vais mettre à jour ce billet. Mais je ne sais pas si votre message d'erreur est causé par ça, pouvez-vous coller le stdout ici?
Bonjour,
Merci beaucoup pour ce script. Je viens de m'en inspirer pour en faire un de mon côté et l'améliorer un petit peu. Je viens d'en faire un article sur mon blog, et bien sûr mis un lien vers ton blog.
Voici l'adresse de l'article : Article pour Script Megaupload
Merci encore.
Salut,
Beau travail.
#! /bin/bash
# This script lets you download multiple files from SendSpace.
# Before running this script, do the following steps :
# (1) Get the source code of the SendSpace Folder View page that contains
# the multiple links to the Download pages of the files you want to download ;
# (2) Extract all the Download pages URLs from it and write one per line in pg_url.txt ;
# (3) Set EXT to the filename extension of the files you want to download :
EXT='jpg'
# For several extensions :
#EXT2='avi'
#EXT3='txt'
#etc...
# For each SendSpace Download page URL
for i in `cat pg_url.txt`
do
echo "### $i downloading..."
# Download the Download page.
wget $i
# Extract the Download page filename from its URL.
file=`echo $i | sed 's:^.*/\([^/]*\)$:\1:'`
echo "### $file parsing..."
# Extract the URL of the file to be downloaded from the Download page.
url=`cat $file | grep href | grep $EXT | sed 's/^.*href="\([^"]*\)".*$/\1/'`
# For several filename extensions, use this line instead of the previous one :
#url=`cat $file | grep href | grep -e $EXT -e $EXT2 -e $EXT3 | sed 's/^.*href="\([^"]*\)".*$/\1/'`
echo "### $url downloading..."
# Download the file.
wget $url
# Write the URL of the downloaded pages in a file.
# If something goes wrong, you will be able to restart from the last downloaded page.
echo $i >> downloaded.txt
done
Enregistrer un commentaire