I need script what copy my downloaded music content to my dropbox folder. I need that the script reads from lablel tag and then decide do copy or not.
Right now I'm trying to get this script to work, but it dont work at all. dont know what's the problem :/
Deluge_to_dropbox:
Code: Select all
#!/bin/bash
torrentid="$1"
torrentname="$2"
torrentpath="$3"
LABEL=$(/home/user/.flexget/getLabel.py $torrentid)
if [ $LABEL == "music" ]; then
cp -r /media/-Arhiiv-/0day/$torrentname '/home/user/Dropbox/music_2012/'
echo cp /home/user/Downloads/$torrentname "'/home/user/Desktop'" >> /home/user/lastxfer.txt
fi
Code: Select all
#!/usr/bin/python
import sys
from deluge.ui.client import client
from twisted.internet import reactor
# Set up the logger to print out errors
from deluge.log import setupLogger
setupLogger()
d = client.connect()
torrent_id = sys.argv[1]
def on_connect_success(result):
def on_get_torrent_status(torrent):
print torrent["label"]
client.disconnect()
reactor.stop()
client.core.get_torrent_status(torrent_id, ["label"]).addCallback(on_get_torrent_status)
d.addCallback(on_connect_success)
def on_connect_fail(result):
print result
reactor.stop()
d.addErrback(on_connect_fail)
reactor.run()