Skip to content

plugins.euronews: rewrite and fix plugin #6452

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
Mar 1, 2025

Conversation

bastimeyer
Copy link
Member

Fixes #6450

If there are any issues with embedded YouTube streams on euronews, like required logins, then there's nothing that can be done. These streams should be freely available and Google simply might block users of certain IP address ranges which they deem bots or otherwise untrustworthy.

$ ./script/test-plugin-urls.py euronews
:: https://arabic.euronews.com/live
::  worst, best, 144p, 240p, 360p, 480p, 720p
:: https://de.euronews.com/live
::  worst, best, 144p, 240p, 360p, 480p, 720p
:: https://de.euronews.com/my-europe/2025/02/24/frankreichs-prasident-macron-wird-trump-treffen
::  vod, worst, best
:: https://es.euronews.com/live
::  worst, best, 144p, 240p, 360p, 480p, 720p
:: https://euronews.com/live
::  worst, best, 144p, 240p, 360p, 480p, 720p
:: https://fa.euronews.com/live
::  240p, 360p, 480p, 576p, 720p_alt, 720p, worst, best
:: https://fr.euronews.com/live
::  worst, best, 144p, 240p, 360p, 480p, 720p
:: https://gr.euronews.com/live
::  worst, best, 144p, 240p, 360p, 480p, 720p
:: https://hu.euronews.com/live
::  worst, best, 144p, 240p, 360p, 480p, 720p
:: https://it.euronews.com/live
::  worst, best, 144p, 240p, 360p, 480p, 720p
:: https://pt.euronews.com/live
::  worst, best, 144p, 240p, 360p, 480p, 720p
:: https://ru.euronews.com/live
::  worst, best, 144p, 240p, 360p, 480p, 720p
:: https://tr.euronews.com/live
::  worst, best, 144p, 240p, 360p, 480p, 720p
:: https://www.euronews.com/live
::  worst, best, 144p, 240p, 360p, 480p, 720p
:: https://www.euronews.com/my-europe/2025/02/25/whats-at-stake-for-europe-after-the-german-election
::  vod, worst, best
:: https://www.euronews.com/video/2025/02/28/latest-news-bulletin-february-28th-midday
::  vod, worst, best
$ streamlink -l debug euronews.com/live best
[cli][debug] OS:         Linux-6.13.4-1-git-x86_64-with-glibc2.41
[cli][debug] Python:     3.13.2
[cli][debug] OpenSSL:    OpenSSL 3.4.1 11 Feb 2025
[cli][debug] Streamlink: 7.1.3+5.gba95d0e9
[cli][debug] Dependencies:
[cli][debug]  certifi: 2025.1.31
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 5.3.1
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.21.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.3
[cli][debug]  trio: 0.29.0
[cli][debug]  trio-websocket: 0.12.1
[cli][debug]  urllib3: 2.3.0
[cli][debug]  websocket-client: 1.8.0
[cli][debug] Arguments:
[cli][debug]  url=euronews.com/live
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --player=/usr/bin/mpv
[cli][debug]  --webbrowser-headless=True
[cli][info] Found matching plugin euronews for URL euronews.com/live
[plugins.euronews][debug] Querying live API
[plugins.youtube][debug] Restored cookies: SOCS
[plugins.youtube][debug] Using video ID: pykpO5kQJ98
[plugins.youtube][debug] This video is live.
[utils.l10n][debug] Language code: en_US
[cli][info] Available streams: 144p (worst), 240p, 360p, 480p, 720p (best)
[cli][info] Opening stream: 720p (hls)
[cli][info] Starting player: /usr/bin/mpv
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] First Sequence: 1378831; Last Sequence: 1378836
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 1378834; End Sequence: None
[stream.hls][debug] Adding segment 1378834 to queue
[stream.hls][debug] Adding segment 1378835 to queue
[stream.hls][debug] Adding segment 1378836 to queue
[stream.hls][debug] Writing segment 1378834 to output
[stream.hls][debug] Segment 1378834 complete
[cli.output][debug] Opening subprocess: ['/usr/bin/mpv', '--force-media-title=euronews.com/live', '-']
[stream.hls][debug] Writing segment 1378835 to output
[stream.hls][debug] Segment 1378835 complete
[stream.hls][debug] Writing segment 1378836 to output
[stream.hls][debug] Segment 1378836 complete
[cli][debug] Writing stream to output
[cli][info] Player closed
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][info] Stream ended
[cli][info] Closing currently open stream...
$ streamlink -o /dev/null https://www.euronews.com/my-europe/2025/02/25/whats-at-stake-for-europe-after-the-german-election best
[cli][info] Found matching plugin euronews for URL https://www.euronews.com/my-europe/2025/02/25/whats-at-stake-for-europe-after-the-german-election
[cli][info] Available streams: vod (worst, best)
[cli][info] Opening stream: vod (http)
[cli][info] Writing output to
/dev/null
[download] Written 30.97 MiB to /dev/null (1s)                                                                                                  
[cli][info] Stream ended
[cli][info] Closing currently open stream...

brotli is required when trying to access certain parts of euronews.com. Their websevers simply ignore the Accept-Encoding header, and the response is always compressed using brotli.

I've therefore added the decompress extras marker in #6451, so Streamlink can properly annotate these optional transitive dependencies. I've already manually included brotli in the Windows builds and Linux AppImages for a long time.

$ curl -s \
  -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36' \
  -H 'Accept-Encoding: gzip, deflate, identity' \
  'https://de.euronews.com/my-europe/2025/02/24/frankreichs-prasident-macron-wird-trump-treffen' \
  | xxd | head -n1
00000000: 5385 0e14 4579 2df5 7051 54d5 7ed8 2922  S...Ey-.pQT.~.)"
$ curl -s \
  -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36' \
  -H 'Accept-Encoding: gzip, deflate, identity' \
  'https://de.euronews.com/my-europe/2025/02/24/frankreichs-prasident-macron-wird-trump-treffen' \
  | brotli --decompress | xxd | head -n1
00000000: 0a3c 2144 4f43 5459 5045 2068 746d 6c3e  .<!DOCTYPE html>

@bastimeyer bastimeyer added the plugin issue A Plugin does not work correctly label Feb 28, 2025
Copy link
Member

@gravyboat gravyboat left a comment

Choose a reason for hiding this comment

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

Looks good and notes about the reqs are clear.

@bastimeyer bastimeyer merged commit b8247ff into streamlink:master Mar 1, 2025
23 checks passed
@bastimeyer bastimeyer deleted the plugins/euronews/rewrite branch March 1, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin issue A Plugin does not work correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plugins.euronews: LOGIN_REQUIRED
2 participants