deluged Working Directory
Posted: Sun Aug 29, 2010 7:49 pm
I've been having some trouble with adding torrents by URL through the webui. When a torrent is added this way, deluged tries to first download the torrent file to its current working directory and then adds the torrent. Since I'm running this on a headless Lucid server with deluged being started by the Deluge init script, its working directory is the root (/) directory; my understanding is this is the nature of starting a process with start-stop-daemon. Because I'm not willing to give the deluge user write permissions to the root directory, adding a torrent this way fails every time.
Digging a little deeper, in the add_torrent_url function in core.py, the download filename is simply the filename from the URL (the substring after the last '/' in the URL, ie 'download.torrent' in 'http://foo/bar/download.torrent'), with no additional path given. While I know next to nothing about Python, I would imagine this would cause it to default to a relative path, thus explaining the aforementioned problem. I've worked around this by prefixing filename parameter in the download_file function call with my desired torrent file download path, and, viola, it works. This, of course, is not ideal since it will break again with the next update.
Am I missing something here? I've searched and searched and searched and haven't found anyone else mentioning anything about it, so I'm thinking I'm doing something wrong. Is there someway to set the torrent file download path or change the current working directory? Any input would be greatly appreciated. Thanks!
Digging a little deeper, in the add_torrent_url function in core.py, the download filename is simply the filename from the URL (the substring after the last '/' in the URL, ie 'download.torrent' in 'http://foo/bar/download.torrent'), with no additional path given. While I know next to nothing about Python, I would imagine this would cause it to default to a relative path, thus explaining the aforementioned problem. I've worked around this by prefixing filename parameter in the download_file function call with my desired torrent file download path, and, viola, it works. This, of course, is not ideal since it will break again with the next update.
Am I missing something here? I've searched and searched and searched and haven't found anyone else mentioning anything about it, so I'm thinking I'm doing something wrong. Is there someway to set the torrent file download path or change the current working directory? Any input would be greatly appreciated. Thanks!