Page 1 of 1

Get torrent info before adding?

Posted: Thu Sep 30, 2010 10:20 pm
by forkandspoon
Hi,

I'm new to Deluge plugin development but thinking of writing a plugin that lets you add a torrent (that you already had downloaded in past) and it recursively auto scans your drive for the files (pieces) and if they exist, then sets that to be the download location so it can seed from there.

Question is in core.py of a custom plugin, I know

Code: Select all

component.get("TorrentManager")[torrent_id].get_files()
will give you a list of files from a torrent already added.

But is it possible to call get_files() BEFORE the torrent is added to the TorrentManager?

Or do I have to decode the .torrent file manually?

Re: Get torrent info before adding?

Posted: Sun Oct 24, 2010 10:15 pm
by grebb
I've been thinking about a plugin like this too. I haven't had a real look at any deluge code yet but there should be a lot that can be reused for this, some of which should solve your problem. I have some experience with python and would like to help. Is there any special reason for scanning recursively?

I'm thinking the fastest approach would be to first look for similarities in the name and/or size. Then use deluges built in verification on the files/folders. That's as far as I've been thinking.

Re: Get torrent info before adding?

Posted: Sun Oct 24, 2010 10:26 pm
by johnnyg

Re: Get torrent info before adding?

Posted: Sun Oct 24, 2010 10:43 pm
by grebb
wow perfect :)

With some luck "os" can make some nice returns on file structures. That way the scan wouldn't have to be painfully slow. We need to put down all the options and result presentation that is needed in the plugin.

the choice to not complementing the torrent by default. we need to set the torrent state in detail there.
setting path of the scan.