dut-iptv
dut-iptv copied to clipboard
[Ziggo GO] fixed: NPO 1/2/3 & replay
Describe the bug After having some trouble logging in, I managed to do so. NPO 1, 2 and 3 play fine, but every other live TV stream doesn't, nor does VOD and HBO. Searching works and finds everything the normal Ziggo GO would show in its results, but nothing can be played. This really sounds like I'm not logged in, since you can still play the public channels if you aren't logged in or skipped it when asked (on the website or in the Android app).
To Reproduce Quite simple:
- Get logged in, might need to restart and takes some tries (it weirdly succeeded after I used a wrong username (my email) and random letters as password, after doing that, using the correct one suddenly got me logged in)
- Follow the setup procedure and try to play any live TV channel besides NPO 1, 2 or 3.
- Notice that NPO 1, 2 and 3 work, but all others don't and just load, and stop.
Expected behavior I'm focussing mainly on live TV so: Choose any live TV channel after logging in without problems and watch the livestream.
Screenshots None, but I do have some log entries from trying to play some channels that didn't work (I tried RTL and SBS while logging):
2022-08-21 10:16:12.286 T:2533 INFO <general>: initializing python engine.
2022-08-21 10:16:13.871 T:2533 INFO <general>: CPythonInvoker(4, /storage/.kodi/addons/plugin.video.ziggo/default.py): script successfully run
2022-08-21 10:16:15.547 T:2533 INFO <general>: initializing python engine.
2022-08-21 10:16:15.954 T:2533 INFO <general>: CPythonInvoker(4, /storage/.kodi/addons/plugin.video.ziggo/default.py): script successfully run
2022-08-21 10:16:18.758 T:2533 INFO <general>: initializing python engine.
2022-08-21 10:16:20.531 T:2545 ERROR <general>: GetDirectory - Error getting plugin://plugin.video.ziggo/?_=play_video&channel=lgi-nl-prod-master%3aNL_000004_019461&id=http%3a%2f%2fwp-obc5-live-vxtoken-nl-prod.prod.cdn.dmdsdp.com%2fdash%2fNL_000004_019461%2fmanifest.mpd%26%25%25%26urn%3aorion%3amedia%3astd%3algi-nl-prod-master%3aNL_000004_019461_ORION_Orion-DASH&type=channel
2022-08-21 10:16:20.532 T:2533 INFO <general>: CPythonInvoker(4, /storage/.kodi/addons/plugin.video.ziggo/default.py): script successfully run
2022-08-21 10:16:20.536 T:2413 ERROR <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.ziggo/?_=play_video&channel=lgi-nl-prod-master%3aNL_000004_019461&id=http%3a%2f%2fwp-obc5-live-vxtoken-nl-prod.prod.cdn.dmdsdp.com%2fdash%2fNL_000004_019461%2fmanifest.mpd%26%25%25%26urn%3aorion%3amedia%3astd%3algi-nl-prod-master%3aNL_000004_019461_ORION_Orion-DASH&type=channel) failed
2022-08-21 10:16:20.610 T:2533 INFO <general>: initializing python engine.
2022-08-21 10:16:20.937 T:2533 INFO <general>: CPythonInvoker(4, /storage/.kodi/addons/plugin.video.ziggo/default.py): script successfully run
2022-08-21 10:16:22.817 T:2533 INFO <general>: initializing python engine.
2022-08-21 10:16:23.563 T:2549 ERROR <general>: GetDirectory - Error getting plugin://plugin.video.ziggo/?_=play_video&channel=lgi-nl-prod-master%3aNL_000004_019461&id=http%3a%2f%2fwp-obc5-live-vxtoken-nl-prod.prod.cdn.dmdsdp.com%2fdash%2fNL_000004_019461%2fmanifest.mpd%26%25%25%26urn%3aorion%3amedia%3astd%3algi-nl-prod-master%3aNL_000004_019461_ORION_Orion-DASH&type=channel
2022-08-21 10:16:23.564 T:2533 INFO <general>: CPythonInvoker(4, /storage/.kodi/addons/plugin.video.ziggo/default.py): script successfully run
2022-08-21 10:16:23.570 T:2413 ERROR <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.ziggo/?_=play_video&channel=lgi-nl-prod-master%3aNL_000004_019461&id=http%3a%2f%2fwp-obc5-live-vxtoken-nl-prod.prod.cdn.dmdsdp.com%2fdash%2fNL_000004_019461%2fmanifest.mpd%26%25%25%26urn%3aorion%3amedia%3astd%3algi-nl-prod-master%3aNL_000004_019461_ORION_Orion-DASH&type=channel) failed
Device:
- Type: Raspberry Pi 4B freshly installed on a tested SD card (64GB Samsung)
- OS: LibreELEC 10.0.2
- Kodi Matrix 19.4
- Addon Version 1.4.7
Additional context What I've noticed when starting a live TV-stream in Ziggo Go (Firefox; Windows 10), is that there's an entry in the network tab (inside the Firefox Developer Tools) that mentions the address the plugin is trying to stream from, but gets redirected to a domain that looks like: id.cdn.upcbroadband.com There is a 40 character subdomain in front of it and a "da-" prefix. Example: da-40characters.id.cdn.upcbroadband.com
After looking into the code trying to figure out what's happening, I realize this isn't helpful at all. Postman and the developer tools have been really helpful and I found that Ziggo (and Telenet, they're exactly using the same system as far as I could see) almost fully switched from OESP (Orion Enterprise Service Platform, wasn't easy to find) to something else. What, I don't know. But they changed all links from obo-prod.oesp.ziggogo.tv
to prod.spark.ziggogo.tv
and also changed the way things get handled. It looks like they double encrypt things now, it isn't as easy as just sending a request and getting a magic token. Looking in the network log, it gets a widevine certificate (in Firefox it's Base64 encoded, Chromium browsers automatically decode it, and the certificate is a file and can be downloaded and looks exactly the same) by sending a GET request with, as far as I know, an Accesstoken as cookie, which it gets by sending the token that it got when authenticating (POST request) to https://prod.spark.ziggogo.tv/auth-service/v1/mqtt/token
(GET request); the (new) token url. Afterwards, it send a POST request to the license server, https://prod.spark.ziggogo.tv/eng/web/session-manager/license?ContentId=nl_tv_standaard_cenc
with the certificate as payload. I'm not sure of that, though. It does send an x-streaming-token
which I found in a POST request to https://prod.spark.ziggogo.tv/eng/web/session-service/session/v2/web-desktop/customers/(YOURID)_nl/live
which includes a header called X-Entitlements-Token
which in turn gets it from https://prod.spark.ziggogo.tv/eng/web/purchase-service/v2/customers/(YOURID)_nl/entitlements
. The license server responds with something, the only readable text is: 017.1.0 Built on Aug 5 2022 05:52:11 (1659703912)
. But, looking at above, it might be possible to fully skip that license server. It only gets a new streaming token. The only thing from OESP is the username header: X-OESP-Username
. Profile ID is now X-Profile
. I am trying to get it working and only use prod.spark.ziggogo.tv
and have succesfully logged in using the new system but still am unable to decrypt the DRM protected stream. Many of the old links are dead and I also know why only NPO 1, 2 and 3 work:
This is the request the plugin also does and this is its response. Those 3 represent NPO 1, 2 and 3 (in that order) and something named "FREE" but it doesn't really mean anything anymore as far as I know. To put it shortly, the request it does gives a token that is only valid for the FTA NPO channels. You do need to be logged in to get access to anything at all, though. You still don't get those for free and getting only NPO at Ziggo isn't possible so they knew what would happen when they changed the system (not implying that they specifically tried to stop the plugin from working). It is possible that those channels use it by default, or Ziggo must/is forced to use that form of encryption/DRM protection.
I can finally say I succeeded! I focussed on live TV, and all work now. It's as easy as it was, just a username and password and the code will do all the work (getting IDs, sending requests). I will soon make a pull request on Github, and I might look into VOD. I'll probably first focus on watching missed programs/"terugkijken" (to watch a TV program that has already been broadcast). Recordings would be the next thing to do (shouldn't be too hard when I get terugkijken/missed programs to work, maybe no difference at all).
@3DSBricker : thats great work !!! I was using the addon a lot. Thanks for fixing it !!!
I got live TV and replay working with some workarounds. I'm not planning to use the original way, nor to fully change everything. There still are some dead parts of code, it's kind of a hybrid now but it works. Switching between replay and live works as it should, too. I will upload it to Github and make a pull request, I don't know if recordings were available earlier, but I can't seem to find it and I haven't tested the watchlist, it also claims I haven't got movies and series (I've got XL) but that was a problem before, I haven't tested installing any other way than just overwriting the previous files manually, I'll try to see if I can use the same way as it used. There does seem to be an issue with playing programs using the search button. (edit) One thing I've noticed is that after streaming for about 45 minutes to an hour, Kodi will complain about the streaming token (needed for every license request), however, it just continues to plays and I can click the errors away. The problem is getting the key that needs to be send, I think it still sends the old key and the license server just doesn't really care (yet).
@meganiekje I've created #136. I saw the owner was busy and didn't have much time, so I'll try to make this as simple too, for now you need to install it and then overwrite the files in the Ziggo plugin folder.
@3DSBricker : A lot of thanks for your effort. You make a lot of people very happy ! Only, I can not find the code to install and overwrite the current files. Can you post a link to a zip file ? Alvast bedankt !
@3DSBricker : I found the files at https://github.com/3DSBricker/dut-iptv (I think) I tried to 'Add-ons installeren via een zipbestand' but that fails. Then I tried to replace the files by hand, but that also does not work. Maybe I make a mistake somewhere ? Please explain in more detail what to do exactly.
I can't make a ZIP right now. The plugin is in: https://github.com/3DSBricker/dut-iptv/tree/master/plugin.video.ziggo You can just make a ZIP of that folder (in case you download the whole master/repository), but you only need the files and folders inside this one (meaning only these changed): https://github.com/3DSBricker/dut-iptv/tree/master/plugin.video.ziggo/resources/lib You could install the old one and then replace it with the files and folders in the folder above (plugin.video.ziggo/resources/lib). For Windows it's in the Kodi folder in local app data (Win + R, %appdata%/kodi). You can of course still install using the ZIP made from the parent directory/folder plugin.video.ziggo.
@3DSBricker : Thanks to your info, I managed to replace the files on my windows pc, and on my Libreelec unit. :100: :1st_place_medal: After the replacement I had to do: 'Sessie resetten', 'Cache verwijderen ' and ' Reset Add-on' in de Ziggo Go add-on 'instellingen' to get it running without errors. A lot of thanks from my whole family !!!!!
No problem and glad you got it working. There does still seem to be an issue with running it for the first time, I will try to solve that later. It will give an error about last login success. Afterwards, I'll try to make the installation as simple as possible again.
@3DSBricker : There is also a problem with 'zoeken' . If you try to start a stream that way, is does not work. Also 'films and series' does not work, but all this is not urgent. I am very happy that the important functions are restored. :+1:
Yes, I know, I think it's because searching uses the old API (OESP) and returns different values that cannot be used between APIs. I'll try to fix searching after the last login succes error. This does not happen when you already have been logged in successfully, or manually paste it into the profile JSON file. I don't know how hard movies and series will be, so I'll see if it's doable and how much time it will take. The login errors and searching have priority.
@3DSBricker : I thougth to be clever, and try the api.py you updated 1 hour ago, but now i get a different error: keyError: 'x-streaming-token'. Maybe Ziggo changed the log-in and token procedure again?
Hmm, interesting. I did test it all and noticed replay didn't work when switching from live TV to replay, with the same error. I assumed this was because of the entitlements token expiring. The server will return a 401 (unauthorized). You can check it by enabling debug logging in Kodi (settings > system > logging > option at the top), the log will be in %appdata%/kodi/kodi.log
. What I changed really was minimal and should only affect new users/existing users in a new environment. It checks if you have been logged in before, if not, it creates an entry that you haven't been logged in yet, in which case the code continues logging in. I'm working on a fix for the entitlements token, where it catches the error and re-runs the login process to get the new token, without giving an error. Actually, it would just loop if logging in again doesn't work (resulting in a crash after a while). For now, I'd say it's safe to just delete the whole plugin and reinstall it; because I fixed the login error. Delete it, close Kodi (important), download my repository and make a zip of the plugin.video.ziggo folder. Open Kodi, find the Zip and install it.
Replay TV should now be stable again, I tested many combinations and it is now stable during everything I've tested. Here's the ZIP to be directly installed in Kodi, preferably after deleting the old one, it does for sure need a restart of Kodi.
Thanks for the fix. Initially both replay and live tv worked. but when swapping channels, a lot it stops working. so it's hit and miss for me. hope the dev comes back.
I do not have this issue and it keeps working after heavily switching and stopping/starting. Or starting without stopping first. Could you post a log? Did you remove the previous version first? I've had better experience fully removing the previous one first, including data (meaning username/password, tokens, etc). Did you use the latest version that I posted as ZIP?
With LibreElec, i had to: Add-on verwijderen, including data, Reboot, Install zip, Reboot, Enter login name and password. Reboot. Then replay and live tv works perfect !!! @3DSBricker : you are a hero !!!! BUT :) If you use 'zoeken', the streams mostly do not start. Also if you use 'aan bladwijzers toevoegen' there is a problem. Sometimes starting the same stream a second or thirth time helps. This are just minor details, i'm so happy the major things do work :1st_place_medal:
I'm aware of searching and trying to fix it, but it apparently has changed more than I hoped it would. Recordings seem to now be very very similar, but I can't yet find just how it handles things. If I understand it, it'd be a nice extra feature. I've made the base for it, as it's the same as searching, but I'll focus on that first. They apparently thought it was needed to make searching replay more like a hybrid between replay and live streaming. Doesn't really make sense actually, but I'll try and see if I can get it to work. Not sure if "description" previously was very helpful, but I've found another entry for description that kind of includes the plot. So quite complete.
@3DSBricker : Take your time, no need to hurry :) Would it be possible to SET a recording using Kodi ? I still use my good old Humax 5200C (with a 500 Gb ssd harddisk) to do recordings, and i do not have a device that can do the 'in the cloud' recordings that the nextbox can do. Do you know if there is an other way to set a 'in the cloud' recording ?
In Ziggo GO, the lowest TV subscription has Ziggo GO too ("Kabel TV", do note that internet-only does not, but obviously does have TV using DVB-C, the free channels). I will first focus on simply watching them. Haven't really thought about setting/deleting actually, would be a good idea once it works. The 400 hours limit and the 1 year limit is a disadvantage, but still doable. Unfortunately fUPC (formal UPC) does not have VOD via DVB-C with CI+ modules, and you can only hire them for use in a TV, not just the smartcard. Aan bladwijzers toevoegen, is dat je kijklijst? (is that your watchlist?).
@3DSBricker : 'Aan bladwijzers toevoegen' is a very handy function in Kodi. It can be accessed using context menu: 'c' key on the keyboard. Then a stream or a complete folder shows in 'favorites'= bladwijzers.
@3DSBricker : I just read, that you need to have a MediaBox_XL or a NextBox registered to your Ziggo account. If you do not have that, the 'in the cloud' recording function is not activated. If you have a NextBox(mini), there is no real advantage in using Kodi... If you could trigger Kodi to save a live stream on the local disk, using a sceduler, that would be perfect, but it might violate the DRM....
Offline DRM is possible, at least, Ziggo uses it for downloading movies and watching them offline.
I don't know how those bookmarks (bladwijzers) work. It may be that it doesn't refresh the tokens and use the already-existing tokens that have expired. Could you look into the log and paste it here? I'm curious about the server's response and the error itself. If not, I could look into, but it probably won't really have priority unless it's an easy error/simple fix.
@3DSBricker : this is part of the logfile when I try to play a 'bladwijzer':
2022-09-19 19:44:42.908 T:2716 INFO
2022-09-19 19:44:44.180 T:2116 INFO
2022-09-19 19:44:44.906 T:2116 ERROR
2022-09-19 19:44:45.173 T:2116 ERROR
The 'bladwijzer' itself looks like this:
I hope this helps ;)
Edit: I see that the browsers has deleted parts of the control characters of the logfile.
The favourite looks like this:
Could you turn on debug logging? It looks like it indeed is trying to use the expired key, but with debug logging I can say it for sure. You can censor any private information like IDs, tokens (although they expire after a minute to max an hour, anyway) and username. 403 forbidden; sounds like sending an old token, but I'd need debug logging to see if the login function has been called. I might ndit haven't updated that part, but it does show the correct license server so I doubt that.
@3DSBricker,
Great work. your fix works for me perfectly on Live and Replay! I don't use search but would like to have Movies&Series working in the future if you find the time ;-)
Thank you again!
I think I'm on the right track with searching, I don't really see any logic at all in their movies and series implementation, I only see every individual movie being loaded, instead of just a list with the movies. But I'll look into it later, again. Recording looks similar to searching and somewhat to live view (surprisingly different from replay in terms of license). Really everything about the API is different, but the differences between the internal options/systems like recordings/replay/searching (once you've got the info from the searched program, like it's ID) are small. At least they use the same license server and all the other servers before acquiring the license (login tokens, tokens to get other tokens, tokens to get a temporary token, the license token). Same domain, nearly same link, small differences.
@meganiekje I think I know why favorites/bookmarks/bladwijzers don't work, it looks like it builds the url in the old way, but sort of gets replaced with a new, thus sending a different request. The other possibility still remains, that it simply doesn't refresh the token. I thought I fixed it by logging in again, but it seems it doesn't do that and gives an error anyway. I'd know more if you tried it with debug, though. Do know that this will include username and (useless) token (because it's only valid for about an hour if you don't refresh it within the stream, to start a stream, it's only valid for like 5 minutes). I'd suggest to find the headers by searching for your username and censor the sensitive information.