![]() Registered Member ![]()
|
I am trying to write a script for KTorrent in python.
However, I am having trouble locating the files in a torrent. My first attempt (from reading the API) was to use the tor.numFiles() and tor.filePathOnDisk() functions, but for some reason when a torrent contains only a single file tor.numFiles() and tor.filePathOnDisk(0) do not return a value. As far as I can tell the only way to do this is to use tor.name() to get the file name and tor.dataDir() to get the folder location. My function to retrieve the files in a folder looks like this:
Yet this still does not work. For some torrents tor.dataDir() returns "/", but I cannot work out why? Is this a bug, or is the API just poorly documented? How else can I find the path to the data of a single file torrent in a script? |
![]() Moderator ![]()
|
It seems the dataDir of some torrents has been corrupted, this should not happen.
However you are right I need to add a call to get the path on disk of the torrent. |
Registered users: Bing [Bot], Evergrowing, Google [Bot]