Why no watched data in XML?

What’s the reason that the XML does not contain a single information about:

  1. Is this content already watched or not?
  2. How many times has it been watched?
  3. When has it been watched?

I’m talking about the XML file one can see if clicking this Link. The XML has soooo many information, even about similar content, but not a single word about it’s watch state.

Thanks a lot.

viewCount="1" means it was played at least once. (by the user who is requesting the XML with his/her token)

This is really, really, really interesting. I was playing around with Web APIs and there’s something not working as expected.

Take that URL that you get if you hit the “Show XML” link.

And now comes the funny part: The result is different if you call that URL in a browser. or in a Python script. The result from the Python script is missing the viewCount - and only the viewCount - the rest is identical:

#python3 -m pip install requests
import requests

r = requests.get("take URL from above")
print(r.text)

I don’t get that.

Inspect the address bar of the web browser. I guess the Python script is omitting some of those “include” parameters when calling the API.

The viewCount property is absent if the item is not watched.

1 Like

No, no, I swear. I’m using the exact same parameters. Absolutely identical. You can test it in just a minute:

  1. Open a movie from that you know it’s been watched from within app.plex.tv.
  2. Edit that movie and navigate to the “Show XML file” link.
  3. Click on that link.
    → Browser window shows XML content - check that “viewCount” is in there.
  4. Copy that link from the browser window.
  5. Put that link into the three line Python script (check that the Python requests package is installed).
  6. Run that script - and voila viewCount is missing.

It’s magic. You must see it yourself. You won’t believe it.

I tried with the internal IP. I tried with the external IP (plex.tv/plex.direct). I tried with URL. I tried with URL headers. No luck.

Just check it.

It’s just you.

Try getting a new token.

Got it thanks.

So the inclusion of viewCount and lastViewedAt is bound to a valid authentication. The rest is not bound to a specific user. Didn’t know that.

As these scripts are for my own fun only, I changed to basic authentication. My NFO-creator is working perfect now.

Thanks again.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.