uNoGS Forum
    • Categories
    • Search
    • unogs
    • Register
    • Login
    1. Home
    2. Leuven
    ad
    L
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    Leuven

    @Leuven

    0
    Reputation
    762
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Leuven Unfollow Follow

    Latest posts made by Leuven

    • RE: Part 2: A simple script to pull information

      Manually stepping through the steps of the script and using print to reveal variable values and responses shows me much.

      response=requests.post(url,data=data,headers=headers)
      print response
      <Response [200]>

      So I'm getting an "OK" response.

      rjson=response.json()
      print rjson
      {u'paths': [[u'newarrivals', {u'to': 1, u'from': 0}, {u'to': 5, u'from': 0}, [u'title', u'availability']], [u'newarrivals', {u'to': 1, u'from': 0}, {u'to': 5, u'from': 0}, u'boxarts', u'_342x192', u'jpg']], u'jsonGraph': {u'newarrivals': {u'1': {u'$type': u'ref', u'value': [u'lists',...
      ...
      .., {u'boxarts': {u'_342x192': {u'jpg': {u'$type': u'atom'}}}, u'availability': {u'$type': u'atom'}, u'title': {u'$type': u'atom'}}, u'5': {u'boxarts': {u'_342x192': {u'jpg': {u'$type': u'atom'}}}, u'availability': {u'$type': u'atom'}, u'title': {u'$type': u'atom'}}, u'4': {u'boxarts': {u'_342x192': {u'jpg': {u'$type': u'atom'}}}, u'availability': {u'$type': u'atom'}, u'title': {u'$type': u'atom'}}}}}}

      And here's where it falls down.

      videos=rjson['value']['videos']
      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      KeyError: 'value'

      posted in Netflix API Details
      L
      Leuven
    • RE: Part 2: A simple script to pull information

      As the python response error is apparently with whatever the rjson is, how might I determine if it is being populated? Via inspect element in the browser I can see that videos contains the following attributes..summary, title, titleMaturity, userRating, boxarts, UserRatingRequestId.

      I know that the browser response is separate from that of the python script response.

      How to troubleshoot?

      posted in Netflix API Details
      L
      Leuven
    • RE: Part 2: A simple script to pull information

      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.

      posted in Netflix API Details
      L
      Leuven