Netflix plugin (NetflixAlpha) (2 Viewers)

te3hpurp

Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    Im doing it like this:

    Code:
     private void webBrowser1_DocumentCompleted(System.Object sender, WebBrowserDocumentCompletedEventArgs e)
            {
                if (this.webBrowser1.ReadyState != WebBrowserReadyState.Complete){
                    return;}else{
                System.Diagnostics.Debug.Print("COMPLETED !!");
                if (e.Url.Equals(webBrowser1.Url))
                {
                    HtmlDocument document = webBrowser1.Document;
                  
            
    
                    foreach (HtmlElement ele in document.All)
                    {
                       // elementofpage.Add(ele);
                        if (ele.InnerHtml != null)
                        {
                            if (ele.GetAttribute("className").ToString().Contains("ng-binding"))
                            {
                                profiles.Add(ele);
                            }
                        }
                    }
                    if(profiles.Count>0){
                    profiles[0].InvokeMember("click");
                    }
    }
    }
    ...............................................

    Of course in inside if(profiles.Count>0) there can be a checking of a username which is stored for example
    in plugin settingas. I just click first one.


    Br,
     

    MightyPolo

    Portal Pro
    October 24, 2007
    181
    80
    Home Country
    Czech Republic Czech Republic
    Hi its not problem to parse profiles out.
    The problem is, when I click on element, because then instead of start playing I get error "Something was wrong" :).

    And Iam unable to replicate this problem in normal browser, so it happens only in WebBrowser component.
    There are maybe some settings Iam missing, IE is complex beast.

    Did you have such a problem?
     

    ddoody

    New Member
    September 3, 2006
    4
    1
    Adelaide
    Home Country
    Australia Australia
    Hey,

    That looks deceptively simple.... and yet!

    I always get that "something was wrong" error after clicking the profile selection with the mouse. Clicking "retry" usually then plays the stream I selected with no further input.

    Hopefully I'll get some time this weekend to have a play and a proper look at everything.

    I presume there is a non-public API that manufacturers of various hardware devices get to use. It is obviously updated and supports all of this functionality. Too bad we can't get access to this, as there are probably licensing costs.

    Also, just a thought that occurred to me while trying to figure out this issue, when mucking about with MP I often set it to window mode rather than full screen, just to make it simpler to do other things while it is running. Nfplayer always seems to run full screen. As a future feature, you might want to use a window mode that is either configurable, or that follows the MP window mode. It's not an issue for me, as 99% of the time I run MP full-screen on a dedicated PC, but it might be useful for others.

    PS. I am located in Adelaide, Australia, (+930 or +1030 currently due to daylight savings) and I see from your profile that you are in Prague, so the time difference will probably account for apparent silences on my part.[DOUBLEPOST=1392977475][/DOUBLEPOST]Also, I like the idea of the configured profile selection.
     

    MightyPolo

    Portal Pro
    October 24, 2007
    181
    80
    Home Country
    Czech Republic Czech Republic
    Hey,

    That looks deceptively simple.... and yet!

    I always get that "something was wrong" error after clicking the profile selection with the mouse. Clicking "retry" usually then plays the stream I selected with no further input.

    Hopefully I'll get some time this weekend to have a play and a proper look at everything.

    I presume there is a non-public API that manufacturers of various hardware devices get to use. It is obviously updated and supports all of this functionality. Too bad we can't get access to this, as there are probably licensing costs.

    Also, just a thought that occurred to me while trying to figure out this issue, when mucking about with MP I often set it to window mode rather than full screen, just to make it simpler to do other things while it is running. Nfplayer always seems to run full screen. As a future feature, you might want to use a window mode that is either configurable, or that follows the MP window mode. It's not an issue for me, as 99% of the time I run MP full-screen on a dedicated PC, but it might be useful for others.

    PS. I am located in Adelaide, Australia, (+930 or +1030 currently due to daylight savings) and I see from your profile that you are in Prague, so the time difference will probably account for apparent silences on my part.[DOUBLEPOST=1392977475][/DOUBLEPOST]Also, I like the idea of the configured profile selection.
    Hi.
    You can run NFplayer in windowed mode using special parameter -nofullscreen.
    Passing parametr to NFplayer from plugin is not implemented.

    This is the problem I encountered, and Iam unable to find this button using DOM, probably because its manipulated by sime javascript api.
    That was the point I stoped, because it was death end for me.

    I did try to use Chrome in CEF sharp implementation, but in CEF# there is no way to manipulate directly with htmlElements like in IE WebBrowser.
    I used EvaluateScript but it didnt beheave correctly. That applies to CEF#1.

    I woulf be very happy if someone can crack this problem.

    Cheers!
     

    te3hpurp

    Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    Hi its not problem to parse profiles out.
    The problem is, when I click on element, because then instead of start playing I get error "Something was wrong" :).

    And Iam unable to replicate this problem in normal browser, so it happens only in WebBrowser component.
    There are maybe some settings Iam missing, IE is complex beast.

    Did you have such a problem?
    Yes. But i solved it by parsing errors html element similarry and clicking it to retry.
     

    te3hpurp

    Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    Yes. But i solved it by parsing errors html element similarry and clicking it to retry.
    Sounds good!
    Can you PM the code, I will include it in to NFplayer.

    Thank you!
    Sure. In Sunday. Have no access to dev laptop at the moment.

    Br,
    Oh and If you current codebase is too tightly integrated to Netflix api and development secret keys etc so that you cannot release your work. Could you consider separating that part to dll and release rest of the code to community, because in the end we are OpenSource community and point is to help / extend / share each others work.

    Br,
     

    MightyPolo

    Portal Pro
    October 24, 2007
    181
    80
    Home Country
    Czech Republic Czech Republic
    one bit that seems not working correctly is when the item is a series. For example, if I select Lilyhammer, I should see two seasons yet I only see one. Same for House of Cards (although the 2nd season was only released Friday 14-Feb). B

    Hi.
    Interesting, I just looked in to NetflixAlpha webservice database, which is updated weekly from offline Netflix catalogue to find out, that all titles we mentioned are there.
    I do not know, why its not shown in direct request to public api ...

    It might be possible to use this database in plugin.
    It would take some work...

    Cheers.
     

    te3hpurp

    Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    Okay here it goes.
    It is plain Document completed event receiver. At the beginning there is
    chek if document really is complete. It is quite important to check, cos
    event appears many times before document is ready.
    When it is. We go on. First we select profile,
    and when we get new document complete event there is (if try again button appears) html element
    which class name contains "errorBtn". Actually it contains also "tryBtn in same class name
    but it is not a problem.

    So if we find try again button we just invoke it.


    Code:
    private void webBrowser1_DocumentCompleted(System.Object sender, WebBrowserDocumentCompletedEventArgs e)
            {
                if (this.webBrowser1.ReadyState != WebBrowserReadyState.Complete){
                    return;}else{
                System.Diagnostics.Debug.Print("COMLETED !!");
                if (e.Url.Equals(webBrowser1.Url))
                {
                    HtmlDocument document = webBrowser1.Document;
    
                    //parse profiles
                    foreach (HtmlElement ele in document.All)
                    {
                       // elementofpage.Add(ele);
                        if (ele.InnerHtml != null)
                        {
                            if (ele.GetAttribute("className").ToString().Contains("ng-binding"))
                            {
                                profiles.Add(ele);
                            }
                        }
                    }
    
                    // Select profile
                    if(profiles.Count>0){
                    //Here can check which profile to select
                    profiles[0].InvokeMember("click");
                    }
    
                    profiles.Clear();
    
                    // Bypass 'Something went wrong, try again ' try button
                    foreach (HtmlElement ele in document.All)
                    {
                      
                        if (ele.InnerHtml != null)
                        {
                            if (ele.GetAttribute("className").ToString().Contains("errorBtn"))
                            {
                               // profiles.Add(ele);
                                ele.InvokeMember("click");
                            }
                        }
                    }
                }
               }
            }
     

    Users who are viewing this thread

    Top Bottom