#!/usr/bin/python
import smtplib
import sys
from time import strftime
dl_name = sys.argv[1]
dl_location = sys.argv[2]
dl_time = strftime("%d.%m.%Y - %H:%M:%S")
to = '[b]yourusername[/b]@gmail.com'
gmail_user = '[b]yourusername[/b]'
gmail_pwd = '[b]yourpassword[/b]'
smtpserver = smtplib.SMTP("smtp.gmail.com",587)
smtpserver.ehlo()
smtpserver.starttls()
smtpserver.ehlo
smtpserver.login(gmail_user, gmail_pwd)
header = 'To:' + to + '\n' + 'From: ' + gmail_user + '\n' + 'Subject: Download abgeschlossen: '+dl_name+' \n' + 'Content-Type: text/html \n'
#print header
stylesheet = '<style type="text/css">body { font-family: Verdana; font-size: 11px; } a { text-decoration: none; color: grey } #footer { color:grey; } a:hover { color: orange; }</style>'
logo = '<img src="http://pyload.org/lib/tpl/pyload//images/pyload-logo-edited3.5-new-font-small.png" /><br />'
msg = header + '\n' + stylesheet + '\n'+logo+'Hallo,<br />\n\n<br />der Download von <b>'+dl_name+'</b> ist abgeschlossen ('+dl_time+').\n<br />Er befindet sich in '+dl_location+'.\n\n<br /><hr /><span id="footer">Powered by <a href="http://pyload.org">pyLoad</a>!</span>'
smtpserver.sendmail(gmail_user, to, msg)
#print 'done!'
smtpserver.close()#!/usr/bin/perl
use strict;
use Net::Telnet();
my %config = ( USERNAME => 'user', PASSWORD => 'pass', HOST => '192.168.1.254');
my $t = new Net::Telnet(Timeout => 5, Prompt => '/\=\>(\[.*\])?$/');
$t->open( $config{HOST} );
$t->login( $config{USERNAME}, $config{PASSWORD} );
$t->cmd(":ppp ifdetach intf=Internet");
$t->cmd(":ppp ifattach intf=Internet");
$t->errmode(sub {die @_ unless $_[0] =~ /eof/});
$t->cmd("exit");#!/bin/bash
echo "STEP 1: Create ID"
curl -b cookies.txt -c cookies.txt -m 10 "http://USER:PWD@IP/RST_st_poe.htm" > html.txt
ID=""
while read LINE && [ "$ID" == "" ]
do
CUT=${LINE##*st_poe.cgi?id=}
if [ "$CUT" != "$LINE" ]
then
ID=${CUT%%\">*}
fi
done < html.txt
echo "STEP 2: Disconnect"
curl -b cookies.txt -c cookies.txt -m 10 -d "ConMethod=Disconnect" "http://USER:PWD@IP/st_poe.cgi?id=$ID" > /dev/null
echo "STEP 3: Connect"
curl -b cookies.txt -c cookies.txt -m 10 -d "ConMethod=++Connect++" "http://USER:PWD@IP/st_poe.cgi?id=$ID" > /dev/null#!/bin/sh
curl "http://192.168.1.1/admin.cgi" -d "active_page=9117&page_title=Stato+Modem&mimic_button_field=submit_button_disattiva%3A+nat..&button_value=&strip_page_top=0 " > /dev/null
sleep 5
curl "http:// 192.168.1.1/admin.cgi" -d "active_page=9117&page_title=Stato+Modem&mimic_button_field=submit_button_attiva%3A+nat..&button_value=nat&strip_page_top=0 " > /dev/null
DHMH wrote:Maybe an extra forum would be better?
Here's my first user script:
(only german, maybe I will translate it)
GoogleMail pyLoad Notifier 0.1
- Code:
#!/usr/bin/python
import smtplib
import sys
from time import strftime
dl_name = sys.argv[1]
dl_location = sys.argv[2]
dl_time = strftime("%d.%m.%Y - %H:%M:%S")
to = '[b]yourusername[/b]@gmail.com'
gmail_user = '[b]yourusername[/b]'
gmail_pwd = '[b]yourpassword[/b]'
smtpserver = smtplib.SMTP("smtp.gmail.com",587)
smtpserver.ehlo()
smtpserver.starttls()
smtpserver.ehlo
smtpserver.login(gmail_user, gmail_pwd)
header = 'To:' + to + '\n' + 'From: ' + gmail_user + '\n' + 'Subject: Download abgeschlossen: '+dl_name+' \n' + 'Content-Type: text/html \n'
#print header
stylesheet = '<style type="text/css">body { font-family: Verdana; font-size: 11px; } a { text-decoration: none; color: grey } #footer { color:grey; } a:hover { color: orange; }</style>'
logo = '<img src="http://pyload.org/lib/tpl/pyload//images/pyload-logo-edited3.5-new-font-small.png" /><br />'
msg = header + '\n' + stylesheet + '\n'+logo+'Hallo,<br />\n\n<br />der Download von <b>'+dl_name+'</b> ist abgeschlossen ('+dl_time+').\n<br />Er befindet sich in '+dl_location+'.\n\n<br /><hr /><span id="footer">Powered by <a href="http://pyload.org">pyLoad</a>!</span>'
smtpserver.sendmail(gmail_user, to, msg)
#print 'done!'
smtpserver.close()
Install:
Change the bold written information to your login credentials and copy the script to a file named 'mail.py'.
Save it to pyload/scripts/package_finished.
You need to restart pyLoad! in order to apply the script.
That's it!
Have fun!
Users browsing this forum: No registered users and 5 guests