[Plugin] YaRSS2 - RSS plugin with GTKUI support

Suggest, post, or discuss plugins for Deluge
DragooNick
New User
New User
Posts: 5
Joined: Fri Nov 10, 2017 9:19 am

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

Post by DragooNick »

You didn't get my question. I had a problem with 2 different daemons running, but I fixed it myself.
s2501191
New User
New User
Posts: 2
Joined: Thu Dec 07, 2017 11:54 pm

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

Post 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!
corkerss
New User
New User
Posts: 2
Joined: Fri Dec 08, 2017 10:36 pm

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

Post 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
s2501191
New User
New User
Posts: 2
Joined: Thu Dec 07, 2017 11:54 pm

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

Post 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?
corkerss
New User
New User
Posts: 2
Joined: Fri Dec 08, 2017 10:36 pm

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

Post 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
AmJohn
New User
New User
Posts: 3
Joined: Mon Oct 16, 2017 2:42 pm

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

Post 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.
egdod316
New User
New User
Posts: 2
Joined: Sat Mar 10, 2018 10:37 pm

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

Post by egdod316 »

bro wrote:
tafazzi87 wrote:there is a way to export my configuration and after that import on a new?
You mean copy the config to a new machine or config directory? The YaRSS2 config is stored in yarss2.conf in the deluge config directory. Just copy that file to the new destination.
Hello,
I made a copy of my yarss2.conf file. Then, after setting up deluge on another system, I tried copying it to the appropriate location. But, once I install the yarss2 plugin and restart the deluged service, the yarss2.conf file is restored to its defaults.
Is there a proper way to restore my .conf so I don't have to setup my subscriptions again?
Shryp
Moderator
Moderator
Posts: 521
Joined: Mon Apr 20, 2015 10:20 pm

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

Post by Shryp »

egdod316 wrote:
bro wrote:
tafazzi87 wrote:there is a way to export my configuration and after that import on a new?
You mean copy the config to a new machine or config directory? The YaRSS2 config is stored in yarss2.conf in the deluge config directory. Just copy that file to the new destination.
Hello,
I made a copy of my yarss2.conf file. Then, after setting up deluge on another system, I tried copying it to the appropriate location. But, once I install the yarss2 plugin and restart the deluged service, the yarss2.conf file is restored to its defaults.
Is there a proper way to restore my .conf so I don't have to setup my subscriptions again?
I have never tried just the YaRSS config file, but often I have copied the entire deluge settings folder to new installs or other computers.

Did you copy the YaRSS.conf file and the YaRSS.conf~ file? I believe the tilda is just a backup, but I would copy both just to be sure. Also, maybe try copying the files over after you have the plugin installed. Make sure deluged is shut down when you are copying the files as well.
egdod316
New User
New User
Posts: 2
Joined: Sat Mar 10, 2018 10:37 pm

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

Post by egdod316 »

Shryp wrote:
I have never tried just the YaRSS config file, but often I have copied the entire deluge settings folder to new installs or other computers.

Did you copy the YaRSS.conf file and the YaRSS.conf~ file? I believe the tilda is just a backup, but I would copy both just to be sure. Also, maybe try copying the files over after you have the plugin installed. Make sure deluged is shut down when you are copying the files as well.
Thanks for the reply. I actually wasn't moving Deluge. I was just setting up the remote client on another PC. I installed the YaRss2 plugin but I'm guessing since it was already installed on the OSMC device, I was having an issue with it not wanting to install on the local device. Anyway, I made a copy of the .conf but not the .conf~ and then deleted the plugin. I then reinstalled the plugin and tried copying in the file. I tried a few combinations including starting deluged so that the .conf was generated, stopping deluged, replacing the file and then starting it again but it just kept resetting the file.
Since I didn't copy the other file, I know I somewhat limited the troubleshooting. I've went ahead and set everything up again and now I can stop and restart the service and everything sticks as it should.
Shryp
Moderator
Moderator
Posts: 521
Joined: Mon Apr 20, 2015 10:20 pm

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

Post by Shryp »

egdod316 wrote:
Shryp wrote:
I have never tried just the YaRSS config file, but often I have copied the entire deluge settings folder to new installs or other computers.

Did you copy the YaRSS.conf file and the YaRSS.conf~ file? I believe the tilda is just a backup, but I would copy both just to be sure. Also, maybe try copying the files over after you have the plugin installed. Make sure deluged is shut down when you are copying the files as well.
Thanks for the reply. I actually wasn't moving Deluge. I was just setting up the remote client on another PC. I installed the YaRss2 plugin but I'm guessing since it was already installed on the OSMC device, I was having an issue with it not wanting to install on the local device. Anyway, I made a copy of the .conf but not the .conf~ and then deleted the plugin. I then reinstalled the plugin and tried copying in the file. I tried a few combinations including starting deluged so that the .conf was generated, stopping deluged, replacing the file and then starting it again but it just kept resetting the file.
Since I didn't copy the other file, I know I somewhat limited the troubleshooting. I've went ahead and set everything up again and now I can stop and restart the service and everything sticks as it should.
The config file is only for the system actually doing the downloading. The remote system just gets the plugin installed so you can view the subscriptions if need be.
Post Reply