Can I execute some script when torrent finished
Can I execute some script when torrent finished
Something like rtorrent, when torrent is finished, exec some script: move/copy/delete some file that downloaded, etc.
Re: Can I execute some script when torrent finished
there's a plugin in trunk which does this, it should be available in 1.2
Re: Can I execute some script when torrent finished
Any ETA on 1.2?
Re: Can I execute some script when torrent finished
Yes? No?jazd wrote:Any ETA on 1.2?
Re: Can I execute some script when torrent finished
There's no official release date for 1.2; it'll be released when it's ready 

Re: Can I execute some script when torrent finished
Fair enough, is there any way to run a script when a torrent finishes in 1.1.9 then? I think there is a plugin in the repository or something right? Will it work on 1.1.9?johnnyg wrote:There's no official release date for 1.2; it'll be released when it's ready
Re: Can I execute some script when torrent finished
the plugin is in trunk (future 1.2) which has rather significant changes to 1.1.9 so no it will unfortunately not work.
I'd suggest either writing a ui client script or using the "move completed to" functionality to run a script.
I'd suggest either writing a ui client script or using the "move completed to" functionality to run a script.
Re: Can I execute some script when torrent finished
Here is an ui client example may helpful.jazd wrote: Fair enough, is there any way to run a script when a torrent finishes in 1.1.9 then? I think there is a plugin in the repository or something right? Will it work on 1.1.9?
Code: Select all
#!/usr/bin/env python
from deluge.ui.client import sclient
sclient.set_core_uri()
torrent_ids = sclient.get_session_state()
TORRENT_KEYS = ['name', 'total_size', 'num_files', 'num_pieces', 'piece_length',
'eta', 'ratio', 'file_progress', 'distributed_copies', 'total_done',
'total_uploaded', 'state', 'paused', 'progress', 'next_announce',
'total_payload_download', 'total_payload_upload', 'download_payload_rate',
'upload_payload_rate', 'num_peers', 'num_seeds', 'total_peers', 'total_seeds',
'total_wanted', 'tracker', 'trackers', 'tracker_status', 'save_path',
'files', 'file_priorities', 'compact', 'max_connections',
'max_upload_slots', 'max_download_speed', 'prioritize_first_last',
'private','max_upload_speed','queue','peers',
"active_time", "seeding_time", "seed_rank", "is_auto_managed", #stats
"stop_at_ratio","stop_ratio","remove_at_ratio" #ratio
]
cmp=([],[])
for id in torrent_ids:
idstatus=sclient.get_torrent_status(id,TORRENT_KEYS)
if idstatus['progress']==100:
#for x in idstatus.keys():
# print x,idstatus[x]
cmp[0].append(id)
cmp[1].append(idstatus['name'])
sclient.remove_torrent(cmp[0],None)
import shutil,os
for x in cmp[1]:
#shutil.move('/home/kevin/Downloads/'+x.encode("utf-8"),'/home/kevin/cmp/')
print 'move ',x,'to','/home/kevin/cmp/'
# http://docs.python.org/library/os.html#os-process
# os.execl('/bin/ls','-al')