Get torrent info before adding?

Suggest, post, or discuss plugins for Deluge
Post Reply
forkandspoon
Member
Member
Posts: 11
Joined: Wed Sep 15, 2010 10:34 pm

Get torrent info before adding?

Post 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?
grebb
New User
New User
Posts: 4
Joined: Sun Oct 24, 2010 6:01 pm

Re: Get torrent info before adding?

Post 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.
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: Get torrent info before adding?

Post by johnnyg »

grebb
New User
New User
Posts: 4
Joined: Sun Oct 24, 2010 6:01 pm

Re: Get torrent info before adding?

Post 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.
Post Reply