[WIP] XBMC Flicks (Netflix Addon) Development Thread - Developers Only!
#31
Question for you script folks

I've got a content menu item that should expand out the episodes for tv shows

I'm using the argument as the url so i can parse out the series and season id's, and use those to grab the data in another .py file

Code:
#tv show, expand episodes link
    if(curX.TvShow):
        argsTvShowExpand = str(curX.TvShowLink)
        #print argsTvShowExpand
        runnerTvShow = "XBMC.RunScript(special://home/addons/plugin.video.xbmcflicks/resources/lib/expandTvShows.py, " + argsTvShowExpand + ")"
        commands.append(( 'Expand Episodes', runnerTvShow, ))

It calls expandTvShows.py with the expected argument, however I'm not sure how to get the handle that called the script so that it can update the information in the UI with the episodes

The error returned is
20:46:19 T:6028 M:4294967295 ERROR: XFILE::CPluginDirectory::AddItem - called with an invalid handle.

Which makes sense in that i was just doing int(sys.argv[1]) (which is a url now)

So what is the handle and how do I pass that off to the other script so that I can list a new directory of the episode items??

Thanks in advance.. Fekker
Reply
#32
In trying to get remote control working with EventGhost/Autohotkey using the script I linked above, I'm finding that the AutoHotKey script does not work when the movie is called via
Code:
http://www.netflix.com/WiPlayerCommunityAPI
, but is fine when I change the HTML written out in the script to instead use
Code:
http://www.netflix.com/WiPlayer
. I'm not an expert with AutoHotkey, but I couldn't find any direct references to either of those URLs in the script, so I'm thinking it's a difference in the window naming of the actual Silverlight components that are returned. What is the difference between these two supposed to be?

Also of note, that seems to work if I use Firefox as the handler for .html files, but IE still seems to have some trouble with generating the proper window names for AutoHotkey to pick up; though i don't think that particular issue is your script, as I see the same behavior if I open one of the .html files via File View in XBMC, and the files work ok if I open them directly in Explorer.
Reply
#33
Thanks for the great work on this!

As far as I can tell, the issue with the webbrowser.open() call in OSX is related to the version of Python embedded in XBMC. Running that same call in a script outside of XBMC works great. Not sure if there is a solution to that, but to get around it I added this to iqueue.py...
Code:
import os

def startBrowser(url):
    cmd="open -n '"+url+"'"
    print cmd
    os.system(cmd)

Then replace webbrowser.open(url) with startBrowser(url)
This will launch Safari with the authentication link.

If you'd rather use Firefox you could add this instead:
Code:
import os

def startBrowser(url):
    cmd="open -a firefox '"+url+"'"
    print cmd
    os.system(cmd)

Another adjustment is needed at line 229 to compensation for the difference between OSX and Windows.
Change this:
Code:
addLink(resultTitle,realpath + 'plugin.video.xbmcflicks\\resources\\links\\' + resultIdNumber + '.html', resultPoster)
To this:
Code:
addLink(resultTitle,'file:'+realpath + 'plugin.video.xbmcflicks/resources/links/' + resultIdNumber + '.html', resultPoster)

Hope that helps the Mac folks Smile
Thanks again for spending the time on this!
Reply
#34
fade23 Wrote:In trying to get remote control working with EventGhost/Autohotkey using the script I linked above, I'm finding that the AutoHotKey script does not work when the movie is called via
Code:
http://www.netflix.com/WiPlayerCommunityAPI
, but is fine when I change the HTML written out in the script to instead use
Code:
http://www.netflix.com/WiPlayer
. I'm not an expert with AutoHotkey, but I couldn't find any direct references to either of those URLs in the script, so I'm thinking it's a difference in the window naming of the actual Silverlight components that are returned. What is the difference between these two supposed to be?

Also of note, that seems to work if I use Firefox as the handler for .html files, but IE still seems to have some trouble with generating the proper window names for AutoHotkey to pick up; though i don't think that particular issue is your script, as I see the same behavior if I open one of the .html files via File View in XBMC, and the files work ok if I open them directly in Explorer.

I can make a user setting for which site to use, but i'm curious as to why it would be different based on the url that's used.

I've fixed the path issue, I just ask for the full path instead of a partial i was using.

The browser open fails in Windows with that method, i wonder if there's an option in OS that tells us if we are running under Windows or not.

For episodes, there will be a user setting to expand them out automatically.
- limits, no plot meta data, currently the images are not loading for individual episodes

Plot Information - off by default, adds a significant amount of loading time with a large queue.

Hope to have version 1.0.3 ready later tonight
Reply
#35
Great, thanks for all of your hard work! Smile I've set up the plugin and it works nicely with Eventghost remapping the keys when IE is brought into focus. Are you planning on adding the ability to browse movies and add them to your Instant Watch queue, similar to the Boxee app?
Reply
#36
maruchan Wrote:Great, thanks for all of your hard work! Smile I've set up the plugin and it works nicely with Eventghost remapping the keys when IE is brought into focus. Are you planning on adding the ability to browse movies and add them to your Instant Watch queue, similar to the Boxee app?

My understanding of how to properly interface with XBMC's UI is really very limited. What I think of as simple things are proving to be a pain.

What I would like to do is have the following

Code:
Instant Queue
    * Movies - (Folder)
    * TV - (Folder)
Top Picks - Link that runs a script that gets the Top Picks and displays them
New Movies - Link that runs another script
New Tv - Link that runs another script
Search - Link that displays a search window, then runs a script and displays those
Browse by Genre (Folder)    
    * Action & Adventure - Link that runs a script a displays items
    * Children & Family - Link that runs a script a displays items
    * Classics - Link that runs a script a displays items
    * Comedy - Link that runs a script a displays items
    * Documentary - Link that runs a script a displays items
    * Drama - Link that runs a script a displays items
    * Foreign - Link that runs a script a displays items
    * Horror - Link that runs a script a displays items
    * Romance - Link that runs a script a displays items
    * Sci-Fi & Fantasy - Link that runs a script a displays items
    * Television - Link that runs a script a displays items
    * Thrillers - Link that runs a script a displays items

I'm sure I can get the API call's working for those, but as far as making the UI work right in XBMC I'm struggling and have a limited amount of time to wrap this up.

I'm going to go back through the tutorial and see if i can make sense of things

I'll also see about getting the code somewhere as well so others can contribute
Reply
#37
What's the difference between "Link that runs a script and displays items" and "folder". A folder in a plugin is usually just a link that re-runs the script.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#38
jmarshall Wrote:What's the difference between "Link that runs a script and displays items" and "folder". A folder in a plugin is usually just a link that re-runs the script.

Basically just a noob error on my part, i got it figured out.
Reply
#39
Getting there

Notes: if using OSX, pick it in the addon settings, that changes how it handles the initial browser open so that auth should work (please test)

Version 1.0.3
http://rapidshare.com/files/435805503/pl...flicks.zip

Plot data is not enabled by default, you can enable it in the settings, it will slow the load times, need to write out .nfo files yet so it only loads that once, big impact in queue load time

Debug: shouldn't output any user specific data
Verbose User: don't enable this and post the log file, it's gonna have all your user info, token, secrets, etc.. it's there to debug, be aware of it

Search function.. searches but also makes sure that it's available for instant watching, so it's slow
Recommended, same thing, it makes sure it's available for instant watching, slow

new items, very fast, it's an rss feed that's parsed from netflix of the new data, year is wrong, it's not in the feed, so shows as 1970

right click to add/remove items from the queue

auto-episode expand is a setting before the queue is loaded

feedback welcome, getting closer

I've added the same files to sourceforge under the universalmc project
http://universalmc.svn.sourceforge.net/v...bmcflicks/
Reply
#40
On 1.03, with Expand TV Episodes Automatically, the script is completely failing when I go to My Instant Queue. Here's the log:

Code:
12:06:34 T:6088 M:1384828928   ERROR: Error Type: exceptions.TypeError
12:06:34 T:6088 M:1384820736   ERROR: Error Contents: getMovieDataFromFeed() takes exactly 9 arguments (8 given)
12:06:34 T:6088 M:1384783872   ERROR: Traceback (most recent call last):
                                              File "C:\Users\rglass\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\default.py", line 26, in ?
                                                import resources.lib.menu as menu
                                              File "C:\Users\rglass\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\resources\lib\menu.py", line 146, in ?
                                                getInstantQueue()
                                              File "C:\Users\rglass\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\resources\lib\iqueue.py", line 606, in getInstantQueue
                                                getUserInstantQueue(netflixClient,user)
                                              File "C:\Users\rglass\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\resources\lib\iqueue.py", line 421, in getUserInstantQueue
                                                curX = getMovieDataFromFeed(curX, curQueueItemTvE, pq, yesYear, yesSummary, realpath, True, netflix)
                                            TypeError: getMovieDataFromFeed() takes exactly 9 arguments (8 given)
12:06:34 T:7384 M:1385254912   ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.xbmcflicks/?mode=10
12:06:34 T:7384 M:1385254912   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.xbmcflicks/?mode=10) failed

If I turn that option off it build the queue fine. Is this meant to work such that it will list each episode out in the top level the queue? I think the ideal behavior here would be to mimic the TV Series library screens, where you get the TV Show listed in the main queue level (alongside any movies), and then when a series is selected open a new window with the list of episodes.
Reply
#41
fade23 Wrote:On 1.03, with Expand TV Episodes Automatically, the script is completely failing when I go to My Instant Queue. Here's the log:

Code:
12:06:34 T:6088 M:1384828928   ERROR: Error Type: exceptions.TypeError
12:06:34 T:6088 M:1384820736   ERROR: Error Contents: getMovieDataFromFeed() takes exactly 9 arguments (8 given)
12:06:34 T:6088 M:1384783872   ERROR: Traceback (most recent call last):
                                              File "C:\Users\rglass\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\default.py", line 26, in ?
                                                import resources.lib.menu as menu
                                              File "C:\Users\rglass\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\resources\lib\menu.py", line 146, in ?
                                                getInstantQueue()
                                              File "C:\Users\rglass\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\resources\lib\iqueue.py", line 606, in getInstantQueue
                                                getUserInstantQueue(netflixClient,user)
                                              File "C:\Users\rglass\AppData\Roaming\XBMC\addons\plugin.video.xbmcflicks\resources\lib\iqueue.py", line 421, in getUserInstantQueue
                                                curX = getMovieDataFromFeed(curX, curQueueItemTvE, pq, yesYear, yesSummary, realpath, True, netflix)
                                            TypeError: getMovieDataFromFeed() takes exactly 9 arguments (8 given)
12:06:34 T:7384 M:1385254912   ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.xbmcflicks/?mode=10
12:06:34 T:7384 M:1385254912   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.xbmcflicks/?mode=10) failed

If I turn that option off it build the queue fine. Is this meant to work such that it will list each episode out in the top level the queue? I think the ideal behavior here would be to mimic the TV Series library screens, where you get the TV Show listed in the main queue level (alongside any movies), and then when a series is selected open a new window with the list of episodes.

Good catch on that one, i'll get it fixed up as I need to clean up those calls anyway. On line 421 add a , False to the parameters.
i.e.
curX = getMovieDataFromFeed(curX, curQueueItemTvE, pq, yesYear, yesSummary, realpath, True, netflix, False)

The end idea is that when auto-expand is enabled, the tvshow item in the main menu becomes a folder, when clicked it opens up and shows the episodes for that. I haven't got the submenu's sorted yet for those.

The instant queue could also split up into movies and tv shows (i.e. when the queue is opened, it's like the library mode where it'll show movies as a folder and tvshows as a folder.) not sure on that yet.

I've got a few tricks i wanna do first with the instant queue and plot's (grabbing the rss feed of the users instant queue for the summary data as it'll be much much faster), then saving that out to a local file (either a full .nfo file, or just a .summary file, not sure yet) The .nfo would be cool as the directory could be loaded as a source into xbmc and appear in the library along side of the local media.
Reply
#42
Quote:Notes: if using OSX, pick it in the addon settings, that changes how it handles the initial browser open so that auth should work (please test)

I'm sorry I don't have time to dig into this a little further tonight but I did test this on OSX and it appears that the flag is not getting picked up. I've chosen OSX in the addon settings but as you can see from the log, it's reading it as false.
I added a line to print the value of OSX so you can see that in the log.
http://pastebin.com/Cxbai723
Reply
#43
I was calling the wrong setting (had OSX in one area and osx in another).. i've fixed that up

I've changed over to the v2.0 api calls now

version 1.0.4
http://rapidshare.com/files/436219141/pl...flicks.zip

Known issues: ratings will show the Netflix rating beside the name for tv shows and some movies, I'm still trying to find the list of what each of the numbers mean.. if you see a number in there beside the name instead of a rating, it means i don't know what the mpaa equiv is.. post them as you find them and i'll add them in there

Genre: Not yet parsed out

New Shows only contain real data for the name, poster and Plot, no other data is available in the feed
Reply
#44
The OSX fix works great. Safari launches to the authentication page as expected.
Thanks for the great work fekker.
Reply
#45
I was thinking of breaking down the Instant Queue abit

Instant Queue - Movies (shows only movies)
Instant Queue - TV Shows (shows only TV Shows)

With the TV Shows -
It could either be a list of TV Shows (when clicked they will pull the list of episodes for that show)
If it's a list of TV Shows - it basically just looks like a folder, then when opened up it'll show the episodes

OR

A Full List of the actual episodes All of those shows contain

-----

Or I can just leave it with it showing everything when you click on Instant Queue and keeping the User Option to auto-expand the episodes

thoughts?
Reply

Logout Mark Read Team Forum Stats Members Help
[WIP] XBMC Flicks (Netflix Addon) Development Thread - Developers Only!1