Skip to content

plugins.ceskatelevize: update for ct24, sport and sportplus; add decko #5063

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

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

mkbloke
Copy link
Member

@mkbloke mkbloke commented Jan 2, 2023

@duunsupen, could you check this is working for all channels by sideloading the updated plugin, please? I think it's probably working OK, but they seem to detect VPS based proxies, so I just get the short clip telling me the channel isn't available for all except CT24.


For some reason, the subdomains are both different to the main channels in terms of HTML and JSON data, and different to each other as well. The API response is slightly different for sport too. All a bit strange.

I didn't bother going through the process of finding the id for CT24, as it seems unlikely it'll change.

I notice that sometimes the streaming URL gets an empty response, but it seems intermittent. I've seen that happen in the web browser too via the network tab on the dev console.

closes #5055

@mkbloke mkbloke added plugin issue A Plugin does not work correctly restriction: geo blocked labels Jan 2, 2023
Copy link
Member

@bastimeyer bastimeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pluginmatcher should be changed.

First, https://www.ceskatelevize.cz/#live is an invalid link, and second, https://ct24.ceskatelevize.cz/ should work without the URL hash, as it doesn't change anything in regards to the initial HTTP request of the plugin.

Also, those do not match (which are links from the channel selection dropdown):

  • https://sport.ceskatelevize.cz/zive-vysilani#live
  • https://decko.ceskatelevize.cz/zive (ignore this if you don't want to support this channel)

Just split the pluginmatcher into multiple ones if you already need to make a distinction between regular channels and special case channels. Then check which matcher matched.

@duunsupen
Copy link

Hi Guys, unfortunately I wasn't able to get it to work.
I use an Enigma2 STB with OpenHDF 7.0 (Python 3.97) took the ceskatelvize.py plugin from here:
https://github.com/mkbloke/streamlink/blob/ceskatelevize/src/streamlink/plugins/ceskatelevize.py and put it in
/home/root/.config/, then restarted the box. When opening https://ct24.ceskatelevize.cz/#live I got the typical Streamlink message screen in Enigma2 when something doesn't work ("Offline"). See debug log below.

I am probably not much of a help here as I am either doing something wrong or used the wrong plugin or so...

root@gbquad4k:~# /usr/sbin/streamlinksrv manualstart debug
[streamlinksrv][info] Mon Jan 2 21:45:08 2023 Server (1.8.3) started
[streamlinksrv][debug] Host: gbquad4k
[streamlinksrv][debug] Port: 8088
[streamlinksrv][debug] OS: Linux-4.1.20-1.9-armv7l-with-glibc2.34
[streamlinksrv][debug] Python: 3.9.7
[streamlinksrv][info] Streamlink: 0.0.0+unknown
[streamlinksrv][debug] youtube-dl: 2021.12.17
[streamlinksrv][debug] optparser: 0.3.0
[streamlinksrv][debug] Requests(2.26.0), Socks(1.7.1), Websocket(1.2.1)
[session][debug] Plugin ceskatelevize is being overridden by /home/root/.config/streamlink/plugins/ceskatelevize.py
[streamlinksrv][error] Got exception: local variable 'resolved_url' referenced before assignment
['Traceback (most recent call last):', ' File "/usr/sbin/streamlinksrv", line 794, in Stream', ' config_files, plugin = setup_config_files(streamlink, url)', ' File "/usr/sbin/streamlinksrv", line 758, in setup_config_files', ' return (config_files, pluginclass(streamlink, resolved_url))', "UnboundLocalError: local variable 'resolved_url' referenced before assignment"]
[streamlinksrv][debug] Send Offline clip

@mkbloke
Copy link
Member Author

mkbloke commented Jan 2, 2023

Thanks for trying. I'd forgotten you were using streamlinksrv. I'll get the plugin working under Streamlink, but what you are running and the Streamlink version in use is an unknown for us, that we cannot support.

When the plugin is working and merged into Streamlink master, you might have to contact the maintainers of streamlinksrv to get it working for you.

@bastimeyer
Copy link
Member

[session][debug] Plugin ceskatelevize is being overridden by /home/root/.config/streamlink/plugins/ceskatelevize.py

As you can see, the plugin was sideloaded by the Streamlink session instance.

[streamlinksrv][error] Got exception: local variable 'resolved_url' referenced before assignment

This, however, is not a Streamlink issue. You are using a third party project which embeds/implements Streamlink, and we don't support that here. One hint, local variable 'resolved_url' referenced before assignment" suggests that this "streamlinksrv" project has copied stuff from an old version of the streamlink/streamlink_cli package and didn't update stuff after the latest major version upgrades of Streamlink, so your software is incompatible. You'll have to figure this out on your own or contact the maintainer of that project.

@bastimeyer
Copy link
Member

/home/root/.config/streamlink/plugins/

This is a deprecated path, btw. The actual plugin path is ${XDG_DATA_HOME:-${HOME}/.local/share}/streamlink/plugins/.
https://streamlink.github.io/cli/plugin-sideloading.html

@duunsupen
Copy link

"When the plugin is working and merged into Streamlink master, you might have to contact the maintainers of streamlinksrv to get it working for you."

That's what I am going to to in case it is needed.
Thanks a lot to all of you.

@mkbloke mkbloke changed the title plugins.ceskatelevize: update for ct24 and sport plugins.ceskatelevize: update for ct24, sport and sportplus; add decko Jan 11, 2023
@mkbloke
Copy link
Member Author

mkbloke commented Jan 11, 2023

Sorry for the delay. I have fixed it up now, so I think everything should be resolved. I've added support for Decko and the sometimes on-air SportPlus (ct29). When SportPlus isn't on-air https://www.ceskatelevize.cz/zive/ct29/ redirects to /zive/. This redirect also occurs for /zive/anything-unknown.

@mkbloke mkbloke added the WIP Work in process label Jan 12, 2023
@mkbloke
Copy link
Member Author

mkbloke commented Jan 12, 2023

One thing about matching on the subdomain is that you need to follow the redirect first, as Sport and Decko are both linked from /zive as /zive/sport and /zive/decko respectively. The links at the bottom of https://www.ceskatelevize.cz/ link directly to the subdomains though. Talking of which, I see Art is linked via a subdomain there too, so I might need to add that if the live channel is also available on the subdomain. I can't check that until Art is back on-air though.

I've also had to modify the schema for off-air channels to accommodate different responses.

I see right now there are even more SportPlus channels: ct25; ct28; ct29; ct31 and ct32 all linked off /zive/. None of them are on-air until later this evening though, so I can't check them right now.

Given all of the above, I've just tagged this as WIP for now.

@mkbloke
Copy link
Member Author

mkbloke commented Jan 13, 2023

Art is linked via a subdomain there too, so I might need to add that if the live channel is also available on the subdomain.

Does not look to be so.

SportPlus channels: ct25; ct28; ct29; ct31 and ct32 all linked off /zive/

All tested and working as far as I can tell (the manifest is returned, but the geo-restriction means I couldn't test full streaming).

@mkbloke mkbloke removed the WIP Work in process label Jan 13, 2023
@bastimeyer
Copy link
Member

I'll have another look later today. Thanks for the updates.

@bastimeyer
Copy link
Member

Geo-restricted streams sometimes seem to fail instead of showing the geo-restriction video:

$ streamlink --player-no-close 'https://www.ceskatelevize.cz/zive/ct1/' best
[cli][info] Found matching plugin ceskatelevize for URL https://www.ceskatelevize.cz/zive/ct1/
[cli][info] Available streams: 288p (worst), 404p, 576p (best)
[cli][info] Opening stream: 576p (dash)
[cli][info] Starting player: mpv
[utils.named_pipe][info] Creating pipe streamlinkpipe-206770-1-2460
[utils.named_pipe][info] Creating pipe streamlinkpipe-206770-2-5180
[stream.ffmpegmux][error] Pipe copy aborted: /tmp/streamlinkpipe-206770-1-2460
[stream.dash][warning] Download of segment: 000001.m4s aborted
[cli][error] Try 1/1: Could not open stream <DASHStream ['dash', 'https://ivys-vst09-5.o2tv.cz/aa/05a2b1f97d6c1e2f879e917d8a584fc1/1673674842326/a60bed1601d42fb4f25e275dc0dbfb9c3/dna-61924494876945083-pc/mpd']> (No data returned from stream)
error: Could not open stream <DASHStream ['dash', 'https://ivys-vst09-5.o2tv.cz/aa/05a2b1f97d6c1e2f879e917d8a584fc1/1673674842326/a60bed1601d42fb4f25e275dc0dbfb9c3/dna-61924494876945083-pc/mpd']>, tried 1 times, exiting
[cli][info] Closing currently open stream...

I can't see anything in the API responses or any HTTP response headers which would indicate geo-restriction, so there's probably not much that can be done plugin-wise. This looks more like an issue with the DASH implementation, which kills the ffmpeg process to early.

Other than that, the plugin should be fine. self.id gets set to an integer in get_ct24 and get_decko which is not the correct type, but since there's no type checking in those methods, it doesn't matter.

@bastimeyer
Copy link
Member

While testing with a Czech VPN, the sports stream didn't seem to work:

$ streamlink --player-no-close 'https://sport.ceskatelevize.cz' best
[cli][info] Found matching plugin ceskatelevize for URL https://sport.ceskatelevize.cz
error: Unable to open URL: https://ivys-cdn.o2tv.cz/cdn/uri/get/?contentType=live&drmOnly=false&expiry=1673679694&id=422&playerType=dash&quality=web&region=4&skipIpAddressCheck=false&userId=7fa9c1d1512da9e6&token=759f17e50f37147a337cb873ef5edc4dc671a520&encryption=wv (404 Client Error: Not found for url: https://ivys-vst01-1.o2tv.cz/atip/8a51e3901a19162c015395fa69c1fb11/1673676098496/422-tv-pc.mpd?userId=7fa9c1d1512da9e6)

The result is a 404 response if the drm attribute of the JSON POST payload is set to 0. If set to 1, the correct DASH manifest gets returned which the website uses (the website sets drm to 1), but it's of course not supported by Streamlink. :/

@back-to back-to merged commit fe6f51a into streamlink:master Jan 19, 2023
@mkbloke mkbloke deleted the ceskatelevize branch January 20, 2023 21:01
@luxorko
Copy link

luxorko commented Aug 18, 2023

ct1, ct2 streams nor working

@bastimeyer
Copy link
Member

bastimeyer commented Aug 18, 2023

You are commenting on a merged pull request. Open a new plugin issue and fill in all the required details.

@streamlink streamlink locked as resolved and limited conversation to collaborators Aug 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
plugin issue A Plugin does not work correctly restriction: geo blocked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plugins.ceskatelevize: URL updates needed for CT24 and CT Sport
5 participants