FlexRSS plugin

Suggest, post, or discuss plugins for Deluge
Locked
psyberOne
Member
Member
Posts: 12
Joined: Tue Sep 04, 2007 5:48 am

Re: FlexRSS plugin

Post by psyberOne »

This plug-in is not supposed to be easy to use. It is, as the plugin description says, "...extremely powerful, configurable, unforgiving, and difficult." Early on, it was decided that this plugin would be there for the advanced users, and the 'Simple RSS' plug-in would be there for people who don't want to deal with regular expressions. I've tried to make it pretty easy to use (for instance, if you were to right-click the entry in the feeds tab for that "How I Met Your Mother" episode, and choose "create filter", the regex would have been automatically created for you), but I'm not willing to sacrifice the regular expressions.
After your last post this plug-in is making a little more sense where it falls. I tried the SimpleRSS plug-in and it was WAY too weak, so I did a little reading/research on regex and I'm getting better, it's been years since I last had to use it and I'm really rusty. I didn't realize that the create filter function was there until it was pointed out in the forum, and I had no intent to get you to remove the regex. After exploring further with the plug-in I did see the tv history filter, so I think that covered pretty much everything I needed from an RSS plug-in. I am impressed at how it handles, with some basic regex it works much better than the RSSFeed plug-in in AZ. The only thing I think would be REALLY useful is a basic overview of functions, i.e. "proper documentation", would definitely help with the learning curve.

I do have one quick bug question, with one of my feeds, it works perfectly the first time around, i.e. Start Deluge -> Add Feed & Cookies. For that initial session it runs fine, and grabs the updated feeds. If I close Deluge and re-run it I get this error, it also shows up when I try to refresh the feed.

Code: Select all

Raising error: libtorrent reports this is a duplicate torrent
Error: 'libtorrent reports this is a duplicate torrent'
FlexRSS: torrent already exists.
Traceback (most recent call last):
  File "/var/lib/python-support/python2.4/deluge/interface.py", line 886, in update
    self.plugins.update_active_plugins()
  File "/var/lib/python-support/python2.4/deluge/plugins.py", line 107, in update_active_plugins
    plugin.update()
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 1636, in update
    self.parse_feed(self.feeds[id]['cfg']['id'])
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 1603, in parse_feed
    self.config.addHistory(filter['id'], filter['type'], match)
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 158, in addHistory
    filter['history'][type].append(data['url'])
AttributeError: 'dict' object has no attribute 'append'
If I remove the feed and re-add it it works again, and it's only on one feed.
daddy
Seeder
Seeder
Posts: 100
Joined: Sun Jul 22, 2007 12:14 am

Re: FlexRSS plugin

Post by daddy »

psyberOne wrote:The only thing I think would be REALLY useful is a basic overview of functions, i.e. "proper documentation", would definitely help with the learning curve.
Yeah. I hate writing documentation. A lot. Documenting code is okay, but user guide stuff kills me. I'll get to it eventually.
psyberOne wrote:I do have one quick bug question, with one of my feeds, it works perfectly the first time around, i.e. Start Deluge -> Add Feed & Cookies. For that initial session it runs fine, and grabs the updated feeds. If I close Deluge and re-run it I get this error, it also shows up when I try to refresh the feed.

Code: Select all

Raising error: libtorrent reports this is a duplicate torrent
Error: 'libtorrent reports this is a duplicate torrent'
FlexRSS: torrent already exists.
Traceback (most recent call last):
  File "/var/lib/python-support/python2.4/deluge/interface.py", line 886, in update
    self.plugins.update_active_plugins()
  File "/var/lib/python-support/python2.4/deluge/plugins.py", line 107, in update_active_plugins
    plugin.update()
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 1636, in update
    self.parse_feed(self.feeds[id]['cfg']['id'])
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 1603, in parse_feed
    self.config.addHistory(filter['id'], filter['type'], match)
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 158, in addHistory
    filter['history'][type].append(data['url'])
AttributeError: 'dict' object has no attribute 'append'
If I remove the feed and re-add it it works again, and it's only on one feed.
Ah, looks like the generic filter type's history management is broken. Sorry about that--the only time I use generic filters is in conjunction with the delete when matched option. Anyways, I uploaded a new version that should fix the bug--if you have any more problems, let me know.
psyberOne
Member
Member
Posts: 12
Joined: Tue Sep 04, 2007 5:48 am

Re: FlexRSS plugin

Post by psyberOne »

Thanks for the quick turnaround on the patch; it's working better now, it's retrieving part of the feed now but it's spewing out this error:

Code: Select all

Raising error: libtorrent reports this is a duplicate torrent
Error: 'libtorrent reports this is a duplicate torrent'
FlexRSS: torrent already exists.
Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/deluge/plugins.py", line 110, in update_active_plugins
    plugin.update()
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 1642, in update
    self.parse_feed(self.feeds[id]['cfg']['id'])
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 1591, in parse_feed
    h_from = filter['history'][filter['type']].get('from', None)
AttributeError: 'list' object has no attribute 'get'
let me know if you need any more details like the feed address.
daddy
Seeder
Seeder
Posts: 100
Joined: Sun Jul 22, 2007 12:14 am

Re: FlexRSS plugin

Post by daddy »

Can you give this a try and let me know how it works out? If it fixes the problem I'll update the tarball again.
Attachments
plugin.py.gz
(10.92 KiB) Downloaded 441 times
psyberOne
Member
Member
Posts: 12
Joined: Tue Sep 04, 2007 5:48 am

Re: FlexRSS plugin

Post by psyberOne »

I still get this error when initially parsing the feed that I use the generic filter on:

Code: Select all

Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/deluge/plugins.py", line 110, in update_active_plugins
    plugin.update()
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 1646, in update
    self.parse_feed(self.feeds[id]['cfg']['id'])
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 1595, in parse_feed
    h_from = filter['history'][filter['type']].get('from', None)
AttributeError: 'list' object has no attribute 'get'
And then this when saving that filter:

Code: Select all

Traceback (most recent call last):
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 758, in configure_cb_filter_save
    if filter['history'][filter['type']].has_key('from'):
AttributeError: 'list' object has no attribute 'has_key'
I'm not too sure what exactly is going on, but it seems like it's trying to process the generic filter as a tv feed. It's referring to 'from' I'm assuming that's the from/thru pairing. I'll try making the filter a TV(Dated) since the release does use yyyy-mm-dd format but is only released every week or so.
daddy
Seeder
Seeder
Posts: 100
Joined: Sun Jul 22, 2007 12:14 am

Re: FlexRSS plugin

Post by daddy »

psyberOne wrote:I still get this error when initially parsing the feed that I use the generic filter on:

Code: Select all

Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/deluge/plugins.py", line 110, in update_active_plugins
    plugin.update()
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 1646, in update
    self.parse_feed(self.feeds[id]['cfg']['id'])
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 1595, in parse_feed
    h_from = filter['history'][filter['type']].get('from', None)
AttributeError: 'list' object has no attribute 'get'
[/;uote]

Damnit that was stupid. Just had to change an '==' to an '!=' (maybe it was the other way around... whatever). I was doing the special handling for generic filters (the stuff I just added) for filters that weren't generic, and the code for other filters only for generic filters.
psyberOne wrote:And then this when saving that filter:

Code: Select all

Traceback (most recent call last):
  File "/home/psyber/.config/deluge/plugins/FlexRSS/plugin.py", line 758, in configure_cb_filter_save
    if filter['history'][filter['type']].has_key('from'):
AttributeError: 'list' object has no attribute 'has_key'
Ah, okay that makes sense. Fixed :)
psyberOne wrote:I'm not too sure what exactly is going on, but it seems like it's trying to process the generic filter as a tv feed. It's referring to 'from' I'm assuming that's the from/thru pairing. I'll try making the filter a TV(Dated) since the release does use yyyy-mm-dd format but is only released every week or so.
Close. I apparently wrote a lot of the history restriction code without accounting for generic feeds, which can't handle for history restriction. Their history is stored as a list, and the tv show and tv show (dated) filters are in dictionaries (hash table).

Anyways, I'll upload 0.1.11 right now, which *should* fix everything. Sorry for the inconvenience, but thanks for helping solve your problems :).
psyberOne
Member
Member
Posts: 12
Joined: Tue Sep 04, 2007 5:48 am

Re: FlexRSS plugin

Post by psyberOne »

No problem. I just tried out the latest version and am glad to report that all of the previous errors are gone. :D I'll test it out more but for now it does everything I need, great work.
User avatar
chaky
Member
Member
Posts: 14
Joined: Fri May 25, 2007 8:18 pm
Location: Croatia, Europe
Contact:

Re: FlexRSS plugin

Post by chaky »

Hello!

How do I make filter, so that Deluge will only download a TV Show from release groups like XOR or LOL, but not from CTU and not x264 releases.

Torrents which I want to download, look like this:
Prison.Break.S03E01.HDTV.XviD-XOR

and I do not want this:
Prison.Break.S03E01.720p.HDTV.x264-CTU or Prison.Break.S03E01.HR.HDTV.XviD-CTU

Thanks in advance. :-)
psyberOne
Member
Member
Posts: 12
Joined: Tue Sep 04, 2007 5:48 am

Re: FlexRSS plugin

Post by psyberOne »

I just went through this process, so here's a quick overview. (please correct me if I miss anything)

Create a filter -> TV Show

Label it Prison Break

set the filter to this:
Prison.Break.s%se%e.hdtv.xvid-(XOR|LOL)
or
Prison.Break.s%se%e.hdtv.xvid-(?!CTU)

and the super paranoid version:
Prison\.Break\.s%se%e\.hdtv\.xvid-(?!CTU) (in regex . is a wildcard depending on the use \. treats it as a regular period)

the s%s will pick up the season, e%e will grab the episode, and (XOR|LOL) will match if it's either of them, you can add more in there separated by |. (?!CTU) will match anything but CTU.
if I'm not mistaken this filter system is case insensitive so you dont have to worry about caps.

Don't forget to save it, you can test the filter out by either copying the label in there or just click on the rss feed entry.
After you save it you'll see options to set episode filters, this is handy if your tracker keeps old episodes around past the end of the season.
User avatar
chaky
Member
Member
Posts: 14
Joined: Fri May 25, 2007 8:18 pm
Location: Croatia, Europe
Contact:

Re: FlexRSS plugin

Post by chaky »

Thank you psyberOne
Locked