Last active
January 1, 2016 13:09
-
-
Save tynn/8149610 to your computer and use it in GitHub Desktop.
Add a torrent to Transmission with the download directory set to the torrents parent directory.
This might not work as intended if Transmission already keeps track of the torrent to be added or for any other reason.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# 2013 CC0 http://creativecommons.org/publicdomain/zero/1.0/ | |
import os.path, sys, transmissionrpc | |
tc = transmissionrpc.Client() | |
for torrent in map(os.path.abspath, sys.argv[1:]) : | |
try : tc.add_torrent(torrent, download_dir = os.path.dirname(torrent)) | |
except : print ("Failed adding {0:s}".format(torrent)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment