Add --keep argument to download torrent files to local directory
This commit is contained in:
@ -224,6 +224,10 @@ def update_torrents():
|
||||
config['mame-directory'],
|
||||
torrent['remote-name']
|
||||
)
|
||||
new_torrent = os.path.join(
|
||||
config['torrent-directory'],
|
||||
torrent['remote-name']+'.torrent'
|
||||
)
|
||||
|
||||
client.torrent.remove(torrent['transmission-id'])
|
||||
os.rename(old_name, new_name)
|
||||
@ -234,6 +238,9 @@ def update_torrents():
|
||||
paused=False
|
||||
)
|
||||
|
||||
if args.keep:
|
||||
t = requests.get(torrent['remote-link'], verify=False)
|
||||
open(new_torrent, 'wb').write(t.content)
|
||||
|
||||
if __name__ == '__main__':
|
||||
logging.basicConfig(
|
||||
@ -253,6 +260,11 @@ if __name__ == '__main__':
|
||||
action='store_true',
|
||||
help='Display debugging messages'
|
||||
)
|
||||
parser.add_argument(
|
||||
'-k', '--keep',
|
||||
action='store_true',
|
||||
help='Keep torrent files localy'
|
||||
)
|
||||
parser.add_argument(
|
||||
'-c', '--countdown',
|
||||
action='store_true',
|
||||
|
Reference in New Issue
Block a user