2012-09-24, 20:49
Okay, I've got it solved, but it cost me a bit of time searching and tracing...
Disclaimer: This is a hackish solution to getting TV listings working again. Don't blame me if your TV explodes and you melt things down.
There are two places where you need to modify iqueue.py:
A caveat - your episode list for a show will autoexpand to show all the episodes (as opposed to season folders) - still working on that.
Having never programmed in Python before, or written an add-on for XBMC, this was a royal PITA to track down what was happening.
On the other hand, there are a ton of regex's that fekker used (for legacy reasons maybe?) to scrape the data from the API calls to Netflix. Given that most of what is needed to update this addon to something more modern is now available (mainly JSON return objects from netflix calls that should remove the need for any nasty regex building), I think I will just start from scratch (sort of) and rebuild this thing.
Hopefully this hack will hold other users over until I can put something worth using out.
Oh, and let me know if anyone tries this. Hopefully it should work, but if there's problems just get back to me here.
Disclaimer: This is a hackish solution to getting TV listings working again. Don't blame me if your TV explodes and you melt things down.
There are two places where you need to modify iqueue.py:
- First you need to hack a check for the instant availability of your tv show. Find the function that checks for instant availability (this IF statement begins around line 802 in a stock install of xbmc-flicks):
See that last "else" statement? We have to suppress the return, and force the addon to say that the show is available for instant streaming...Code:#see if we are filtering for Instant Only Items
if (instantAvail):
......
else:
#api data will return a string the following regex will parse
matchIA = re.search(r"delivery_formats': {(.*?instant.*?)}", curQueueItem, re.DOTALL | re.MULTILINE)
if matchIA:
matched = re.search(r"instant", matchIA.group(1))
if(not matched):
print "Item Filtered Out, it's not viewable instantly: " + curX.Title
return curX
else:
curX.IsInstantAvailable = True
else:
return curX
So replace the very last "return curX" with:
Code:curX.IsInstantAvailable = True
#return curX
The last else statement will now look like this:
Code:else:
curX.IsInstantAvailable = True
#return curX
I have only tested this in a limited sense, so YMMV.
- And second we need to fix a URL in a regex later on. Around line 914 you'll find this:
Code:matchAllEpisodesRealID = re.search(r"http://api.netflix.com/catalog/titles/programs/\d{1,15}/(?P<id>\d{1,15})", curXe.TvEpisodeNetflixID, re.DOTALL | re.MULTILINE)
Just change the "api" portion of the URL in the regex so it should look like this:
Code:matchAllEpisodesRealID = re.search(r"http://api-public.netflix.com/catalog/titles/programs/\d{1,15}/(?P<id>\d{1,15})", curXe.TvEpisodeNetflixID, re.DOTALL | re.MULTILINE)
A caveat - your episode list for a show will autoexpand to show all the episodes (as opposed to season folders) - still working on that.
Having never programmed in Python before, or written an add-on for XBMC, this was a royal PITA to track down what was happening.
On the other hand, there are a ton of regex's that fekker used (for legacy reasons maybe?) to scrape the data from the API calls to Netflix. Given that most of what is needed to update this addon to something more modern is now available (mainly JSON return objects from netflix calls that should remove the need for any nasty regex building), I think I will just start from scratch (sort of) and rebuild this thing.
Hopefully this hack will hold other users over until I can put something worth using out.
Oh, and let me know if anyone tries this. Hopefully it should work, but if there's problems just get back to me here.