uNoGS Forum
    • Categories
    • Search
    • unogs
    • Register
    • Login
    ad

    Part 2: A simple script to pull information

    Netflix API Details
    netflix api
    8
    44
    95.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      Guest
      last edited by

      How do you get the information about WHEN titles will become available or expire?

      adminA 1 Reply Last reply Reply Quote 0
      • adminA
        admin @Guest
        last edited by

        availabilityEndDateNear

        ["subtitles","audio","availability","availabilityEndDateNear"]
        

        Now easy way to get when new titles are available that I know of...

        S 1 Reply Last reply Reply Quote 0
        • S
          spiffylogic @admin
          last edited by

          @admin When I use "availabilityEndDateNear" (for a title that I know is expiring soon) I get back something I don't understand:

          u'availabilityEndDateNear': {u'$size': 16, u'$type': u'sentinel', u'size': 16}
          

          What does this mean?

          adminA 1 Reply Last reply Reply Quote 0
          • adminA
            admin @spiffylogic
            last edited by

            @spiffylogic what title in what country?

            S 1 Reply Last reply Reply Quote 0
            • S
              spiffylogic @admin
              last edited by

              @admin That was "You Laugh But It's True" in Canada

              adminA 1 Reply Last reply Reply Quote 0
              • adminA
                admin @spiffylogic
                last edited by

                @spiffylogic It works fine for me, can you post the PATH JSON you are using?

                S 1 Reply Last reply Reply Quote 0
                • S
                  spiffylogic @admin
                  last edited by

                  @admin Sorry it is actually working but I got lost in the sea of output. The data for that title indeed shows

                  u'availabilityEndDateNear': u'2017-10-05'
                  

                  but for all other titles it has that sentinel blob (which is still curious to me...).

                  Thanks for your help and for this great forum!

                  adminA 1 Reply Last reply Reply Quote 0
                  • adminA
                    admin @spiffylogic
                    last edited by

                    @spiffylogic Glad to hear it... https://jsonformatter.curiousconcept.com/ is your friend

                    1 Reply Last reply Reply Quote 0
                    • ?
                      Guest @FrankieD
                      last edited by

                      @frankied said in Part 2: A simple script to pull information:

                      Requesting

                      When I try your code I get this response:
                      '''
                      {u'paths': [[u'shows'], [u'80113701'], [u'browse']],
                      u'value': {u'$size': 48,
                      u'80113701': {u'$size': 16, u'$type': u'sentinel', u'size': 16},
                      u'browse': {u'$size': 16, u'$type': u'sentinel', u'size': 16},
                      u'shows': {u'$size': 16, u'$type': u'sentinel', u'size': 16},
                      u'size': 48}}
                      '''

                      1 Reply Last reply Reply Quote 0
                      • ?
                        Guest
                        last edited by

                        Do you guys know how I can get the titles actors, directors and creators?
                        Thanks in advance! :)

                        1 Reply Last reply Reply Quote 0
                        • ?
                          Guest
                          last edited by

                          I'm trying to accomplish the same thing as this code sample in c#, I was able to get a working response in python but the rest of my project is in c#.

                          However when I use a HTTPWebRequest to get the response stream, the response looks like this:
                          "\u001f�\b\0\0\0\0\0\0\0ܖKo�F\fǿ�B�q�%�=�\u0015i\u000e)�&��T\u0004\u0006g�\u0013+Qv\u0017+���\u07fd#m��_M\u0011 \a�F��P\u007f�(��T�Ԟqu����k>\u0017C(i���^���\u0018�_m�ê�u߬����9hn3�ܔ\u0004��ݮ)'w���mL1�:��j����!�u&�\u0002\u001b��L�BP^��\u0018}d��LL9�(]&O�u\u0014Z9\u0017\u0010<\n\u001b2xͬ]\0��\u0010g2�Z��\u0010E��������2uܽ.e���\u001d�@���\u0012XKgIHr |

                          (Shortened so not to overwhelm)

                          I'm at a loss as to why the response I'm getting in c# is a unicode mess but the python code gets a nice clean response.

                          Any ideas?

                                  string genres = "0,\"to\":1";
                                  string rmax = "5";
                                  string sbase = "[[\"newarrivals\",{\"from\":" + genres + "},{\"from\":0,\"to\":" + rmax + "},[\"title\",\"availability\"]],[\"newarrivals\",{\"from\":" + genres + "},{\"from\":0,\"to\":" + rmax + "},\"boxarts\",\"_342x192\",\"jpg\"]]";
                                  string data = "{\"paths\":" + sbase + ",\"authURL\":\"1516657903506.SW2aceZfllyxCd5V5TPHJdJiMxQ=\"}";
                          
                                  byte[] byteArray = Encoding.UTF8.GetBytes(data);
                                  request.ContentLength = byteArray.Length;
                                  Stream dataStream = request.GetRequestStream();
                                  dataStream.Write(byteArray, 0, byteArray.Length);
                                  WebResponse response = request.GetResponse();
                                  dataStream = response.GetResponseStream();
                                  StreamReader reader = new StreamReader(dataStream);
                                  string responseFromServer = reader.ReadToEnd();
                          
                          adminA 1 Reply Last reply Reply Quote 0
                          • adminA
                            admin @Guest
                            last edited by

                            unfortunately I have never played with C# so I can't be much help there...

                            ? 1 Reply Last reply Reply Quote 0
                            • ?
                              Guest @admin
                              last edited by

                              @admin I've been trying to do a search call to pathevaluator, even copied exactly what is being sent on netflix's search page, but there must be some kind of sorting going on? For example when I search "shark" I'm getting little rascals at the top. Little rascals is also on the netflix page but down on around row 10.

                              Any idea if theres some relevancy value I need? Thanks in advance.

                              1 Reply Last reply Reply Quote 0
                              • V
                                victorhupo
                                last edited by

                                @admin I would like to download the boxart of this title "80101802" but in my language that is brazilian portuguese, I do not understand mto code but I tried it and I did not get it through your tutorial, it would have you help me or else add the function of being able to choose the parents that your site would take the image?

                                adminA 1 Reply Last reply Reply Quote 0
                                • adminA
                                  admin @victorhupo
                                  last edited by

                                  @victorhupo what title is that? it doesn't look like it exists..

                                  1 Reply Last reply Reply Quote 0
                                  • V
                                    victorhupo
                                    last edited by

                                    @admin Sorry, this is it. http://unogs.com/video/?v=80072207

                                    adminA 1 Reply Last reply Reply Quote 0
                                    • adminA
                                      admin @victorhupo
                                      last edited by

                                      @victorhupo If its just for this one title click on 'show all images' , then right click on whatever image you want and save it

                                      1 Reply Last reply Reply Quote 0
                                      • V
                                        victorhupo
                                        last edited by

                                        @admin but in the site only it shows images in EnglishI would like the images in Brazilian Portuguese.

                                        adminA 1 Reply Last reply Reply Quote 0
                                        • adminA
                                          admin @victorhupo
                                          last edited by admin

                                          @victorhupo In that case you would need to use this tutorial and just change your language to whatever you want...

                                          'Accept-Language':'en-GB,en;q=0.5',
                                          

                                          needs to change to:

                                          'Accept-Language':'pt',
                                          

                                          or something equivalent.. have a look at your request headers like mentioned in the example above

                                          1 Reply Last reply Reply Quote 0
                                          • L
                                            Leuven
                                            last edited by

                                            Am interested in understanding the geographical differences in Netflix offerings and particularly attempting to determine the hierarchies used to implement various aspects of subscriber based on location. Accordingly beginning to understand what the API can offer seems useful.

                                            After using pip to install requests (which I also attempted for json as it's there in the script import statements), I created & did the updates to the script itself.

                                            I copied the python script into a (.py) file, updated the cookie sections (containing components for memclid, nfvdid, SecureNetflixId, NetflixId, cL, clSharedContext, didUserInteractWithPage, dsca...).

                                            Initially it seemed to give some sort of json error, but after updating the User-Agent details now gives me the following.

                                            13:46:Drei $python netflix1.py
                                            Traceback (most recent call last):
                                            File "netflix1.py", line 29, in <module>
                                            videos=rjson['value']['videos']
                                            KeyError: 'value'
                                            13:46:Drei $head -29 netflix1.py | tail -1
                                            videos=rjson['value']['videos']

                                            Ideas?
                                            I also updated the User Agent value and pathevaluator value (URL) from a POST request.

                                            L 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post