Skip to content

plugins.youtube: 400 Client Error: Bad request for url: https://consent.youtube.com/s #4513

@hiboudev

Description

@hiboudev

Checklist

Streamlink version

Latest stable release

Description

I randomly get this error on Windows 10 when fetching YouTube URL using channel id :

Unable to open URL: https://consent.youtube.com/s (400 Client Error: Bad Request for url: https://consent.youtube.com/s)

This is random, sometimes stream fetching works, sometimes no.

And this is related with using the following type of URL, using the channel id instead of a video id :
https://www.youtube.com/c/TinyKittens/live
https://www.youtube.com/channel/UCeL2LSl91k2VccR7XEh5IKg/live

It always works fine with URLs containing the "watch" parameter :
https://www.youtube.com/watch?v=Pss7fUAUqrs

I'm doing the exact same test on Debian with Python 3.7 and it always works fine.

Debug log

===== Output when it fails :

> streamlink https://www.youtube.com/c/TinyKittens/live --loglevel debug
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.10.1
[cli][debug] Streamlink: 4.0.1
[cli][debug] Requests(2.27.1), Socks(1.7.1), Websocket(1.3.2)
[cli][debug] Arguments:
[cli][debug]  url=https://www.youtube.com/c/TinyKittens/live
[cli][debug]  --loglevel=debug
[cli][debug]  --ffmpeg-ffmpeg=C:\Program Files (x86)\Streamlink\ffmpeg\ffmpeg.exe
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/c/TinyKittens/live
[plugins.youtube][debug] c_data_keys: gl, m, pc, continue, x, v, bl, hl, src, uxe, set_eom, set_ytc, set_apyt
error: Unable to open URL: https://consent.youtube.com/s (400 Client Error: Bad Request for url: https://consent.youtube.com/s)

===== Output when it randomly works :

> streamlink https://www.youtube.com/c/TinyKittens/live  --loglevel debug
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.9.10
[cli][debug] Streamlink: 3.2.0
[cli][debug] Requests(2.27.1), Socks(1.7.1), Websocket(1.2.3)
[cli][debug] Arguments:
[cli][debug]  url=https://www.youtube.com/c/TinyKittens/live
[cli][debug]  --loglevel=debug
[cli][debug]  --ffmpeg-ffmpeg=C:\Program Files (x86)\Streamlink\ffmpeg\ffmpeg.exe
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/c/TinyKittens/live
[plugins.youtube][debug] c_data_keys: gl, m, pc, continue, ca, x, v, t, hl, src, uxe
[plugins.youtube][debug] Using video ID: Pss7fUAUqrs
[plugins.youtube][debug] This video is live.
[utils.l10n][debug] Language code: fr_FR
Available streams: 144p (worst), 240p, 360p, 480p, 720p (best)

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin issueA Plugin does not work correctly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions