Kodi Community Forum
[RELEASE] XBMC Flicks - Netflix Movies / TV Shows (Video) experimental Addon for XBMC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
+---- Thread: [RELEASE] XBMC Flicks - Netflix Movies / TV Shows (Video) experimental Addon for XBMC (/showthread.php?tid=87552)



Sort order - sauranon - 2011-05-06

I'm trying to get xbmc flicks to sort the titles in the same order as they are in my instant queue but can't seem to find an option. From the context of some of the other posts it seems like this (used to?) happens automatically.

Any idea if this is still possible and if so what I can do to fix it.

Basically I like to have stuff for my kids at one end of the queue and stuff for me at the other so that we can both get to our respective shows quickly.

Thanks


- EvilAlchemist - 2011-05-07

Has anyone else noticed that "F" (Full Screen Keyboard Shortcut) no longer works?

I had my remote set to send that key when playback starts but now I have to use the mouse to manually hit the full screen button.

I tested this in chrome and IE so it must be something with silverlight.

Anyone have an idea on how to correct this?


- jesushumper - 2011-05-07

Trying to get XBMC Netflix plugin to work.

I've been able to do everything in the FAQ. I've also tried uninstalling/reinstalling the plug in, and also deleting the userinfo.txt. My Browsers (both Opera and Ei) both tell me that my Netflixs account was linked successfully. I've also deleted the old, and created new playercorefactory.xml and advancedsettings.xml files.

XBMC itself, work great, as do the other plugins i use. When XBMC tried to load a list from Netflix, i get this error:

Code:
script failed!: plugin.video.xbmcflicks

I've been going through all the FAQ and info i can find on getting this work, with no success. I have also tried with iewrap.exe, and edited my playercorefactory.xml to match the new path.

I live in Canada, and have set "Are you in Canada" to Yes.


Windows 7 Ultimate 64-bit
XBMC 10.1, Compiled March 8/2011


It seems that just getting the Key and Secret info to show is my only issue...

any hep or suggestion are greatly appreciated.


- fekker - 2011-05-07

sauranon Wrote:I'm trying to get xbmc flicks to sort the titles in the same order as they are in my instant queue but can't seem to find an option. From the context of some of the other posts it seems like this (used to?) happens automatically.

Any idea if this is still possible and if so what I can do to fix it.

Basically I like to have stuff for my kids at one end of the queue and stuff for me at the other so that we can both get to our respective shows quickly.

Thanks

you can strip out the sort options on the call in the script file, this will return them in the instant queue order
in iqueue.py, find the def getInstantQueue(displayWhat=None): section
put a ## in front of each of the xbmcplugin.addSortMethod items
modified code shown below
Code:
def getInstantQueue(displayWhat=None):
    initApp()
    getUserInstantQueue(netflixClient,user, displayWhat)
    if(not user):
        exit
    time.sleep(1)
##    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_LABEL )
##    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_DATE )
##    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_VIDEO_RUNTIME )
##    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_VIDEO_YEAR )
##    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_GENRE )
##    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_MPAA_RATING )
    xbmcplugin.setContent(int(sys.argv[1]),'Movies')
    xbmcplugin.endOfDirectory(int(sys.argv[1]))

Quote:jesushumper Trying to get XBMC Netflix plugin to work.
check computer time
if osx or xp, might be easier to do it manually (see the FAQ in post 3 for details on how to put in debug mode (the addon) with verbose user logging, then run it, it'll put the values into the xbmc.log file, copy those to the iqueue.py file and start it up again.

Quote:EvilAlchemist Has anyone else noticed that "F" (Full Screen Keyboard Shortcut) no longer works?

I had my remote set to send that key when playback starts but now I have to use the mouse to manually hit the full screen button.

I tested this in chrome and IE so it must be something with silverlight.

Anyone have an idea on how to correct this?
mine still works, very odd, maybe they are mucking with it


- fekker - 2011-05-07

eQUIV Wrote:Yes, F10 does close the wrapper. So does that mean it's the embedded window?

I also noticed that if I come back to XBMC after a few hours of being away -- when I select a video the wrapper will load directly to Netflix homepage instead of the selected video. When I then close the wrapper, and re-select the video it loads fine and all following selections load fine. Has anyone else using the wrapper experienced this? Not a huge deal, but a little strange. Almost as if it times out and needs to be re-verified .

ok, i'll see if i can send a focus call to the embeded window for that one ... gonna be abit as I'm working on fixing UMM's tmdb scraper and a database lock issue Big Grin


- eQUIV - 2011-05-07

fekker Wrote:ok, i'll see if i can send a focus call to the embeded window for that one ... gonna be abit as I'm working on fixing UMM's tmdb scraper and a database lock issue Big Grin

No worries my friend, it's a minor issue. You get to it when you can. I just appreciate your work.


- Axodious - 2011-05-07

First to respond to the above posts I've noticed the 'F' key works to make the screen fullscreen however, it does not work in reverse; you have to push 'Esc' to get out of fullscreen.

Second I'm from Canada and I'm having the same issue that several other people have posted from Canada where certain menus aren't working or are returning US results.

The following return zero results:
Top 25 New Arrivals
All New Arrivals: TV
All Genres
Experimental Search

Also regular Search returns US results.

I have a debug log accessing all the menus (except every Genre as there is a lot) however I would prefer to PM it to someone if that's OK. I tested this on a new install after noticing that my HTPC (running XBMCFlicks for a while) was still returning US results for everything (figured I needed to clear a file somewhere but before I went digging I wanted to confirm).

P.S.
Also if you need a guinea pig to test stuff on I'm fine with that.


Error - casinatorcxc - 2011-05-07

I have no idea what the problem is on this one. I did nothing more than install the add-on from within XBMC and when I went to use it I got an error after the first few menus. Anyone that could help me out it would be much appreciated. Thanks


Log Here


- fekker - 2011-05-08

casinatorcxc Wrote:I have no idea what the problem is on this one. I did nothing more than install the add-on from within XBMC and when I went to use it I got an error after the first few menus. Anyone that could help me out it would be much appreciated. Thanks


Log Here

01:27:43 T:300 M:2981326848 NOTICE: Token result was: Timestamp Is Invalid
01:27:43 T:300 M:2981326848 NOTICE: If the timestamp shows invalid, your computers date/time is off, sync it to an NTP server or fix it by setting the correct values

Quote:Second I'm from Canada and I'm having the same issue that several other people have posted from Canada where certain menus aren't working or are returning US results.

The following return zero results:
Top 25 New Arrivals
All New Arrivals: TV
All Genres
Experimental Search

Also regular Search returns US results.
I'll need to know which menu item those are as each run's a different command.
Not sure what the pm limit is, but if you can use pastebin to paste the log file. (make sure you don't have verbose user information enabled when you post the logs, or that you scrub out your id and secret keys)
The biggest issue with netflix.ca is they don't provide any details on the api calls, it's a guess and see what it does for us little folks (i'm sure that the big companys get the list and commands). At some point we will get the details, well I sure hope they will give us those.


- arcooke - 2011-05-08

Is there any hope of getting the XBMC Android remote working with this? I'm almost to the point of considering buying a Roku box to get Netflix on my TV.

I actually started writing my own program in .NET (a replacement to iewrap) able to send keystrokes to the Netflix silverlight player, but for some reason I cannot for the life of me get silverlight to react to keys sent to it. I was hoping to eventually be able to get it working together with the Android remote, along with proper full screen.. but it doesn't look like that's going to happen.


- casinatorcxc - 2011-05-08

fekker Wrote:01:27:43 T:300 M:2981326848 NOTICE: Token result was: Timestamp Is Invalid
01:27:43 T:300 M:2981326848 NOTICE: If the timestamp shows invalid, your computers date/time is off, sync it to an NTP server or fix it by setting the correct values


Thank you so much. I was messing with this for a long time. I thought I saw something about that in the log but I didn't see what was wrong because my time was correct...but I just built this computer yesterday and it shipped from another time zone.

Thanks again!


- fekker - 2011-05-08

arcooke Wrote:Is there any hope of getting the XBMC Android remote working with this? I'm almost to the point of considering buying a Roku box to get Netflix on my TV.

I actually started writing my own program in .NET (a replacement to iewrap) able to send keystrokes to the Netflix silverlight player, but for some reason I cannot for the life of me get silverlight to react to keys sent to it. I was hoping to eventually be able to get it working together with the Android remote, along with proper full screen.. but it doesn't look like that's going to happen.

might try event ghost, that or do a low level key hook
something like:
http://zeeohemgee.blogspot.com/2006/04/creating-global-keyboard-hook-in-c.html
and
http://stackoverflow.com/questions/1639331/using-global-keyboard-hook-wh-keyboard-ll-in-wpf-c

iewrap is listening in on the keys, but you can use the same method to send them as well
it might be a focus issue as well, if so, you can try setting the focus to the window and activating the embedded browser window

there's a netflix player wrapper for sage tv that hooks into the player as well, but it's "unique" in the how

by all means, see if you can make it work, it would help alot of folks out. Keeping in mind that silverlight 5 takes media center commands, so you might want to try that one as well with/without event ghost or a similar utility

here's what iewrap uses
Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace Utilities {
    class globalKeyboardHook {
        #region Constant, Structure and Delegate Definitions
        public delegate int keyboardHookProc(int code, int wParam, ref keyboardHookStruct lParam);

        public struct keyboardHookStruct {
            public int vkCode;
            public int scanCode;
            public int flags;
            public int time;
            public int dwExtraInfo;
        }

        const int WH_KEYBOARD_LL = 13;
        const int WM_KEYDOWN = 0x100;
        const int WM_KEYUP = 0x101;
        const int WM_SYSKEYDOWN = 0x104;
        const int WM_SYSKEYUP = 0x105;
        #endregion

        #region Instance Variables
        /// <summary>
        /// The collections of keys to watch for
        /// </summary>
        public List<Keys> HookedKeys = new List<Keys>();
        /// <summary>
        /// Handle to the hook, need this to unhook and call the next hook
        /// </summary>
        IntPtr hhook = IntPtr.Zero;
        #endregion

        #region Events
        /// <summary>
        /// Occurs when one of the hooked keys is pressed
        /// </summary>
        public event KeyEventHandler KeyDown;
        /// <summary>
        /// Occurs when one of the hooked keys is released
        /// </summary>
        public event KeyEventHandler KeyUp;
        #endregion

        #region Constructors and Destructors
        /// <summary>
        /// Initializes a new instance of the <see cref="globalKeyboardHook"/> class and installs the keyboard hook.
        /// </summary>
        public globalKeyboardHook() {
            hook();
        }

        /// <summary>
        /// Releases unmanaged resources and performs other cleanup operations before the
        /// <see cref="globalKeyboardHook"/> is reclaimed by garbage collection and uninstalls the keyboard hook.
        /// </summary>
        ~globalKeyboardHook() {
            unhook();
        }
        #endregion

        #region Public Methods
        /// <summary>
        /// Installs the global hook
        /// </summary>
        public void hook() {
            IntPtr hInstance = LoadLibrary("User32");
            hhook = SetWindowsHookEx(WH_KEYBOARD_LL, hookProc, hInstance, 0);
        }

        /// <summary>
        /// Uninstalls the global hook
        /// </summary>
        public void unhook() {
            UnhookWindowsHookEx(hhook);
        }

        /// <summary>
        /// The callback for the keyboard hook
        /// </summary>
        /// <param name="code">The hook code, if it isn't >= 0, the function shouldn't do anyting</param>
        /// <param name="wParam">The event type</param>
        /// <param name="lParam">The keyhook event information</param>
        /// <returns></returns>
        public int hookProc(int code, int wParam, ref keyboardHookStruct lParam) {
            if (code >= 0) {
                Keys key = (Keys)lParam.vkCode;
                if (HookedKeys.Contains(key)) {
                    KeyEventArgs kea = new KeyEventArgs(key);
                    if ((wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN) && (KeyDown != null)) {
                        KeyDown(this, kea) ;
                    } else if ((wParam == WM_KEYUP || wParam == WM_SYSKEYUP) && (KeyUp != null)) {
                        KeyUp(this, kea);
                    }
                    if (kea.Handled)
                        return 1;
                }
            }
            return CallNextHookEx(hhook, code, wParam, ref lParam);
        }
        #endregion

        #region DLL imports
        /// <summary>
        /// Sets the windows hook, do the desired event, one of hInstance or threadId must be non-null
        /// </summary>
        /// <param name="idHook">The id of the event you want to hook</param>
        /// <param name="callback">The callback.</param>
        /// <param name="hInstance">The handle you want to attach the event to, can be null</param>
        /// <param name="threadId">The thread you want to attach the event to, can be null</param>
        /// <returns>a handle to the desired hook</returns>
        [DllImport("user32.dll")]
        static extern IntPtr SetWindowsHookEx(int idHook, keyboardHookProc callback, IntPtr hInstance, uint threadId);

        /// <summary>
        /// Unhooks the windows hook.
        /// </summary>
        /// <param name="hInstance">The hook handle that was returned from SetWindowsHookEx</param>
        /// <returns>True if successful, false otherwise</returns>
        [DllImport("user32.dll")]
        static extern bool UnhookWindowsHookEx(IntPtr hInstance);

        /// <summary>
        /// Calls the next hook.
        /// </summary>
        /// <param name="idHook">The hook id</param>
        /// <param name="nCode">The hook code</param>
        /// <param name="wParam">The wparam.</param>
        /// <param name="lParam">The lparam.</param>
        /// <returns></returns>
        [DllImport("user32.dll")]
        static extern int CallNextHookEx(IntPtr idHook, int nCode, int wParam, ref keyboardHookStruct lParam);

        /// <summary>
        /// Loads the library.
        /// </summary>
        /// <param name="lpFileName">Name of the library</param>
        /// <returns>A handle to the library</returns>
        [DllImport("kernel32.dll")]
        static extern IntPtr LoadLibrary(string lpFileName);
        #endregion
    }
}

and then in the form the code is
Code:
public partial class frmMain : Form
    {
        string[] ARGS;
        globalKeyboardHook gkh = new globalKeyboardHook();
        public frmMain(string[] args)
        {
            InitializeComponent();
            ARGS = args;
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            gkh.HookedKeys.Add(Keys.F10);
            //gkh.HookedKeys.Add(Keys.B);
            gkh.KeyDown += new KeyEventHandler(gkh_KeyDown);
            //gkh.KeyUp += new KeyEventHandler(gkh_KeyUp);

            string url = "";
            foreach (string arg in ARGS)
            {
                
                if (arg.Contains("showscroll"))
                {
                    webBrowser1.ScrollBarsEnabled = true;
                }
                if (arg.Contains("nobutton"))
                {
                    btnExit.Visible = false;
                }
                if (arg.Contains("notop"))
                {
                    this.TopMost = false;
                }
                if (arg.Contains("focus"))
                {
                    timer1.Enabled = true;
                }

                if (arg.Contains(".html"))
                {
                    url = arg;
                }
            }
            if (!string.IsNullOrEmpty(url))
            {
                webBrowser1.Navigate(url);
            }


            //// force window to have focus - untested
            //uint foreThread = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero);
            //uint appThread = GetCurrentThreadId();
            //const int SW_SHOW = 5;
            //if (foreThread != appThread)
            //{
            //    AttachThreadInput(foreThread, appThread, true);
            //    BringWindowToTop(form.Handle);
            //    ShowWindow(form.Handle, SW_SHOW);
            //    AttachThreadInput(foreThread, appThread, false);
            //}
            //else
            //{
            //    BringWindowToTop(form.Handle);
            //    ShowWindow(form.Handle, SW_SHOW);
            //}
            //form.Activate();

        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            webBrowser1.Dispose();
            this.Close();
        }

        void gkh_KeyDown(object sender, KeyEventArgs e)
        {
            webBrowser1.Dispose();
            this.Close();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            // Get the window to the front.
            this.TopMost = true;
            this.TopMost = false;

            // 'Steal' the focus.
            this.Activate();
            timer1.Enabled = false;
        }
    }
}



- arcooke - 2011-05-08

thanks a lot fekker

might dig into this some more tomorrow


- Axodious - 2011-05-08

fekker Wrote:I'll need to know which menu item those are as each run's a different command.

Can you see this from the log I PM'd you or do you need me to check something?


XBMC Flicks v1.0.19 not working for Browse by Genre - Dirtbag - 2011-05-09

Hi everyone, I've had the XBMC Flicks plugin working on my main desktop PC no probs for a while now until just recently the Browse by Genre shows "Found 496 Items pages 1-34" but when ever I select a genre from the list (ANY Genre) 0 items are found and nothing is displayed. I can browse and watch from my personal Que no probs. I've since been working on setting up my new custom built HTPC. I'm running the newest Dharma v10.1 with the newest version of the XBMC Flicks (Netflix plugin) on both my original PC and my new HTPC and have the same problem on both new and older machines. My personal netflix account is USA and I have the plugin setup accordingly. Like I say, Browse by Genre worked ok on my older PC just fine but now it doesn't and I'm experiencing the duplicate problem on a brand new fresh HTPC. Is there an unknown issue with the newer versions of Dharma and XBMC Flicks? I sure would like to get this resolved so I can continue with the enjoyment of my new HTPC Toys.

Thanks & any help is appreciated.
Huh