Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TIP] free webspace bash uploader
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools)
View previous topic :: View next topic  
Author Message
makoomba
Bodhisattva
Bodhisattva


Joined: 03 Jun 2004
Posts: 1856

PostPosted: Wed May 17, 2006 6:19 pm    Post subject: [TIP] free webspace bash uploader Reply with quote

avendo la necessità di inviare qualche grosso file e troppo pigro per usare firefox ogni volta, ho partorito uno scrippettino
Code:
#!/bin/bash
site="http://www.mooload.com"
upload="index.php"
field="filetoupload"
search1="file.php"
search2="/files/"

function usage() {
    echo Usage: $(basename $0) filename|download link
    exit
}

[ $1 ] || usage

if echo $1 | grep $site &>/dev/null; then
    download=$1                                                                                                           
else
    [ -f $1 ] || usage
    download=$(curl  -F "$field=@$1"  $site/$upload  | grep "$search1" | cut -d'"' -f2 | head -n1 | sed -e "s|^|$site/|" )
fi   
direct=$(wget -O - "$download" 2>/dev/null| grep "$search2" | cut -d'"' -f2)
echo "download link        : $download"
echo "direct download link : $direct"


lo script utilizza curl per inviare il file a http://www.mooload.com

http://www.mooload.com wrote:
the ultimate source for all your file hosting needs. Upload anything you like with confidence.


l'utilizzo è alquanto banale
Code:
./upload.sh test.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2896  100  2633  100   263   2370    236  0:00:01  0:00:01 --:--:-- 26867
download link        : http://www.mooload.com/file.php?file=files/170506/1147890084/test.txt
direct download link : http://195.210.38.23:2082//dl/817c21f7a6ead7b289d0a2747ac00035/446b69a5/files/170506/1147890084/test.txt


il direct download link ha una durata limitata ma evita il passaggio dal browser
per ottenere un nuovo direct download link, basta usare il download link al posto del file
Code:
user101 ~ # ./upload.sh  http://www.mooload.com/file.php?file=files/170506/1147890084/test.txt
download link        : http://www.mooload.com/file.php?file=files/170506/1147890084/test.txt
direct download link : http://195.210.38.23:2082//dl/0cbae929f851cc30f287e0abd9508988/446b69de/files/170506/1147890084/test.txt


dalla sezione "varie ed eventuali", passo e chiudo.
_________________
When all else fails, read the instructions.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum