[FeedScript] ImdbWatchlist - RSS with IMDb integration

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
hugbug
Developer & Admin
Posts: 7224
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [FeedScript] ImdbWatchlist - RSS with IMDb integration

Post by hugbug » 29 Sep 2016, 04:38

Check part 1 of the detailed guide. You'll see that your feed isn't suitable for that script as the feed misses necessary fields.

slapkey
Posts: 5
Joined: 20 Mar 2015, 04:36

Re: [FeedScript] ImdbWatchlist - RSS with IMDb integration

Post by slapkey » 24 Oct 2016, 22:14

I'm having a similar issue as one of the previous posters. I grabbed the feedscript and added per the instructions, and am using Dognzb RSS.
Here's the feed: https://dognzb.cr/rss.cfm?r=<hidmykey>&t=2040&num=100 -- it looks just like the example, and contains the mentioned XML when I use the URL.

Without the feedscript, "Preview Feed" produces a full list, here's a snippet: http://i.imgur.com/5rdbX7c.png


But after adding the feedscript, it says this

Code: Select all

Could not read feed

Request: {"nocache":1477347250904,"method":"previewfeed","params":[1,"ImdbWatchlist","https://dognzb.cr/rss.cfm?r=<hidmykey>&t=2040&num=100","",false,true,"",0,15,"ImdbWatchlist.py",false,0,""]}

Close

hugbug
Developer & Admin
Posts: 7224
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [FeedScript] ImdbWatchlist - RSS with IMDb integration

Post by hugbug » 24 Oct 2016, 22:57

There are usually messages in the log after that eror dialog.

You also need to add "&extended=1" to the url.

slapkey
Posts: 5
Joined: 20 Mar 2015, 04:36

Re: [FeedScript] ImdbWatchlist - RSS with IMDb integration

Post by slapkey » 25 Oct 2016, 03:26

*edit*
Working now. I played around with a couplet things so I don't know what fixed it, but I believe it was adding Python to my system path. It was installed, but not in my path. Not sure if that was it or something else, though.
*edit*

Ran again with extended, here are the other messages: http://i.imgur.com/MT93nL1.png

Code: Select all

Could not read feed

Request: {"nocache":1477365702195,"method":"previewfeed","params":[1,"ImdbWatchlist","https://dognzb.cr/rss.cfm?r=<HIDDEN>&t=2040&num=100&extended=1","",false,false,"",0,15,"ImdbWatchlist.py",false,0,""]}

Close
I also ran it using AltHub's RSS feed, and had the same results. Preview before the script works, but after I get the same messages.

Microx
Posts: 10
Joined: 17 Aug 2013, 20:33

Re: [FeedScript] ImdbWatchlist - RSS with IMDb integration

Post by Microx » 02 Dec 2017, 09:06

hugbug, you should probably update that there is a version 1.2 you made to address an issue with RSS coming from NBZgeek ?

Microx
Posts: 10
Joined: 17 Aug 2013, 20:33

Re: [FeedScript] ImdbWatchlist - RSS with IMDb integration

Post by Microx » 11 Dec 2017, 21:18

Hi. Would have anyone using the script noticed that it has stopped working since a few days? Could you kindly try? it's been working fine for as long I can remember. I don't think I had made changes and broke things and my troubleshooting has not found the root cause. Thanks!

silhouette
Posts: 14
Joined: 12 Dec 2018, 08:34

Re: [FeedScript] ImdbWatchlist - RSS with IMDb integration

Post by silhouette » 12 Dec 2018, 20:25

I figured out that I could make a few very small adjustment to the script to make it identify watch list ID’s from the IMDB html page.

Even more interesting it would be possible to make the script flexible to retrieve items from any URL in html.

It would just require a field, for a comma separated list of URLs.

And two additional fields for the respective custom Start strings and End Strings.

And the of course some coding love.

These are the amendments I made to the original script to make it work with the current html imdb list, and a non standard NZB feed.

To fetch the IMDB id's from a defined public list instead of the watch list:

From:
url = 'http://rss.imdb.com/user/ur%s/watchlist' % (imdbid)
To:
url = 'http://imdb.com/list/ls%s/' % (imdbid)


Adjustment made to find the imdb-id line in the html code.

From:
ID_SIGNATURE_START = ' <guid>http://www.imdb.com/title/tt'
ID_SIGNATURE_END = '/</guid>'
To:
ID_SIGNATURE_START = ' "url": "/title/tt'
ID_SIGNATURE_END = '/"'

Adjustments made to the newznab feed item matching to make it work on the custom nzb feed.
From:
if line.find(':attr') > -1 and line.find('imdb') > -1:
pe = line.rfind('"')
ps = line.rfind('"', 0, pe-1)
item_id = line[ps+1:pe]
To:
if line.find('href="https://www.imdb.com') > -1 and line.find('IMDB') > -1:
pe = line.rfind('/">')
ps = line.rfind('tt', 0, pe-1)
item_id = line[ps+2:pe]

It would be more flexible, if we could check for all identified ID’s in the item text.

This would make the script work on any nzb feed, as long as they contain the relevant ID’s

It would be great of we would also have field to assign categories based on the source of the ID. This would enable custom filters and post processing based on which list the item came from.

While I can’t code I would presume that 95% of the work is already there.

I have written a more detailed explanation beneath.

silhouette
Posts: 14
Joined: 12 Dec 2018, 08:34

Re: [FeedScript] ImdbWatchlist - RSS with IMDb integration

Post by silhouette » 12 Dec 2018, 20:27

Changes to make the script universal in terms of list source, RSS feed formatting, filtering and custom post processing-

Please bare with me while the explanation is long, I don’t think that it would require changing more than 5% of the code.

This script could easily be adjusted to strip id's from any html page containing a list of relevant id's- Not only IMDB ID’s.

Step 1. Accommodate any website with levant id’s in the page source.
Step 2. Match relevant items in different RSS feeds
Option 2.a Current method
Option 2.b Flexible method

Step 1. Accommodate any website with levant id’s in the page source.

I would the run a slightly adapted version of the current script. I would adapt the line, and string identification. currently used for the nzb feed, to make the script adaptable to any html page containing relevant id's . It wouldn't matter if that is rage id's or imdb'id's as long as the nzb feed contains the same id's.

If we include the ‘tt’ part of the id, the script would become more robust to use for other types, as for instane tv-rage.

Field.1: a comma separated list of urls containing a list of items.

Field.2: user optional: comma separated list of categories or another parameter which would be assigned to results from the corresponding lists above.

Field.3: comma separated lists of corresponding start string

Field.4: comma separated list of corresponding end strings

Field 3. and 4 would also be used for identifying the relevant lines.


By making the above adaptations any nzb feed containing relevant id's could be paired with any and multiple web pages containing wanted id's.

Step 2. Match relevant items in different RSS feeds

There are two ways to identify the item's from the nzb feed, containing the id's identified above.

Either way it should be possible to assign a category or parameter to the item, based on the source of the ID, and the list in field 2.

Solution 2.a

Current (inflexible) method of pairing the identified ID’s with the NZB feed.

To accommodate multiple feeds with different formatting, We would need three more fields. The downside of using this method, is that it wouldn't be possible to mix and match for instance tv-rage and imdb id’s

RSS Feedname as set in RSS

Field.RSS.Name

To isolate the relevant ID, we would need two more fields to define the Corresponding Start and End strings;

Field.RSS.Start
Field.RSS.End

It would be great, if we could set a category or another parameter for each item to carry over the source of the ID:

Solution 2.b

Flexible method that would make it possible to identify any type of ID for each item in the nzb feed.

The flexible solution would be to inspect each item in the nzb feed for each of the id's identified in source lists, and assign the corresponding user defined Categories in the process. This option would be very flexible as we could search for any form of id without out any concern for how the nzb feed is formatted as long as the ID is present.

The point of assigning categories based on the source, is that it would be possible to maintain separate lists, for items that would require additional filters. For example one list could be for items should have the string ‘MULTI’ in the title. Another list could be items which have no special requirements.

While it might sound a tat tedious it is really rather simple. It is my impression that it would only require small adjustments to the original script to achieve this enormous flexibility. Support for different html lists, support for any nzb feed, which contain the relevant ID’s regardless of formatting, and source information, which might be relevant for defining filters or post processing.

hugbug
Developer & Admin
Posts: 7224
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [FeedScript] ImdbWatchlist - RSS with IMDb integration

Post by hugbug » 15 Dec 2018, 13:03

I wrote this script as a demo of feed script function. I don't use the script myself and I'm afraid I'm not going to improve the script further.

However the script is totally open source and if someone wants to improve it feel free to post your versions either in this thread or as separate topics.

silhouette
Posts: 14
Joined: 12 Dec 2018, 08:34

Re: [FeedScript] ImdbWatchlist - RSS with IMDb integration

Post by silhouette » 15 Dec 2018, 13:16

Makes sense.

I might give it a shot.

It is actually possible to get any public imdb list in csv format, which makes it even simpler.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests