Page 62 of 62

Re: [Plugin] YaRSS2 - RSS plugin with GTKUI support

Posted: Mon Nov 13, 2017 2:33 pm
by DragooNick
You didn't get my question. I had a problem with 2 different daemons running, but I fixed it myself.

Re: [Plugin] YaRSS2 - RSS plugin with GTKUI support

Posted: Fri Dec 08, 2017 12:31 am
by s2501191
pstryk wrote:Hi,
I have a problem with autolabeling of torrents from RSS feed. The download works ok - no issues there, but it will just not autolabel them.


I also had this issue and after a little experimentation found that this was only for RSS feeds using magnet links. Long story short looked at the code and here is how you can fix it (in the most brutish of ways).

Find the .egg file for the plugin. For me this was

Code: Select all

.config/deluge/plugins/YaRSS2-1.4.3-py2.7.egg


This is really just a zip file, so take a copy and unzip it. You will have two folders EGG-INFO and yarss2. Look inside yarss2 and find the file torrent_handling.py.

Navigate to line 126:

Code: Select all

if download.is_magnet:
            self.log.info("Adding magnet: '%s'" % torrent_url)
            download.torrent_id = component.get("TorrentManager").add(options=options,
                                                                      magnet=utf8_encoded(download.url))
        else:
            # Error occured
            if not download.success:
                self.log.warn("Failed to add '%s'." % (torrent_url))
                return download
            self.log.info("Adding torrent: '%s'." % (torrent_url))
            # Get the torrent data from the torrent file
            try:
                torrentinfo.TorrentInfo(filedump=download.filedump)
            except Exception, e:
                download.set_error("Unable to open torrent file: %s. Error: %s" % (torrent_url, str(e)))
                self.log.warn(download.error_msg)
            download.torrent_id = component.get("TorrentManager").add(filedump=download.filedump,
                                                                      filename=os.path.basename(torrent_url),
                                                                      options=options)
            download.success = download.torrent_id is not None
            if download.success is False and download.error_msg is None:
                download.set_error("Failed to add torrent to Deluge. Is the torrent already added?")
                self.log.warn(download.error_msg)
            else:
                if "Label" in component.get("Core").get_enabled_plugins() and\
                   subscription_data and subscription_data.get("label", ""):
                    component.get("CorePlugin.Label").set_torrent(download.torrent_id, subscription_data["label"])
        return download


Note that the magnet link does not have anything to add labels, this exists only for torrent links, so copy that section so that it is used for magnet links too. Your code from line 126 should now look like this:

Code: Select all

if download.is_magnet:
            self.log.info("Adding magnet: '%s'" % torrent_url)
            download.torrent_id = component.get("TorrentManager").add(options=options,
                                                                      magnet=utf8_encoded(download.url))
            if "Label" in component.get("Core").get_enabled_plugins() and\
                   subscription_data and subscription_data.get("label", ""):
                    component.get("CorePlugin.Label").set_torrent(download.torrent_id, subscription_data["label"])
        else:
            # Error occured
            if not download.success:
                self.log.warn("Failed to add '%s'." % (torrent_url))
                return download
            self.log.info("Adding torrent: '%s'." % (torrent_url))
            # Get the torrent data from the torrent file
            try:
                torrentinfo.TorrentInfo(filedump=download.filedump)
            except Exception, e:
                download.set_error("Unable to open torrent file: %s. Error: %s" % (torrent_url, str(e)))
                self.log.warn(download.error_msg)
            download.torrent_id = component.get("TorrentManager").add(filedump=download.filedump,
                                                                      filename=os.path.basename(torrent_url),
                                                                      options=options)
            download.success = download.torrent_id is not None
            if download.success is False and download.error_msg is None:
                download.set_error("Failed to add torrent to Deluge. Is the torrent already added?")
                self.log.warn(download.error_msg)
            else:
                if "Label" in component.get("Core").get_enabled_plugins() and\
                   subscription_data and subscription_data.get("label", ""):
                    component.get("CorePlugin.Label").set_torrent(download.torrent_id, subscription_data["label"])
        return download


I then deleted torrent_handling.pyc and ran the following python code snippet to regenerate it:

Code: Select all

import os
from torrent_handling import TorrentHandler


This will give an error message upon running but will regenerate the torrent_handling.pyc. Fairly sure this step was unnecessary, but can't be arsed to do this again to check. Anyone with more idea of what they're doing than me please feel free to chime in on this :)

Then zip your two folders back up and change your zip back to YaRSS2-1.4.3-py2.7.egg

Then stop your services, back up the original egg file and replace it with your doctored one. Restart services and RSS feeds with magnet links should now work with labeling.

Off topic I'm not sure if the bitbucket repo is being maintained, so as of yet I haven't filed a bug report.

Additionally how are we still using an insecure connection for logging onto this forum? It's 2017 people this is embarrassing!

Re: [Plugin] YaRSS2 - RSS plugin with GTKUI support

Posted: Fri Dec 08, 2017 10:38 pm
by corkerss
Hello,

Connected to feed, Can fetch all the titles but the downloads do not start.

Running on RasPi 2 with Jessie Stretch

(2017-12-08T22:24:09): Fetching subscription 'test'.
(2017-12-08T22:24:09): Fetching RSS Feed: 'rarbg' with Cookie: '{}' and User-agent: 'Deluge v1.3.13 YaRSS2 v1.4.3 Linux/4.9.59+'.
(2017-12-08T22:24:09): bozo_exception when parsing rssfeed: <urlopen error [Errno 104] Connection reset by peer>
(2017-12-08T22:24:09): No items retrieved

I tested the feed on MacOSX with uTorrent and worked fine

Thank you

Re: [Plugin] YaRSS2 - RSS plugin with GTKUI support

Posted: Sat Dec 09, 2017 1:11 pm
by s2501191
corkerss wrote:Hello,

Connected to feed, Can fetch all the titles but the downloads do not start.

Running on RasPi 2 with Jessie Stretch

(2017-12-08T22:24:09): Fetching subscription 'test'.
(2017-12-08T22:24:09): Fetching RSS Feed: 'rarbg' with Cookie: '{}' and User-agent: 'Deluge v1.3.13 YaRSS2 v1.4.3 Linux/4.9.59+'.
(2017-12-08T22:24:09): bozo_exception when parsing rssfeed: <urlopen error [Errno 104] Connection reset by peer>
(2017-12-08T22:24:09): No items retrieved

I tested the feed on MacOSX with uTorrent and worked fine

Thank you


Is this failing for all feeds you try? Can you share the feed you are using?

Re: [Plugin] YaRSS2 - RSS plugin with GTKUI support

Posted: Sat Dec 09, 2017 3:30 pm
by corkerss
Hi

Feed is https://rarbg.to/rssdd_magnet.php. Currently only use this feed. First install so testing on random torrents to get working

YaRSS2 version 1.4.3 with Python 2.7

Deluge thin client being run in Ubuntu VM on Mac Host over and NordVPN

Re: [Plugin] YaRSS2 - RSS plugin with GTKUI support

Posted: Sun Dec 10, 2017 1:27 pm
by AmJohn
I am unable to get this to automatically label torrents. I have selected the label but it does not get assigned.
Does anyone know a fix for this? Or even better would be if anyone knew how to have torrents downloaded from RSS be assigned a labelplus label.