[Twitch] ERROR: An extractor error has occurred. (caused by KeyError('data')); #27176

Open
opened 2026-02-21 14:40:50 -05:00 by deekerman · 16 comments
Owner

Originally created by @pitsi on GitHub (Nov 14, 2025).

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2025.10.19
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones

Verbose log

$ youtube-dl -Fv https://m.twitch.tv/videos/2578729410
[debug] System config: []
[debug] User config: ['--no-cache-dir', '--user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36']
[debug] Custom config: []
[debug] Command-line args: ['-Fv', 'https://m.twitch.tv/videos/2578729410']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2025.10.19 [1e109aaee] (single file build)
[debug] ** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl.
[debug] ** For support, visit the main site.
[debug] Python 3.13.9 (CPython x86_64 64bit) - Linux-6.16.12+deb14+1-amd64-x86_64-with-glibc2.41 - OpenSSL 3.5.4 30 Sep 2025 - glibc 2.41
[debug] exe versions: ffmpeg 8.0, ffprobe 8.0
[debug] Proxy map: {}
[twitch:vod] 2578729410: Downloading stream metadata GraphQL
ERROR: An extractor error has occurred. (caused by KeyError('data')); please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.
Traceback (most recent call last):
  File "/home/user/bin/youtube-dl/youtube_dl/extractor/common.py", line 573, in extract
    ie_result = self._real_extract(url)
  File "/home/user/bin/youtube-dl/youtube_dl/extractor/twitch.py", line 332, in _real_extract
    info = self._download_info(vod_id)
  File "/home/user/bin/youtube-dl/youtube_dl/extractor/twitch.py", line 255, in _download_info
    data = self._download_gql(
           ~~~~~~~~~~~~~~~~~~~
    ...<6 lines>...
        }],
        ~~~
        'Downloading stream metadata GraphQL')[0]['data']
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'data'
Traceback (most recent call last):
  File "/home/user/bin/youtube-dl/youtube_dl/extractor/common.py", line 573, in extract
    ie_result = self._real_extract(url)
  File "/home/user/bin/youtube-dl/youtube_dl/extractor/twitch.py", line 332, in _real_extract
    info = self._download_info(vod_id)
  File "/home/user/bin/youtube-dl/youtube_dl/extractor/twitch.py", line 255, in _download_info
    data = self._download_gql(
           ~~~~~~~~~~~~~~~~~~~
    ...<6 lines>...
        }],
        ~~~
        'Downloading stream metadata GraphQL')[0]['data']
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 886, in wrapper
    return func(self, *args, **kwargs)
  File "/home/user/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 982, in __extract_info
    ie_result = ie.extract(url)
  File "/home/user/bin/youtube-dl/youtube_dl/extractor/common.py", line 586, in extract
    raise ExtractorError('An extractor error has occurred.', cause=e)
youtube_dl.utils.ExtractorError: An extractor error has occurred. (caused by KeyError('data')); please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose option and include the complete output.

Description

Youtube-dl no longer works with twitch due to the forementioned error. I noticed it a few days ago, because I use it in a bash script to get the playable urls of a few videos and it was returning a blank file.

Relevant commits from yt-dlp, which prove that extraction from twitch did change for everything it hosts.
github.com/yt-dlp/yt-dlp@7eff676183
github.com/yt-dlp/yt-dlp@b46c572b26
github.com/yt-dlp/yt-dlp@cb78440e46

Originally created by @pitsi on GitHub (Nov 14, 2025). ## Checklist - [x] I'm reporting a broken site support - [x] I've verified that I'm running youtube-dl version **2025.10.19** - [x] I've checked that all provided URLs are alive and playable in a browser - [x] I've checked that all URLs and arguments with special characters are properly quoted or escaped - [x] I've searched the bugtracker for similar issues including closed ones ## Verbose log ``` $ youtube-dl -Fv https://m.twitch.tv/videos/2578729410 [debug] System config: [] [debug] User config: ['--no-cache-dir', '--user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'] [debug] Custom config: [] [debug] Command-line args: ['-Fv', 'https://m.twitch.tv/videos/2578729410'] [debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8 [debug] youtube-dl version 2025.10.19 [1e109aaee] (single file build) [debug] ** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl. [debug] ** For support, visit the main site. [debug] Python 3.13.9 (CPython x86_64 64bit) - Linux-6.16.12+deb14+1-amd64-x86_64-with-glibc2.41 - OpenSSL 3.5.4 30 Sep 2025 - glibc 2.41 [debug] exe versions: ffmpeg 8.0, ffprobe 8.0 [debug] Proxy map: {} [twitch:vod] 2578729410: Downloading stream metadata GraphQL ERROR: An extractor error has occurred. (caused by KeyError('data')); please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose option and include the complete output. Traceback (most recent call last): File "/home/user/bin/youtube-dl/youtube_dl/extractor/common.py", line 573, in extract ie_result = self._real_extract(url) File "/home/user/bin/youtube-dl/youtube_dl/extractor/twitch.py", line 332, in _real_extract info = self._download_info(vod_id) File "/home/user/bin/youtube-dl/youtube_dl/extractor/twitch.py", line 255, in _download_info data = self._download_gql( ~~~~~~~~~~~~~~~~~~~ ...<6 lines>... }], ~~~ 'Downloading stream metadata GraphQL')[0]['data'] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ KeyError: 'data' Traceback (most recent call last): File "/home/user/bin/youtube-dl/youtube_dl/extractor/common.py", line 573, in extract ie_result = self._real_extract(url) File "/home/user/bin/youtube-dl/youtube_dl/extractor/twitch.py", line 332, in _real_extract info = self._download_info(vod_id) File "/home/user/bin/youtube-dl/youtube_dl/extractor/twitch.py", line 255, in _download_info data = self._download_gql( ~~~~~~~~~~~~~~~~~~~ ...<6 lines>... }], ~~~ 'Downloading stream metadata GraphQL')[0]['data'] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ KeyError: 'data' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/user/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 886, in wrapper return func(self, *args, **kwargs) File "/home/user/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 982, in __extract_info ie_result = ie.extract(url) File "/home/user/bin/youtube-dl/youtube_dl/extractor/common.py", line 586, in extract raise ExtractorError('An extractor error has occurred.', cause=e) youtube_dl.utils.ExtractorError: An extractor error has occurred. (caused by KeyError('data')); please report this issue on https://github.com/ytdl-org/youtube-dl/issues , using the appropriate issue template. Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose option and include the complete output. ``` ## Description Youtube-dl no longer works with twitch due to the forementioned error. I noticed it a few days ago, because I use it in a bash script to get the playable urls of a few videos and it was returning a blank file. Relevant commits from yt-dlp, which prove that extraction from twitch did change for everything it hosts. https://github.com/yt-dlp/yt-dlp/commit/7eff676183518175ce495ae63291c89f9b39f02a https://github.com/yt-dlp/yt-dlp/commit/b46c572b26be15683584102c5fb7e7bfde0c9821 https://github.com/yt-dlp/yt-dlp/commit/cb78440e468608fd55546280b537387d375335f2
Author
Owner

@dirkf commented on GitHub (Nov 16, 2025):

Thanks, I noticed that. We'll have to update the extractor here.

@dirkf commented on GitHub (Nov 16, 2025): Thanks, I noticed that. We'll have to update the extractor here.
Author
Owner

@dirkf commented on GitHub (Nov 18, 2025):

The yt-dlp extractor uses chapter extraction that we don't yet fully replicate, but it's easy to add.

As a non-user of Twitch, I'd appreciate guidance on these other points for the extractor:

  1. the yt-dlp extractor extracts storyboards, which we do not support as a format type (mhtml) -- are these essential?
  2. the yt-dlp extractor has some playlist tests annotated with #TODO where no results are now being returned -- can a Twitch user confirm what appears to me, that the problem URLs either need login or use queries that no longer return any results?

Apart from point 1 and skipping the tests in point 2, the back-port seems OK.

@dirkf commented on GitHub (Nov 18, 2025): The _yt-dlp_ extractor uses chapter extraction that we don't yet fully replicate, but it's easy to add. As a non-user of Twitch, I'd appreciate guidance on these other points for the extractor: 1. the _yt-dlp_ extractor extracts storyboards, which we do not support as a format type (`mhtml`) -- are these essential? 2. the _yt-dlp_ extractor has some playlist tests annotated with `#TODO` where no results are now being returned -- can a Twitch user confirm what appears to me, that the problem URLs either need login or use queries that no longer return any results? Apart from point 1 and skipping the tests in point 2, the back-port seems OK.
Author
Owner

@pitsi commented on GitHub (Nov 18, 2025):

If you ask me, I only care about vods, livestreams and this bit, if you consider it a playlist.
$ youtube-dl --get-title --playlist-end 2 "https://www.twitch.tv/eslcs/videos?filter=archives&sort=time"

e.g with yt-dlp, because the above returns nothing

$ yt-dlp --get-title --playlist-end 2 "https://www.twitch.tv/eslcs/videos?filter=archives&sort=time"
RERUN: MOUZ vs. Falcons - IEM Chengdu 2025 - Third-Place Decider 2025-11-18 18:26
Full Broadcast: ESL Challenger League Season 50 - EU - Day 36

@pitsi commented on GitHub (Nov 18, 2025): If you ask me, I only care about vods, livestreams and this bit, if you consider it a playlist. `$ youtube-dl --get-title --playlist-end 2 "https://www.twitch.tv/eslcs/videos?filter=archives&sort=time"` e.g with yt-dlp, because the above returns nothing ``` $ yt-dlp --get-title --playlist-end 2 "https://www.twitch.tv/eslcs/videos?filter=archives&sort=time" RERUN: MOUZ vs. Falcons - IEM Chengdu 2025 - Third-Place Decider 2025-11-18 18:26 Full Broadcast: ESL Challenger League Season 50 - EU - Day 36 ```
Author
Owner

@dirkf commented on GitHub (Nov 19, 2025):

Currently, the back-port gives:

$ python -m youtube_dl --get-title --playlist-end 2 "https://www.twitch.tv/eslcs/videos?filter=archives&sort=time"
WARNING: Unable to download JSON metadata: HTTP Error 403: Forbidden
RERUN: MOUZ vs. Falcons - IEM Chengdu 2025 - Third-Place Decider
LIVE: PARIVISION VS BCGame Esports - ESL Challenger League - Season 50 EU
$ 

The warning comes from this:

[twitch:vod] 2621936499: Downloading storyboard metadata JSON
WARNING: Unable to download JSON metadata: HTTP Error 403: Forbidden

The 403 storyboard is https://d3fi1amfgojobc.cloudfront.net/b78871e00802007252e1_eslcs_315345350501_1763497088/storyboards/2621936499-info.json.

So skipping storyboards would skip that error too.

Hacking the new yt-dlp extractor into last year's yt-dlp gives the same result.

@dirkf commented on GitHub (Nov 19, 2025): Currently, the back-port gives: ```console $ python -m youtube_dl --get-title --playlist-end 2 "https://www.twitch.tv/eslcs/videos?filter=archives&sort=time" WARNING: Unable to download JSON metadata: HTTP Error 403: Forbidden RERUN: MOUZ vs. Falcons - IEM Chengdu 2025 - Third-Place Decider LIVE: PARIVISION VS BCGame Esports - ESL Challenger League - Season 50 EU $ ``` The warning comes from this: ``` [twitch:vod] 2621936499: Downloading storyboard metadata JSON WARNING: Unable to download JSON metadata: HTTP Error 403: Forbidden ``` The 403 storyboard is https://d3fi1amfgojobc.cloudfront.net/b78871e00802007252e1_eslcs_315345350501_1763497088/storyboards/2621936499-info.json. So skipping storyboards would skip that error too. Hacking the new _yt-dlp_ extractor into last year's _yt-dlp_ gives the same result.
Author
Owner

@pitsi commented on GitHub (Nov 19, 2025):

Yea, it gives that 403 error here too, but I ommited it. I think the url that causes it is actually a live stream that has not ended yet. Like watching a football game from the start, as if it was a vod, while the game is still being played. You can skip forward up until it reaches a point that it is no longer available.

At least this is what happens on the twitch addon for kodi, which uses twitch's api to work and I have been using for years.

@pitsi commented on GitHub (Nov 19, 2025): Yea, it gives that 403 error here too, but I ommited it. I think the url that causes it is actually a live stream that has not ended yet. Like watching a football game from the start, as if it was a vod, while the game is still being played. You can skip forward up until it reaches a point that it is no longer available. At least this is what happens on the twitch addon for kodi, which uses twitch's api to work and I have been using for years.
Author
Owner

@tinspin commented on GitHub (Dec 2, 2025):

This is now back, seems it's something they turn on/off randomly on the servers.

Back to wasting electricity with bloated browser...

Edit: Twitch fixed their servers again so now it works.

@tinspin commented on GitHub (Dec 2, 2025): This is now back, seems it's something they turn on/off randomly on the servers. Back to wasting electricity with bloated browser... Edit: Twitch fixed their servers again so now it works.
Author
Owner

@joaopa00 commented on GitHub (Dec 13, 2025):

THe problem still occurs for me with the live stream https://www.twitch.tv/tlcredaction

@joaopa00 commented on GitHub (Dec 13, 2025): THe problem still occurs for me with the live stream https://www.twitch.tv/tlcredaction
Author
Owner

@tinspin commented on GitHub (Dec 13, 2025):

Do other streams work? Because for me it's not about what stream, but all of twitch goes offline; maybe it's the node (with bad configuration) that is allocated to me from the load balancer.

For me all streams stopped working for 10 minutes on Friday with the above error.

@tinspin commented on GitHub (Dec 13, 2025): Do other streams work? Because for me it's not about what stream, but all of twitch goes offline; maybe it's the node (with bad configuration) that is allocated to me from the load balancer. For me all streams stopped working for 10 minutes on Friday with the above error.
Author
Owner

@joaopa00 commented on GitHub (Dec 13, 2025):

Other streams do not work either. yt-dlp works.

@joaopa00 commented on GitHub (Dec 13, 2025): Other streams do not work either. yt-dlp works.
Author
Owner

@dirkf commented on GitHub (Dec 13, 2025):

Hence https://github.com/ytdl-org/youtube-dl/issues/33218#issuecomment-3538526460

@dirkf commented on GitHub (Dec 13, 2025): Hence https://github.com/ytdl-org/youtube-dl/issues/33218#issuecomment-3538526460
Author
Owner

@tinspin commented on GitHub (Dec 14, 2025):

So what is the workaround here? Point mpv to yt-dlp?

@tinspin commented on GitHub (Dec 14, 2025): So what is the workaround here? Point mpv to yt-dlp?
Author
Owner

@pitsi commented on GitHub (Dec 14, 2025):

Mpv has been using (the system's) yt-dlp for years, by default.
If you want to change that behavior, you must add something like this in your mpv.conf

$ cat .config/mpv/mpv.conf | grep hook
#script-opts=ytdl_hook-ytdl_path=/home/user/bin/youtube-dl
#script-opts=ytdl_hook-ytdl_path=/home/user/yt-dlp-nightly
@pitsi commented on GitHub (Dec 14, 2025): Mpv has been using (the system's) yt-dlp for years, by default. If you want to change that behavior, you must add something like this in your mpv.conf ``` $ cat .config/mpv/mpv.conf | grep hook #script-opts=ytdl_hook-ytdl_path=/home/user/bin/youtube-dl #script-opts=ytdl_hook-ytdl_path=/home/user/yt-dlp-nightly ```
Author
Owner

@tinspin commented on GitHub (Dec 15, 2025):

Yes, I already have that and use dlp and it also fails.

Maybe I need a more recent build? The one I use is from Nov 12.

@tinspin commented on GitHub (Dec 15, 2025): Yes, I already have that and use dlp and it also fails. Maybe I need a more recent build? The one I use is from Nov 12.
Author
Owner

@dirkf commented on GitHub (Dec 15, 2025):

Based on the suggestions in OP, my WIP extractor replicates what yt-dlp has, so it will presumably fail in the same way. The yt-dlp extractor was last updated 2025-11-11; you can check if that was included in the 2025-11-12 build.

You could try to provoke the same problem with yt-dlp CLI and follow the issue reporting procedure there.

@dirkf commented on GitHub (Dec 15, 2025): Based on the suggestions in OP, my WIP extractor replicates what _yt-dlp_ has, so it will presumably fail in the same way. The _yt-dlp_ extractor was last updated 2025-11-11; you can check if that was included in the 2025-11-12 build. You could try to provoke the same problem with _yt-dlp_ CLI and follow the issue reporting procedure [there](https://github.com/yt-dlp/yt-dlp/issues).
Author
Owner

@joaopa00 commented on GitHub (Dec 17, 2025):

No problem for me to download videos from twitch with yt-dlp --version
2025.09.23

@joaopa00 commented on GitHub (Dec 17, 2025): No problem for me to download videos from twitch with yt-dlp --version 2025.09.23
Author
Owner

@tinspin commented on GitHub (Jan 5, 2026):

Problem came back on twitch today, latest yt-dlp (12/08) fixes it! But I cannot remember how I configed mpv on Windows... but replacing the yt-dlp.exe in the mpv.exe path fixes it...

@tinspin commented on GitHub (Jan 5, 2026): Problem came back on twitch today, latest yt-dlp (12/08) fixes it! But I cannot remember how I configed mpv on Windows... but replacing the yt-dlp.exe in the mpv.exe path fixes it...
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#27176
No description provided.