Thanks to visit codestin.com
Credit goes to github.com

Skip to content

plugins.youtube: fix live streams#6777

Merged
bastimeyer merged 1 commit into
streamlink:masterfrom
bastimeyer:plugins/youtube/fix-live-streams
Jan 18, 2026
Merged

plugins.youtube: fix live streams#6777
bastimeyer merged 1 commit into
streamlink:masterfrom
bastimeyer:plugins/youtube/fix-live-streams

Conversation

@bastimeyer

@bastimeyer bastimeyer commented Jan 18, 2026

Copy link
Copy Markdown
Member
  • Always retrieve HLS multivariant playlist URLs from v1 API
  • Set clientName to ANDROID and clientVersion to 19.45.36, which results in HLS master playlists with valid segment URLs
  • Do some minor cleanup around content status checking
  • Keep parsing initial player response for category data
  • TODO: clean up validation schemas and how they're applied
  • TODO: remove parsing of non-HLS stuff, as we don't support this

Resolves #6775

As noted, there's some more cleanup to do, but this can be done later in a different PR.

Not sure how viable it is to hardcode the clientVersion with a specific clientName. It's possible that YouTube simply hasn't updated the restrictions which were introduced for their WEB player yet for the ANDROID API requests. We'll see. For now, this seems to be working.

However, before I'm going to merge this, I'd appreciate if I could see some more test results from other people, just to be sure that this isn't something region-based and to be sure that there's no accessibility expiration as it was with the IOS API request.
https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#pull-request-feedback

$ streamlink -l debug -o /dev/null https://www.youtube.com/@hospitalrecords best
[cli][debug] OS:         Linux-6.18.5-1-git-x86_64-with-glibc2.42
[cli][debug] Python:     3.14.2
[cli][debug] OpenSSL:    OpenSSL 3.6.0 1 Oct 2025
[cli][debug] Streamlink: 8.1.1+1.g08458b42
[cli][debug] Dependencies:
[cli][debug]  certifi: 2026.1.4
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 6.0.2
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.23.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.5
[cli][debug]  trio: 0.32.0
[cli][debug]  trio-websocket: 0.12.2
[cli][debug]  urllib3: 2.6.3
[cli][debug]  websocket-client: 1.9.0
[cli][debug] Arguments:
[cli][debug]  url=https://www.youtube.com/@hospitalrecords
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --player=mpv
[cli][debug]  --output=/dev/null
[cli][debug]  --webbrowser-headless=True
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/@hospitalrecords
[plugins.youtube][debug] consent target: https://consent.youtube.com/save
[plugins.youtube][debug] consent data: gl, m, app, pc, continue, x, bl, hl, src, cm, escs, set_ytc, set_apyt, set_eom
[plugins.youtube][debug] Using video ID: Cwq3AFyV044
[plugins.youtube][debug] This video is live.
[utils.l10n][debug] Language code: en_US
[cli][info] Available streams: 144p (worst), 240p, 360p, 480p, 720p, 1080p (best)
[cli][info] Opening stream: 1080p (hls)
[cli][info] Writing output to
/dev/null
[cli][debug] Checking file output
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] First Sequence: 26722538; Last Sequence: 26722552
[stream.hls][debug] Start offset: 0; Duration: 0.0; Start Sequence: 26722550; End Sequence: None
[stream.segmented][debug] Queuing HLSSegment(num=26722550, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.segmented][debug] Queuing HLSSegment(num=26722551, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.segmented][debug] Queuing HLSSegment(num=26722552, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26722550 to output
[stream.hls][debug] Segment 26722550 complete
[cli][debug] Writing stream to output
[stream.hls][debug] Writing segment 26722551 to output
[stream.hls][debug] Segment 26722551 complete
[stream.hls][debug] Writing segment 26722552 to output
[stream.hls][debug] Segment 26722552 complete
[stream.hls][debug] Reloading playlist
[stream.segmented][debug] Queuing HLSSegment(num=26722553, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26722553 to output
[stream.hls][debug] Segment 26722553 complete
[stream.hls][debug] Reloading playlist
[stream.segmented][debug] Queuing HLSSegment(num=26722554, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26722554 to output
[stream.hls][debug] Segment 26722554 complete
[stream.hls][debug] Reloading playlist
[stream.segmented][debug] Queuing HLSSegment(num=26722555, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26722555 to output
[stream.hls][debug] Segment 26722555 complete
[stream.hls][debug] Reloading playlist
[stream.segmented][debug] Queuing HLSSegment(num=26722556, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26722556 to output
[stream.hls][debug] Segment 26722556 complete
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...
[download] Written 6.52 MiB to /dev/null (8s @ 811.64 KiB/s)

- Always retrieve HLS multivariant playlist URLs from v1 API
- Set `clientName` to `ANDROID` and `clientVersion` to `19.45.36`,
  which results in HLS master playlists with valid segment URLs
- Do some minor cleanup around content status checking
- Keep parsing initial player response for category data
- TODO: clean up validation schemas and how they're applied
- TODO: remove parsing of non-HLS stuff, as we don't support this
@bastimeyer bastimeyer added the plugin issue A Plugin does not work correctly label Jan 18, 2026
@purplescorpion1

purplescorpion1 commented Jan 18, 2026

Copy link
Copy Markdown

Working fine with me - tested all live stream url types

C:\Users\username>streamlink -l debug https://www.youtube.com/@SkyNews/live best
[session][debug] Loading plugin: youtube
[cli][debug] OS:         Windows 11
[cli][debug] Python:     3.14.0
[cli][debug] OpenSSL:    OpenSSL 3.0.18 30 Sep 2025
[cli][debug] Streamlink: 8.0.0+7.gb6be484
[cli][debug] Dependencies:
[cli][debug]  certifi: 2025.10.5
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 6.0.2
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.23.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.5
[cli][debug]  trio: 0.32.0
[cli][debug]  trio-websocket: 0.12.2
[cli][debug]  urllib3: 2.5.0
[cli][debug]  websocket-client: 1.9.0
[cli][debug] Arguments:
[cli][debug]  url=https://www.youtube.com/@SkyNews/live
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --player-args=--file-caching=10000
[cli][debug]  --ffmpeg-ffmpeg=C:\Program Files\Streamlink\ffmpeg\ffmpeg.exe
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/@SkyNews/live
[plugins.youtube][debug] consent target: https://consent.youtube.com/save
[plugins.youtube][debug] consent data: gl, m, app, pc, continue, x, bl, hl, src, cm, escs, set_ytc, set_apyt, set_eom
[plugins.youtube][debug] Using video ID: YDvsBbKfLPA
[plugins.youtube][debug] This video is live.
[utils.l10n][debug] Language code: en_US
[cli][info] Available streams: 144p (worst), 240p, 360p, 480p, 720p, 1080p (best)
[cli][info] Opening stream: 1080p (hls)
[cli][info] Starting player: C:\Program Files (x86)\VideoLAN\VLC\vlc.exe
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] First Sequence: 6973685; Last Sequence: 6973690
[stream.hls][debug] Start offset: 0; Duration: 0.0; Start Sequence: 6973688; End Sequence: None
[stream.segmented][debug] Queuing HLSSegment(num=6973688, init=False, discontinuity=False, duration=5.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.segmented][debug] Queuing HLSSegment(num=6973689, init=False, discontinuity=False, duration=5.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.segmented][debug] Queuing HLSSegment(num=6973690, init=False, discontinuity=False, duration=5.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 6973688 to output
[stream.hls][debug] Segment 6973688 complete
[cli.output][debug] Opening subprocess: ['C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe', '--input-title-format', 'https://www.youtube.com/@SkyNews/live', '--file-caching=10000', '-']
[stream.hls][debug] Writing segment 6973689 to output
[stream.hls][debug] Segment 6973689 complete
[stream.hls][debug] Writing segment 6973690 to output
[stream.hls][debug] Segment 6973690 complete
[cli][debug] Writing stream to output
[stream.hls][debug] Reloading playlist
[stream.segmented][debug] Queuing HLSSegment(num=6973691, init=False, discontinuity=False, duration=5.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 6973691 to output
[stream.hls][debug] Segment 6973691 complete
[stream.hls][debug] Reloading playlist

@glubsy

glubsy commented Jan 18, 2026

Copy link
Copy Markdown

From proxy node running in the USA:

> streamlink -l debug -o /dev/null https://www.youtube.com/@hospitalrecords best 
[cli][debug] OS:         Linux-6.18.2-arch2-1-x86_64-with-glibc2.42
[cli][debug] Python:     3.13.11
[cli][debug] OpenSSL:    OpenSSL 3.6.0 1 Oct 2025
[cli][debug] Streamlink: 8.1.1+1.g2897257a
[cli][debug] Dependencies:
[cli][debug]  certifi: 2025.11.12
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 6.0.2
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.23.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.5
[cli][debug]  trio: 0.32.0
[cli][debug]  trio-websocket: 0.12.2
[cli][debug]  urllib3: 2.5.0
[cli][debug]  websocket-client: 1.9.0
[cli][debug] Arguments:
[cli][debug]  url=https://www.youtube.com/@hospitalrecords
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --output=/dev/null
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/@hospitalrecords
[plugins.youtube][debug] Using video ID: Cwq3AFyV044
[plugins.youtube][debug] This video is live.
[utils.l10n][debug] Language code: en_US
[cli][info] Available streams: 144p (worst), 240p, 360p, 480p, 720p, 1080p (best)
[cli][info] Opening stream: 1080p (hls)
[cli][info] Writing output to
/dev/null
[cli][debug] Checking file output
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] First Sequence: 26724599; Last Sequence: 26724613
[stream.hls][debug] Start offset: 0; Duration: 0.0; Start Sequence: 26724611; End Sequence: None
[stream.segmented][debug] Queuing HLSSegment(num=26724611, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.segmented][debug] Queuing HLSSegment(num=26724612, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.segmented][debug] Queuing HLSSegment(num=26724613, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26724611 to output
[stream.hls][debug] Segment 26724611 complete
[cli][debug] Writing stream to output
[stream.hls][debug] Reloading playlist
[stream.segmented][debug] Queuing HLSSegment(num=26724614, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26724612 to output
[stream.hls][debug] Segment 26724612 complete
[stream.hls][debug] Reloading playlist
[stream.segmented][debug] Queuing HLSSegment(num=26724615, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26724613 to output
[stream.hls][debug] Segment 26724613 complete
[stream.hls][debug] Writing segment 26724614 to output
[stream.hls][debug] Segment 26724614 complete
[stream.hls][debug] Writing segment 26724615 to output
[stream.hls][debug] Segment 26724615 complete
[stream.hls][debug] Reloading playlist
[stream.segmented][debug] Queuing HLSSegment(num=26724616, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26724616 to output
[stream.hls][debug] Segment 26724616 complete
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...
[download] Written 5.59 MiB to /dev/null (5s @ 1.16 MiB/s)

From a proxy node located in the Netherlands:

> streamlink -l debug -o /dev/null https://www.youtube.com/@hospitalrecords best
[cli][debug] OS:         Linux-6.18.2-arch2-1-x86_64-with-glibc2.42
[cli][debug] Python:     3.13.11
[cli][debug] OpenSSL:    OpenSSL 3.6.0 1 Oct 2025
[cli][debug] Streamlink: 8.1.1+1.g2897257a
[cli][debug] Dependencies:
[cli][debug]  certifi: 2025.11.12
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 6.0.2
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.23.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.5
[cli][debug]  trio: 0.32.0
[cli][debug]  trio-websocket: 0.12.2
[cli][debug]  urllib3: 2.5.0
[cli][debug]  websocket-client: 1.9.0
[cli][debug] Arguments:
[cli][debug]  url=https://www.youtube.com/@hospitalrecords
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --output=/dev/null
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/@hospitalrecords
[plugins.youtube][debug] consent target: https://consent.youtube.com/save
[plugins.youtube][debug] consent data: gl, m, app, pc, continue, x, bl, hl, src, cm, escs, set_ytc, set_apyt, set_eom
[plugins.youtube][error] Could not get video info - LOGIN_REQUIRED: Sign in to confirm you’re not a bot
error: No playable streams found on this URL: https://www.youtube.com/@hospitalrecords

The required login error could be unrelated as it's a shared proxy.

@purplescorpion1

Copy link
Copy Markdown

From proxy node running in the USA:

> streamlink -l debug -o /dev/null https://www.youtube.com/@hospitalrecords best 
[cli][debug] OS:         Linux-6.18.2-arch2-1-x86_64-with-glibc2.42
[cli][debug] Python:     3.13.11
[cli][debug] OpenSSL:    OpenSSL 3.6.0 1 Oct 2025
[cli][debug] Streamlink: 8.1.1+1.g2897257a
[cli][debug] Dependencies:
[cli][debug]  certifi: 2025.11.12
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 6.0.2
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.23.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.5
[cli][debug]  trio: 0.32.0
[cli][debug]  trio-websocket: 0.12.2
[cli][debug]  urllib3: 2.5.0
[cli][debug]  websocket-client: 1.9.0
[cli][debug] Arguments:
[cli][debug]  url=https://www.youtube.com/@hospitalrecords
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --output=/dev/null
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/@hospitalrecords
[plugins.youtube][debug] Using video ID: Cwq3AFyV044
[plugins.youtube][debug] This video is live.
[utils.l10n][debug] Language code: en_US
[cli][info] Available streams: 144p (worst), 240p, 360p, 480p, 720p, 1080p (best)
[cli][info] Opening stream: 1080p (hls)
[cli][info] Writing output to
/dev/null
[cli][debug] Checking file output
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] First Sequence: 26724599; Last Sequence: 26724613
[stream.hls][debug] Start offset: 0; Duration: 0.0; Start Sequence: 26724611; End Sequence: None
[stream.segmented][debug] Queuing HLSSegment(num=26724611, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.segmented][debug] Queuing HLSSegment(num=26724612, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.segmented][debug] Queuing HLSSegment(num=26724613, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26724611 to output
[stream.hls][debug] Segment 26724611 complete
[cli][debug] Writing stream to output
[stream.hls][debug] Reloading playlist
[stream.segmented][debug] Queuing HLSSegment(num=26724614, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26724612 to output
[stream.hls][debug] Segment 26724612 complete
[stream.hls][debug] Reloading playlist
[stream.segmented][debug] Queuing HLSSegment(num=26724615, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26724613 to output
[stream.hls][debug] Segment 26724613 complete
[stream.hls][debug] Writing segment 26724614 to output
[stream.hls][debug] Segment 26724614 complete
[stream.hls][debug] Writing segment 26724615 to output
[stream.hls][debug] Segment 26724615 complete
[stream.hls][debug] Reloading playlist
[stream.segmented][debug] Queuing HLSSegment(num=26724616, init=False, discontinuity=False, duration=2.000, title=None, key=None, byterange=None, date=None, map=None, fileext='ts')
[stream.hls][debug] Writing segment 26724616 to output
[stream.hls][debug] Segment 26724616 complete
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...
[download] Written 5.59 MiB to /dev/null (5s @ 1.16 MiB/s)

From a proxy node located in the Netherlands however:

> streamlink -l debug -o /dev/null https://www.youtube.com/@hospitalrecords best
[cli][debug] OS:         Linux-6.18.2-arch2-1-x86_64-with-glibc2.42
[cli][debug] Python:     3.13.11
[cli][debug] OpenSSL:    OpenSSL 3.6.0 1 Oct 2025
[cli][debug] Streamlink: 8.1.1+1.g2897257a
[cli][debug] Dependencies:
[cli][debug]  certifi: 2025.11.12
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 6.0.2
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.23.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.5
[cli][debug]  trio: 0.32.0
[cli][debug]  trio-websocket: 0.12.2
[cli][debug]  urllib3: 2.5.0
[cli][debug]  websocket-client: 1.9.0
[cli][debug] Arguments:
[cli][debug]  url=https://www.youtube.com/@hospitalrecords
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --output=/dev/null
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/@hospitalrecords
[plugins.youtube][debug] consent target: https://consent.youtube.com/save
[plugins.youtube][debug] consent data: gl, m, app, pc, continue, x, bl, hl, src, cm, escs, set_ytc, set_apyt, set_eom
[plugins.youtube][error] Could not get video info - LOGIN_REQUIRED: Sign in to confirm you’re not a bot
error: No playable streams found on this URL: https://www.youtube.com/@hospitalrecords

So your error from the Netherlands is not an issue with the plugin - Its because you are using a vpn and youtube detects that as bot activity so its a VPN issue not a plugin one really

@bastimeyer bastimeyer merged commit 35fdab2 into streamlink:master Jan 18, 2026
25 checks passed
@bastimeyer bastimeyer deleted the plugins/youtube/fix-live-streams branch January 18, 2026 03:21
@gitsleuth

Copy link
Copy Markdown

Confirmed fixed on my end. Installing the build including this PR resolves the 403 Forbidden HLS segment errors.
Tested with streamlink 8.1.1+1.g35fdab2d on Linux/WSL2 using:
streamlink -l debug -o /dev/null https://www.youtube.com/@hospitalrecords best
Segments now download successfully (Writing segment … complete) and there are no more 403s. Thanks!

@DumberSoft

Copy link
Copy Markdown

I have a question, but when it's a premium account, for example, a paid YouTube Live stream, how would I do it in those cases? I've tried using --http-cookie or --config and it doesn't work; I keep getting the same error.

[cli][info] Found matching plugin youtube for URL https://www.youtube.com/watch?v=lldsi8ItNaI
[plugins.youtube][error] Could not get video info - LOGIN_REQUIRED: Sign in to confirm you’re not a bot
error: No playable streams found on this URL: https://www.youtube.com/watch?v=lldsi8ItNaI

@streamlink streamlink locked and limited conversation to collaborators Jan 21, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plugins.youtube: [stream.hls][error] Failed to fetch segment

5 participants