-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push progress/watched status to Netflix #80
Comments
Looks like a feature request : https://github.com/CastagnaIT/plugin.video.netflix/projects/2#card-19070428 There's a MSL endpoint named "pbo_events", with a "events/stop" parameter called after a video is stopped. Could it be the answer ? |
days ago i tried to track the logs of the endpoint you specified we should try to understand more deeply in some way |
According to asciidisco, it's managed by the 'log' endpoint, he added a payload example. I don't have the proper tools to decode the payloads myself, so I can't tell what's pushed on the 'event' endpoint, but I tend to trust both of you :) |
interesting discussion in the link, summarising When video starts: During viewing (often transmitted at every minute or more) At the end of the video: to decode it you have to follow the logic on default_crypto like asciidisco said this is a complex thing.. |
I think the most crucial thing is the watched status as that is what Netflix relies on for recommendations etc. without it knowing what you have watched, your recommendations are only based on what you add to your list. |
I think that changed, ichnaea isn't called when i watch movies and progress is still saved. |
may be i have no longer followed the situations, |
Would looking at how plex handles this API endpoint aide in resolving this issue? The only reason I ask is that they have a native kodi plugin. |
which plex? attach link/documentation |
https://forums.plex.tv/t/pms-web-api-documentation/62152 Plex, like Netflix but you host your own media. They offer the same functionality of watched and position markers. I realize they are different but how they work could point towards a better direction. |
I don't see any help on this page |
Hi, I might be able to help. I was playing with the MSL protocol too and I have a mitmproxy plugin which can intercept MSL handshake and decrypt subsequent communication. The code is really ugly, so I haven't made it public yet, but it works. All of this is limited to the JWK_RSA (Chrome, Firefox, ...) or JWEJS_RSA (IE) schemes where random keys are generated for each handshake. WIDEVINE scheme (Android app) uses a device-specific RSA key which is usually protected by L1 DRM. That would be more difficult to deal with (and also questionable from a legal standpoint) but also not necessary for this task, I'd say. |
Once you have this implemented, you will notice that there's no easy way to update resumepoints in Kodi. See: add-ons/plugin.video.vrt.nu#568 But don't let that stop you, because this functionality is very much wanted, and hopefully we can get that functionality fixed in Kodi as well :-) |
this is good news, even if you can only communicate to netflix which movie has been viewed completely is already very good! take the time you need to clean up the code |
very nice to hear @nohajc . I assume once we found the necessary request it can be used across multiple platforms, developers are lazy. |
I'll release the code soon. I just want to make it easier to use. It's almost done, I only need to persist the negotiated AES key, otherwise browser history has to be cleared every time you restart the mitm script. |
With a clean cache, which request sets up the handshake and does it happen right when i log into the website? |
I'll take a look at the code, I don't know what you're doing, but i inform you that all this must work with the session currently opened by the addon (service) not one new |
@yoshimo It should be the first request to manifest endpoint, the only one which will be unencrypted. @CastagnaIT What I'm doing is a HTTPS proxy which intercepts communication between a real Netflix client (e.g. the cadmium player js library running in browser) and the Netflix server. Normally, you would be able to decrypt TLS with a special CA installed (this is what mitmproxy does by default) but my proxy script also handles MSL decryption. I will set up a separate repository for this, of course. |
All right, the code is up. Anyone is welcome to try it. |
@nohajc i used pip to install pycryptodome, but your script says it can'T find the module on my windows installation. Do you have an idea what goes wrong? |
Ah, sorry, I forgot to mention this in the README. Windows installation of mitmproxy uses its own bundled python runtime. The workaround is to install mitmproxy also with pip. |
Mhm, how do i force a new handshake in this addon? |
Yes, logging out does not close the MSL session. The decryption key will stay the same for some time. That's why I cache it in the json file. If you still want a new handshake for some reason, you have to delete all Netflix cookies and local storage or start a new browser profile. |
|
Resetting browser cache should trigger a new handshake, but you don't have to delete the json file of the decryptor. It will be updated automatically with a new key.
I'm not sure but I guess deleting |
thanks nohajc, i just did a test, you get much information more clearly |
You're welcome. I noticed you've forked the repository. Feel free to make a pull request, so that I can merge your changes. |
Is there any progress? Maybe it is possible to split this request into two parts. I think it is possible to sync watched status to kodi, syncing it back to Netflix might be a challenge but that would make the plug-in perfect for me. Now reading and syncing play status from and to kodi seems like a very different story. |
the progress can be seen in PR, I have something more in local but not much
it's not easy, you also need to work to find the right compromise with Kodi video management for watched status and resume. Another obstacle is the Kodi library, i haven't yet researched how to update video watched and resume for each video, without overburdening with too many requests. I also think there's going to be another problem with the cache management, not yet checked. I'm following the set plan, if it's not followed in perfect order, it's only because things are intrinsically linked |
Maybe you can use some of the Trakt implementation? They have syncing watched status down pretty reliable both ways. Agreed it is harder to sync watch progress into kodi, but Trakt is also outputting progress at reasonable intervals. I would reckon it is more difficult to read and write that info to Netflix database |
i can see how trakt addon update edit the watched/resume status to the Kodi items, |
AFAICT trakt works using This means we cannot easily manage/sync See add-ons/plugin.video.vrt.nu#568 for all the discussions, pull-requests and feature request. |
hi dagwieers, thanks for useful info! for now i have other things to complete before get to these changes |
@dagwieers I'm trying use this xbmc/xbmc#17202 happen same thing if i set watched/resume status by: xbmcgui.ListItem is that normal? |
@CastagnaIT If you use ListItem properties to set the playcount and resumetime, you are overriding the information from the database. And that is problematic, because if you return to a listing, this information is stale. With xbmc/xbmc#17202 we no longer need to use ListItem properties, as we can read/write from the database, and rather than set the information in the ListItem, you should update the database and refresh the listing (if necessary). |
i do some tests i was thinking that things are really complicated, i'm not quite sure how to proceed JSONRPC way, i can not use it when i loading page, this method need a refresh and will result in a Kodi infinite loop (). In addition even if it works, a user can change the status (via ctx menu or keyboard etc), but there is no kodi callback function, then changes it will not be reflected to netflix service. The method: The method: I find it a nightmare, there should now be an opportunity to set/update a initial value when i create an listitem object perhaps can be implemented in this way: and inside the method addDirectoryItems() and after, have a callback way to handle watched/unwatched events when user change manually the value (By Monitor callback) I think add these two things to Kodi would save a lot of trouble opened discussion also to forum: https://forum.kodi.tv/showthread.php?tid=351609 |
It is a nightmare, with a lot of tradeoffs. That is why being able to update the database and no longer needing to add this information to the ListItem is crucial. It is true that there is no hook for the context menu items (Mark as (un)watched or Reset position) and we haven't looked at how we will simplify our existing implementation for Matrix. But as you indicated, the process would mostly look like:
To speed up this process and ensure we finish before Kodi refreshes an existing listing, we update locally immediately and online asynchronously. |
I'll try making some modifications to Kodi similar described above |
I'm almost ready to merge it with the master branch! for the noobs, test does not mean see if it starts, you must also monitor the log in verbose mode, to ensure that there are no errors before running the test read also the notes of the PR #385
!!!WARNING!!! |
I'm submitting a ...
General information
Not sure if it's a feature request or a bug report...
When you watch an episode from a browser or the netflix app, Netflix remembers the watched status or resume points.
When you browse ie 'My List' and video was already seen, Kodi displays it. But wen you watch something from Kodi, Netflix is not updated.
Would it be possible to send a notification to Netflix when the video is stopped with the watch status/resume point ?
Then it will be possible to continue watching something in the Netflix app that was started on Kodi.
Thanks for your comments.
Addon version used
From sources at commit 8777e02
https://github.com/CastagnaIT/plugin.video.netflix/tree/8777e02a19c3763819d39178b2695dea0a49a03d
Installation
Operating System
Additional informatin on the environment
LibreELEC 9.0.1
The text was updated successfully, but these errors were encountered: