[RELEASE] XBMC Flicks - Netflix Movies / TV Shows (Video) experimental Addon for XBMC

  Thread Rating:
  • 15 Votes - 4.4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
fr0sty Offline
Junior Member
Posts: 27
Joined: Oct 2009
Reputation: 0
Post: #1021
(2012-09-25 19:46)patdavid Wrote:  
(2012-09-25 19:42)fr0sty Wrote:  running xbmcbuntu, downloaded the zip https://github.com/spudsdude/XBMC-Flicks/zipball/master
then i did install from zip, and got the following error:
"add-on does not have the correct structure"

line in my xbmc.log says:
19:41:01 T:2906594160 WARNING: Create - Unsupported protocol(script) in script://

I am not sure here, but I think that you cannot add it on from the .zip file?

I personally just unzipped it directly into my "addons" folder, and went from there (per the instructions)

I followed the instructions:
'You will need to unzip that file to your add-on directory and restart XBMC and the add-on should be available for you.'

But still dont see anything.. Never had any problems installing plugins before.
find quote
mcithic Offline
Junior Member
Posts: 1
Joined: Sep 2012
Reputation: 0
Post: #1022
I'm having trouble that I can't seem to find a similar post for. I can successfully get authentication, but when I go to any content, there are always "0 items retrieved" and nothing displayed (e.g., in the instant queue, or any other place content might be posted). What can I do to fix this? Or debug the issue? I've tried re-installing XBMCFlicks, restarting XBMC, restarting the computer, clearing browsing data, deleting the XBMCFlicks add on folder and re-authenticating - all multiple times. I'm running the latest eden pvr version of xbmc, and windows 7.
find quote
dordar Offline
Junior Member
Posts: 21
Joined: Apr 2012
Reputation: 0
Post: #1023
(2012-09-26 06:41)mcithic Wrote:  I'm having trouble that I can't seem to find a similar post for. I can successfully get authentication, but when I go to any content, there are always "0 items retrieved" and nothing displayed (e.g., in the instant queue, or any other place content might be posted). What can I do to fix this? Or debug the issue? I've tried re-installing XBMCFlicks, restarting XBMC, restarting the computer, clearing browsing data, deleting the XBMCFlicks add on folder and re-authenticating - all multiple times. I'm running the latest eden pvr version of xbmc, and windows 7.

If you go back a few forum posts (around page 100) then you will see that this issue has been adressed and partly solved.

(2012-09-24 20:49)patdavid Wrote:  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:

  1. 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):
    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
    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...

    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.
  2. 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.

Thank you so much Patdavid! I will try it when I get back home, but reading other peoples feedback it seems plausible that it will work for me as well!
(This post was last modified: 2012-09-26 09:24 by dordar.)
find quote
mantene Offline
Junior Member
Posts: 11
Joined: May 2012
Reputation: 0
Post: #1024
Patdavid, Thank you so much for all the work you have already put into this!
find quote
patdavid Offline
Junior Member
Posts: 16
Joined: Sep 2012
Reputation: 0
Post: #1025
Ok, just a quick update on where I am...

I'm going to mostly abandon the way fekker approached a bunch of things, but still use a lot of what has already been assembled (because I'm lazy, and learning all this xbmc addon stuff is hard! Smile )

I have refactored the entire section that parses data for movies only. Calls using the Netflix API were returning JSON objects, and I am just using those to fill out the movie data, and passing it back into the functions that are already there.

Basically, instead of having to do this to get the movie/show Title:

Code:
matchTitle = re.search(r'[\'"]title[\'"]: {.*?[\'"]regular[\'"]: u{0,1}(\'|")(.*?)\1.*?},', curQueueItem, re.DOTALL | re.MULTILINE)

if matchTitle:
     curX.Title = matchTitle.group(2).strip()

I can instead just do this:
Code:
if 'title' in curQueueItem:
     curX.Title = curQueueItem['title']['regular']

Using the JSON object as it's intended (or a python <dict> type, apparently). This is WAY cleaner and easier to maintain going forward, I think. I can only assume that in the past the results returned from the Netflix API were nastier, necessitating the ugly regex that fekker previously used (and seriously, who wants to try to maintain that?)

Now that I understand a little better what the underlying logic should be, I can move forward into TV shows next, then things like recently watched, recommended, new arrivals, search, etc...

I won't be focusing on queue management at all, unless I'm feeling up for it later (instant or disc). I don't really manage my queue from my tv (phone and computer instead). Just FYI.

I also have NO idea how to release the final results back into the wild at the moment (nor do I think it would be a good idea right now, anyway - too many things are broken). I may ask for some help later in how to go about doing that.

Onward!
find quote
patdavid Offline
Junior Member
Posts: 16
Joined: Sep 2012
Reputation: 0
Post: #1026
Quick question for those of you who have previously used this add-on: When listing TV shows, did the seasons always auto-expand? (meaning - when entering a show directory, were the seasons ever shown as sub-directories, or were all the episodes always auto-expanded?)
find quote
mantene Offline
Junior Member
Posts: 11
Joined: May 2012
Reputation: 0
Post: #1027
Patdavid: For me, the TV shows always appeared on a single level. No subfolders or any real organization into seasons. Just:

1x01
1x02
1x03
1x04
.
.
.
2x01
2x02
2x03
and so on all in a single list (with the episode names as well as numbers)

Mantene
find quote
fekker Offline
Posting Freak
Posts: 1,545
Joined: Oct 2008
Reputation: 30
Post: #1028
(2012-09-26 23:17)patdavid Wrote:  Quick question for those of you who have previously used this add-on: When listing TV shows, did the seasons always auto-expand? (meaning - when entering a show directory, were the seasons ever shown as sub-directories, or were all the episodes always auto-expanded?)
There's been a few different way's since the original release, it would generally change as Netflix changes there stuff.

Glad to see someone helping out, I'm always busy these days.

Side note, regex's are hard to read, but so powerful Big Grin .. most where in place so i could just throw multiple sources at it as netflix api has always been a mixed bag of crazy when it returns it's results, that and I was using multiple api versions along with other sources.

Wanna know the secret to regex's not making you pull your hair out? regex buddy, it rocks the house
(This post was last modified: 2012-09-27 06:50 by fekker.)
find quote
patdavid Offline
Junior Member
Posts: 16
Joined: Sep 2012
Reputation: 0
Post: #1029
(2012-09-27 06:42)fekker Wrote:  as netflix api has always been a mixed bag of crazy when it returns it's results

This pretty much answers the question about the regex's. Smile

I had pretty much figured that this was the case. I'm reasonably familiar with regex's in general, so that's not really the problem for me - I was just figuring that the Netflix.py already retrieved the items in JSON, so might as well use those objects as they are returned instead of munging the string representation of it.

On a side note, using the objects directly in the <dict> fixes a lot of character encoding issues (took me a while to figure out that u'some string' = unicode object in python. Now instead of stripping quotes and other characters, you can decode to utf-8 directly with the object (which is nice).
find quote
elmerohueso Offline
Senior Member
Posts: 274
Joined: Jul 2011
Reputation: 4
Post: #1030
(2012-09-26 23:17)patdavid Wrote:  Quick question for those of you who have previously used this add-on: When listing TV shows, did the seasons always auto-expand? (meaning - when entering a show directory, were the seasons ever shown as sub-directories, or were all the episodes always auto-expanded?)

Yes. I think I read something on the Netflix API blog about this being the norm.
find quote
TWoods Offline
Junior Member
Posts: 1
Joined: Sep 2012
Reputation: 0
Post: #1031
On September 15th Netflix changed the location of the catalogs for movies etc. If you read iqueue.py you will see multiple references to the catalog like so:

Code:
http://api.netflix.com/catalog/titles/movies/
These links WILL NOT work after September 15th.


The catalog URL was changed to 2 different URLs on September 15th. One for streaming and one for DVDs. Netflix also added a bit to the URL to show that it is the public api.
The new URLs are as follows:
Code:
http://api-public.netflix.com/catalog/titles/streaming

http://api-public.netflix.com/catalog/titles/dvd


I suspect none of us are getting results because there is no catalog at the previous location.
I am going to go thru and see what happens when these URLs are changed to their proper new addresses.

EDIT: I should have also added that the location for the api has changed, so ANY links that reference the old netflix API locations will be broken. For example from my log file I get:
Code:
http://api.netflix.com/users/reallyreallyreallylongstringoflettersandnumbershere/queues/instant
This SHOULD fetch my instant queue, but it cannot because of the addition of the -public bit to the api URLs.


This needs to be changed to:
Code:
http://api-public.netflix.com/users/reallyreallyreallylongstringoflettersandnumbershere/queues/instant
(This post was last modified: 2012-09-28 09:45 by TWoods.)
find quote
patdavid Offline
Junior Member
Posts: 16
Joined: Sep 2012
Reputation: 0
Post: #1032
Just a small update, I've refactored how TV shows are listed now as well. The next bit is to fix getting the episode data, which I should be able to get to over the weekend I hope.

And I've heard from fekker with an offer to help me understand better what might be going on (which is a huge help). I may have something ready to push out in a preliminary form next week.

A bigger issue I'd like to address is that I am seeing 504 gateway timeout errors on my requests if I set the max instant items to retrieve high. I've only got 151 items in my instant queue, so it's not too bad for me, but for others with more items might see errors.

I'm trying to determine the best way around this. At the moment I may break up requests into 50 or 75 request chunks, and just process them on my end.
find quote
schwarznavy Offline
Junior Member
Posts: 9
Joined: Sep 2012
Reputation: 0
Post: #1033
Greetings. Can anyone help me? I am running XBMC 11.0 with confluence vertical skin on a Win 8 64-bit box.

I verified that I can browse in IE to Netflix and stream videos correctly.

I cleared my silverlight cache, and cleared my browser cache (only have IE installed).
I installed the latest version (spudsdude-XBMC-Flicks-xxxxx) from zip, exited XBMC, and renamed the folder to plugin.video.xbmcflicks.
When I launched XBMC > XBMCFlicks and selecting Instant Queue, I get an "Error Scipt Failed." No browser was launched. My \AppData\Roaming\XBMC\userdata\addon_data\plugin.video.xbmcflicks\userinfo.txt is empty. My advancedsettings.xml and playercorefactory.xml are correct.

Since I have xbmcflicks debugging on, this is what I see in my xbmc.log:

Code:
10:37:14 T:744  NOTICE: -->Python Interpreter Initialized<--
10:37:14 T:744  NOTICE: ##########################################################
10:37:14 T:744  NOTICE: Arg1: 0
10:37:14 T:744  NOTICE: Arg2:
10:37:14 T:744  NOTICE: Mode: 0
10:37:14 T:744  NOTICE: ##########################################################
10:37:14 T:4376  NOTICE: -->Python Interpreter Initialized<--
10:37:14 T:4376  NOTICE: ##########################################################
10:37:14 T:4376  NOTICE: Arg1: 0
10:37:14 T:4376  NOTICE: Arg2: ?mode=0
10:37:14 T:4376  NOTICE: Mode: 0
10:37:14 T:4376  NOTICE: ##########################################################
10:37:15 T:4392  NOTICE: -->Python Interpreter Initialized<--
10:37:15 T:4392  NOTICE: ##########################################################
10:37:15 T:4392  NOTICE: Arg1: 0
10:37:15 T:4392  NOTICE: Arg2: ?mode=10
10:37:15 T:4392  NOTICE: Mode: 10
10:37:15 T:4392  NOTICE: ##########################################################
10:37:15 T:4392  NOTICE: USER INFO FILE LOC: C:\Users\___<redacted>____\AppData\Roaming\XBMC\userdata\addon_data\plugin.video.xbmcflicks\userinf​o.txt
10:37:15 T:4392  NOTICE: couldn't load user information from userinfo.txt file
10:37:15 T:4392  NOTICE: .. getAuth called ..
10:37:15 T:4392  NOTICE: OSX Setting is set to: False
10:37:15 T:4392  NOTICE: .. user configured ..
10:37:15 T:4392   ERROR: Error Type: <class 'socket.error'>
10:37:15 T:4392   ERROR: Error Contents: [Errno 10054] An existing connection was forcibly closed by the remote host
10:37:15 T:4392   ERROR: Traceback (most recent call last):
                                              File "C:\Users\___<redacted>____\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\default.py", line 26, in <module>
                                                import resources.lib.menu as menu
                                              File "C:\Users\___<redacted>____\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\resources\lib\menu.p​y", line 474, in <module>
                                                getInstantQueue()
                                              File "C:\Users\___<redacted>____\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\resources\lib\iqueue​.py", line 1378, in getInstantQueue
                                                initApp()
                                              File "C:\Users\___<redacted>____\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\resources\lib\iqueue​.py", line 1373, in initApp
                                                user = getAuth(netflixClient,VERBOSE_USER_LOG)
                                              File "C:\Users\___<redacted>____\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\resources\lib\iqueue​.py", line 61, in getAuth
                                                (tok, url) = netflix.user.getRequestToken()
                                              File "C:\Users\___<redacted>____\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\resources\lib\Netfli​x.py", line 45, in getRequestToken
                                                response = client.connection.getresponse()
                                              File "C:\Program Files (x86)\XBMC\system\python\Lib\httplib.py", line 990, in getresponse
                                                response.begin()
                                              File "C:\Program Files (x86)\XBMC\system\python\Lib\httplib.py", line 391, in begin
                                                version, status, reason = self._read_status()
                                              File "C:\Program Files (x86)\XBMC\system\python\Lib\httplib.py", line 349, in _read_status
                                                line = self.fp.readline()
                                              File "C:\Program Files (x86)\XBMC\system\python\Lib\socket.py", line 427, in readline
                                                data = recv(1)
                                            error: [Errno 10054] An existing connection was forcibly closed by the remote host
10:37:15 T:4704   ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.xbmcflicks/?mode=10
10:37:15 T:4704   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.xbmcflicks/?mode=10) failed
10:37:15 T:4380  NOTICE: -->Python Interpreter Initialized<--
10:37:16 T:4380  NOTICE: ##########################################################
10:37:16 T:4380  NOTICE: Arg1: 0
10:37:16 T:4380  NOTICE: Arg2: ?mode=0
10:37:16 T:4380  NOTICE: Mode: 0
10:37:16 T:4380  NOTICE: ##########################################################

Thank you. I really appreciate any assistance.
find quote
elmerohueso Offline
Senior Member
Posts: 274
Joined: Jul 2011
Reputation: 4
Post: #1034
(2012-09-28 16:33)patdavid Wrote:  At the moment I may break up requests into 50 or 75 request chunks.
This sounds good. Perhaps include the option to choose how may results to display per page.
find quote
patdavid Offline
Junior Member
Posts: 16
Joined: Sep 2012
Reputation: 0
Post: #1035
(2012-09-28 17:05)elmerohueso Wrote:  
(2012-09-28 16:33)patdavid Wrote:  At the moment I may break up requests into 50 or 75 request chunks.
This sounds good. Perhaps include the option to choose how may results to display per page.

I am probably going to do it transparently to the user - meaning I will grab multiple "pages" of data, but munge them together before you see the output in the gui. This way you'll just see a complete listing.
find quote
Post Reply