Last active
October 16, 2016 11:04
-
-
Save mountainpenguin/8ce4673e295a0fb47b59566533dd6dec to your computer and use it in GitHub Desktop.
This file contains hidden or 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 python2 | |
| from modules import rtorrent | |
| from modules import config | |
| import os | |
| if __name__ == "__main__": | |
| conf = config.Config() | |
| socket_file = conf.get("rtorrent_socket") | |
| RT = rtorrent.rtorrent(socket_file) | |
| tlist = RT.getTorrentList() | |
| # find first torrent with a single file | |
| for tid in tlist: | |
| tfiles = RT.getFiles(tid) | |
| if len(tfiles) == 1: | |
| break | |
| # check ajaxPage method | |
| print "default:", RT.conn.directory.default() | |
| print "directory:", RT.conn.d.directory(tid) | |
| rootDir = os.path.abspath(os.path.expanduser(os.path.expandvars(RT.getRootDir()))) | |
| print "rootDir:", rootDir | |
| print "base_path:", tfiles[0].base_path | |
| print "abs_path:", tfiles[0].abs_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment