Skip to content
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

Intermittent "Incomplete data received" errors when downloading YouTube playlist JSON #8206

Closed
10 of 11 tasks
stuartlangridge opened this issue Sep 25, 2023 · 24 comments
Closed
10 of 11 tasks
Labels
external issue Issue with an external tool site-bug Issue with a specific website

Comments

@stuartlangridge
Copy link

stuartlangridge commented Sep 25, 2023

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

United Kingdom

Provide a description that is worded well enough to be understood

When running the following command:

yt-dlp -vU --dump-single-json --flat-playlist PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf

it sometimes succeeds, and sometimes fails with yt_dlp.utils.ExtractorError: Incomplete data received as can be seen below. It does not always fail; this error seems to be intermittent. It is also not specific to this playlist; I have seen it fail with the same error on other playlists as well. (The specific playlist mentioned above is https://www.youtube.com/playlist?list=PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf for convenience of linking; it opens in a browser successfully.) In running this command 5 times, it succeeded twice and failed three times.

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['-vU', '--dump-single-json', '--flat-playlist', 'PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.09.24 [088add956] (zip)
[debug] Python 3.10.12 (CPython x86_64 64bit) - Linux-5.15.0-84-generic-x86_64-with-glibc2.35 (OpenSSL 3.0.2 15 Mar 2022, glibc 2.35)
[debug] exe versions: ffmpeg 4.4.2 (setts), ffprobe 4.4.2
[debug] Optional libraries: Cryptodome-3.11.0, brotli-1.0.9, certifi-2020.06.20, mutagen-1.45.1, pyxattr-0.7.2, secretstorage-3.3.1, sqlite3-3.37.2
[debug] Proxy map: {}
[debug] Loaded 1886 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.09.24, Current version: stable@2023.09.24
Current Build Hash: 9c32c2f215a58c33369ec6105b7e97871905b8d757407bea2bc71d265f9f6cfe
yt-dlp is up to date (stable@2023.09.24)
[youtube:playlist] Extracting URL: PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf
[youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf
[youtube:tab] PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf: Downloading webpage
[youtube:tab] PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf: Redownloading playlist API JSON with unavailable videos
[download] Downloading playlist: Exandria Unlimited: Kymal
[youtube:tab] PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (1/3)...
[youtube:tab] PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (2/3)...
[youtube:tab] PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (3/3)...
[youtube:tab] PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf page 1: Downloading API JSON
ERROR: Incomplete data received
Traceback (most recent call last):
  File "/home/aquarius/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 1567, in wrapper
    return func(self, *args, **kwargs)
  File "/home/aquarius/bin/yt-dlp/yt_dlp/utils/_utils.py", line 2427, in <lambda>
  File "/home/aquarius/bin/yt-dlp/yt_dlp/utils/_utils.py", line 2195, in __getitem__
  File "/home/aquarius/bin/yt-dlp/yt_dlp/extractor/youtube.py", line 4933, in _entries
    response = self._extract_response(
  File "/home/aquarius/bin/yt-dlp/yt_dlp/extractor/youtube.py", line 944, in _extract_response
    for retry in self.RetryManager():
  File "/home/aquarius/bin/yt-dlp/yt_dlp/utils/_utils.py", line 5112, in __iter__
  File "/home/aquarius/bin/yt-dlp/yt_dlp/extractor/common.py", line 3760, in _error_or_warning
    RetryManager.report_retry(
  File "/home/aquarius/bin/yt-dlp/yt_dlp/utils/_utils.py", line 5120, in report_retry
yt_dlp.utils.ExtractorError: Incomplete data received

[youtube:tab] Playlist Exandria Unlimited: Kymal: Downloading 3 items of 2
[debug] The information of all playlist entries will be held in memory
[download] Downloading item 1 of 3
[download] Downloading item 2 of 3
[download] Finished downloading playlist: Exandria Unlimited: Kymal
{"id": "PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf", "title": "Exandria Unlimited: Kymal", "availability": "public", "channel_follower_count": null, "description": "", "tags": [], "thumbnails": [{"url": "https://i.ytimg.com/vi/l7SKWVq-jIg/hqdefault.jpg?sqp=-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ==&rs=AOn4CLBT32UGrM2Tqpe7s33qdytjS7P9Zg", "height": 94, "width": 168, "id": "0", "resolution": "168x94"}, {"url": "https://i.ytimg.com/vi/l7SKWVq-jIg/hqdefault.jpg?sqp=-oaymwEWCMQBEG5IWvKriqkDCQgBFQAAiEIYAQ==&rs=AOn4CLCmcD3sfXb7oMv_RafJN03k7Zx70Q", "height": 110, "width": 196, "id": "1", "resolution": "196x110"}, {"url": "https://i.ytimg.com/vi/l7SKWVq-jIg/hqdefault.jpg?sqp=-oaymwEXCPYBEIoBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLAbstB9qmaKsecRtnoPYyVadAwn6w", "height": 138, "width": 246, "id": "2", "resolution": "246x138"}, {"url": "https://i.ytimg.com/vi/l7SKWVq-jIg/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLDKX9VuKXlRu6DyBITHEYunFNvC9w", "height": 188, "width": 336, "id": "3", "resolution": "336x188"}], "modified_date": "20220405", "view_count": 145063, "playlist_count": 2, "channel": "Critical Role", "channel_id": "UCpXBGqwsBkpvcYjsJBQ7LEQ", "uploader_id": "@criticalrole", "uploader": "Critical Role", "channel_url": "https://www.youtube.com/channel/UCpXBGqwsBkpvcYjsJBQ7LEQ", "uploader_url": "https://www.youtube.com/@criticalrole", "_type": "playlist", "entries": [{"_type": "url", "ie_key": "Youtube", "id": "l7SKWVq-jIg", "url": "https://www.youtube.com/watch?v=l7SKWVq-jIg", "title": "Exandria Unlimited: Kymal | Part 1", "description": null, "duration": 15966, "channel_id": "UCpXBGqwsBkpvcYjsJBQ7LEQ", "channel": "Critical Role", "channel_url": "https://www.youtube.com/channel/UCpXBGqwsBkpvcYjsJBQ7LEQ", "uploader": "Critical Role", "uploader_id": "@criticalrole", "uploader_url": "https://www.youtube.com/@criticalrole", "thumbnails": [{"url": "https://i.ytimg.com/vi/l7SKWVq-jIg/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLCTHrIg2dsWhdhBUczkJ6YCtIvWuA", "height": 94, "width": 168}, {"url": "https://i.ytimg.com/vi/l7SKWVq-jIg/hqdefault.jpg?sqp=-oaymwEbCMQBEG5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLAPPsyHJ_zLbINH5Bj_EizUd_JBFA", "height": 110, "width": 196}, {"url": "https://i.ytimg.com/vi/l7SKWVq-jIg/hqdefault.jpg?sqp=-oaymwEcCPYBEIoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBLXJCGJa__hs4kKBdezOgJXLrdgA", "height": 138, "width": 246}, {"url": "https://i.ytimg.com/vi/l7SKWVq-jIg/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBMxPROxnMFhsLAEHXBwE-ArJrZFg", "height": 188, "width": 336}], "timestamp": null, "release_timestamp": null, "availability": null, "view_count": 903000, "live_status": null, "channel_is_verified": null, "__x_forwarded_for_ip": null}, {"_type": "url", "ie_key": "Youtube", "id": "E-0bSdoPj5o", "url": "https://www.youtube.com/watch?v=E-0bSdoPj5o", "title": "Exandria Unlimited: Kymal | Part 2", "description": null, "duration": 17645, "channel_id": "UCpXBGqwsBkpvcYjsJBQ7LEQ", "channel": "Critical Role", "channel_url": "https://www.youtube.com/channel/UCpXBGqwsBkpvcYjsJBQ7LEQ", "uploader": "Critical Role", "uploader_id": "@criticalrole", "uploader_url": "https://www.youtube.com/@criticalrole", "thumbnails": [{"url": "https://i.ytimg.com/vi/E-0bSdoPj5o/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLCtABgAEqt2uIMHBNmGOl-QYtewSg", "height": 94, "width": 168}, {"url": "https://i.ytimg.com/vi/E-0bSdoPj5o/hqdefault.jpg?sqp=-oaymwEbCMQBEG5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLA8CX3O2ydFXuzOF7XerNu8nzjgUw", "height": 110, "width": 196}, {"url": "https://i.ytimg.com/vi/E-0bSdoPj5o/hqdefault.jpg?sqp=-oaymwEcCPYBEIoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCGeEicO2uo1HtD_pW5PnqYsWsKQw", "height": 138, "width": 246}, {"url": "https://i.ytimg.com/vi/E-0bSdoPj5o/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCOwRmzk5veeyUtggdMcxjm2xHrcw", "height": 188, "width": 336}], "timestamp": null, "release_timestamp": null, "availability": null, "view_count": 561000, "live_status": null, "channel_is_verified": null, "__x_forwarded_for_ip": null}, null], "extractor_key": "YoutubeTab", "extractor": "youtube:tab", "webpage_url": "https://www.youtube.com/playlist?list=PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf", "original_url": "PL1tiwbzkOjQwgI-BPd0nujKfVkCag3xFf", "webpage_url_basename": "playlist", "webpage_url_domain": "youtube.com", "requested_entries": [1, 2, 3], "epoch": 1695678694, "__files_to_move": {}, "_version": {"version": "2023.09.24", "current_git_head": null, "release_git_head": "088add9567d39b758737e4299a0e619fd89d2e8f", "repository": "yt-dlp/yt-dlp"}}
@stuartlangridge stuartlangridge added site-bug Issue with a specific website triage Untriaged issue labels Sep 25, 2023
@bashonly
Copy link
Member

I can intermittently reproduce the errors. Today was the first I've noticed them

@fromonesource
Copy link

Seeing same here on latest release

@bashonly
Copy link
Member

Note: I am experiencing this on 2023.07.06 as well; not a regression

@Stefomat
Copy link

I can also reproduce this error. I last tested with two playlists.
https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH
https://www.youtube.com/playlist?list=PLGWGc5dfbzn_uSMm5jfeaPcpDWo5olbN7

What I have observed is that yt-dlp claims that when the error occurs there is one more video in the playlist than there really is.

Without error, 23 videos in playlist, correct number

user@host:~# yt-dlp --flat-playlist https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH
[youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH: Downloading webpage
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH: Redownloading playlist API JSON with unavailable videos
[download] Downloading playlist: Build a 65c02-based computer from scratch
[youtube:tab] Playlist Build a 65c02-based computer from scratch: Downloading 23 items of 23
[download] Downloading item 1 of 23
[download] Downloading item 2 of 23
[download] Downloading item 3 of 23
[download] Downloading item 4 of 23
[download] Downloading item 5 of 23
[download] Downloading item 6 of 23
[download] Downloading item 7 of 23
[download] Downloading item 8 of 23
[download] Downloading item 9 of 23
[download] Downloading item 10 of 23
[download] Downloading item 11 of 23
[download] Downloading item 12 of 23
[download] Downloading item 13 of 23
[download] Downloading item 14 of 23
[download] Downloading item 15 of 23
[download] Downloading item 16 of 23
[download] Downloading item 17 of 23
[download] Downloading item 18 of 23
[download] Downloading item 19 of 23
[download] Downloading item 20 of 23
[download] Downloading item 21 of 23
[download] Downloading item 22 of 23
[download] Downloading item 23 of 23
[download] Finished downloading playlist: Build a 65c02-based computer from scratch

With error, supposedly 24 videos in playlist, wrong number

user@host:~# yt-dlp --flat-playlist https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH
[youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH: Downloading webpage
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH: Redownloading playlist API JSON with unavailable videos
[download] Downloading playlist: Build a 65c02-based computer from scratch
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (1/3)...
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (2/3)...
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (3/3)...
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH page 1: Downloading API JSON
ERROR: Incomplete data received
[youtube:tab] Playlist Build a 65c02-based computer from scratch: Downloading 24 items of 23
[download] Downloading item 1 of 24
[download] Downloading item 2 of 24
[download] Downloading item 3 of 24
[download] Downloading item 4 of 24
[download] Downloading item 5 of 24
[download] Downloading item 6 of 24
[download] Downloading item 7 of 24
[download] Downloading item 8 of 24
[download] Downloading item 9 of 24
[download] Downloading item 10 of 24
[download] Downloading item 11 of 24
[download] Downloading item 12 of 24
[download] Downloading item 13 of 24
[download] Downloading item 14 of 24
[download] Downloading item 15 of 24
[download] Downloading item 16 of 24
[download] Downloading item 17 of 24
[download] Downloading item 18 of 24
[download] Downloading item 19 of 24
[download] Downloading item 20 of 24
[download] Downloading item 21 of 24
[download] Downloading item 22 of 24
[download] Downloading item 23 of 24
[download] Finished downloading playlist: Build a 65c02-based computer from scratch

@Stefomat
Copy link

To add to my comment, I tested with version 2023.07.06 and 2023.09.24

@VRSquid
Copy link

VRSquid commented Sep 27, 2023

I've also been experiencing this error with playlists as of the last day or so on 2023.07.06

@coletdjnz
Copy link
Member

coletdjnz commented Sep 27, 2023

I can also reproduce this error. I last tested with two playlists.
https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH
https://www.youtube.com/playlist?list=PLGWGc5dfbzn_uSMm5jfeaPcpDWo5olbN7

What I have observed is that yt-dlp claims that when the error occurs there is one more video in the playlist than there really is.

Without error, 23 videos in playlist, correct number

user@host:~# yt-dlp --flat-playlist https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH
[youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH: Downloading webpage
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH: Redownloading playlist API JSON with unavailable videos
[download] Downloading playlist: Build a 65c02-based computer from scratch
[youtube:tab] Playlist Build a 65c02-based computer from scratch: Downloading 23 items of 23
[download] Downloading item 1 of 23
[download] Downloading item 2 of 23
[download] Downloading item 3 of 23
[download] Downloading item 4 of 23
[download] Downloading item 5 of 23
[download] Downloading item 6 of 23
[download] Downloading item 7 of 23
[download] Downloading item 8 of 23
[download] Downloading item 9 of 23
[download] Downloading item 10 of 23
[download] Downloading item 11 of 23
[download] Downloading item 12 of 23
[download] Downloading item 13 of 23
[download] Downloading item 14 of 23
[download] Downloading item 15 of 23
[download] Downloading item 16 of 23
[download] Downloading item 17 of 23
[download] Downloading item 18 of 23
[download] Downloading item 19 of 23
[download] Downloading item 20 of 23
[download] Downloading item 21 of 23
[download] Downloading item 22 of 23
[download] Downloading item 23 of 23
[download] Finished downloading playlist: Build a 65c02-based computer from scratch

With error, supposedly 24 videos in playlist, wrong number

user@host:~# yt-dlp --flat-playlist https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH
[youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH: Downloading webpage
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH: Redownloading playlist API JSON with unavailable videos
[download] Downloading playlist: Build a 65c02-based computer from scratch
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (1/3)...
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (2/3)...
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (3/3)...
[youtube:tab] PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH page 1: Downloading API JSON
ERROR: Incomplete data received
[youtube:tab] Playlist Build a 65c02-based computer from scratch: Downloading 24 items of 23
[download] Downloading item 1 of 24
[download] Downloading item 2 of 24
[download] Downloading item 3 of 24
[download] Downloading item 4 of 24
[download] Downloading item 5 of 24
[download] Downloading item 6 of 24
[download] Downloading item 7 of 24
[download] Downloading item 8 of 24
[download] Downloading item 9 of 24
[download] Downloading item 10 of 24
[download] Downloading item 11 of 24
[download] Downloading item 12 of 24
[download] Downloading item 13 of 24
[download] Downloading item 14 of 24
[download] Downloading item 15 of 24
[download] Downloading item 16 of 24
[download] Downloading item 17 of 24
[download] Downloading item 18 of 24
[download] Downloading item 19 of 24
[download] Downloading item 20 of 24
[download] Downloading item 21 of 24
[download] Downloading item 22 of 24
[download] Downloading item 23 of 24
[download] Finished downloading playlist: Build a 65c02-based computer from scratch

I don't have time to investigate this rn, but some things to check if anyone wants to:

What's the 24th video in the playlist that yt-dlp extracts? is it the same as the first?

What is the behaviour in the browser with same cookies that is used in yt-dlp that triggers this (i.e same visitor data cookie)?.

This is likely just a minor issue on YouTube's end with some A/B test. Will probably dissapear in the coming weeks. Looks like yt-dlp is getting everything and it's failing on some broken page YouTube responds with at the end of the playlist.

@coletdjnz coletdjnz added the external issue Issue with an external tool label Sep 27, 2023
@fromonesource
Copy link

For anyone hitting this error, are you running over a VPN? I noticed that running 2023.09.24 on VPN produces the errors but running same version through local ISP succeeds.

@ErrorFlynn
Copy link

I'm getting this error too. The JSON key playlist_count has the correct value, but the entries array has an extra element at the end (the element has a null value).

If the error happens when downloading the playlist, yt-dlp says [youtube:tab] playlist name: Downloading 4 items of 3 (for a playlist with 3 items). But when it comes to download the 4th (nonexistent) item, it just says [download] Finished downloading playlist: playlist name. The last item it downloaded was 3 of 4.

@VRSquid
Copy link

VRSquid commented Sep 27, 2023

For anyone hitting this error, are you running over a VPN? I noticed that running 2023.09.24 on VPN produces the errors but running same version through local ISP succeeds.

No, I'm running my commands through my local isp when observing the issue.

@sourcecodemage
Copy link

sourcecodemage commented Sep 28, 2023

I'm using the yt-dlp Python package v2023.9.24 in my python video downloader script, and I am getting this error "ERROR: Incomplete data received" on what appears to be the last entry of certain playlists. I haven't been able to isolate it what is causing it, but I added a try/catch block around it to ignore the exception, so that it at least runs.

        ydl_opts = {
            'cookiefile': cookies_file,
            'getcomments': False,
            'download_archive': "youtube_download_archive.log",
            'extract_flat': True,               
            'match_filter': utils.match_filter_func("!is_live"),
            'match_filter': utils.match_filter_func("!was_live"),
            'no_warnings': True,
            'quiet': False,
            'skip_download': True,
            'ignoreerrors': True,
        }
        for url in url_list:
            with YoutubeDL(ydl_opts) as ydl:
                result = ydl.extract_info(url, download=False, process=False)
                if not result:
                    continue
                    # print(f"{url} has already been recorded in the archive.")
                elif 'entries' in result:
                    good_entries = []
                    try:
                        for entry in result['entries']:
                            good_entries.append(entry)
                    except Exception:
                        pass
                    video_infos.extend( entry for entry in good_entries if not entry['id'] in library_vids and not "Deleted" in entry['title'] and not "[Private video]" in entry['title'] )

When it fails, it fails on " for entry in result['entries']:" line so there is some issue with item in the list.

And example list is https://www.youtube.com/playlist?list=PLR7yrLMHm11X6-M_usCj5H-gdstyWNLXQ . I stepped though the "for url in url_list" loop when it got to the last entry in the playlist, it threw the exception.

@gunir
Copy link

gunir commented Sep 28, 2023

Same, affects MPV too:

mpv https://www.youtube.com/playlist?list=PLVM1qRtVEeErISdPLpYEc53XEHU5m34cl
[ytdl_hook] ERROR: Incomplete data received
[ytdl_hook] youtube-dl failed: unexpected error occurred
Failed to recognize file format.

Hopefully it will be fixed soon.

@coletdjnz coletdjnz added needs-investigating Needs research, information is welcome and removed triage Untriaged issue labels Sep 28, 2023
@meoyawn
Copy link

meoyawn commented Sep 28, 2023

For anyone hitting this error, are you running over a VPN? I noticed that running 2023.09.24 on VPN produces the errors but running same version through local ISP succeeds.

happens for me both with and without proxy servers

also, this playlist reliably fails with "Incomplete data received" every time

yt-dlp "https://www.youtube.com/playlist?list=PLdJo8g6QW5jbOPhBUj5ferM3FDkmmTHnp" --flat-playlist -J

@coletdjnz
Copy link
Member

Note that this issue is non-fatal, so everything should still work as expected by default.

If you are embedding yt-dlp, set ignoreerrors to true.

@GunGunGun
Copy link

GunGunGun commented Sep 29, 2023

Note that this issue is non-fatal, so everything should still work as expected by default.

If you are embedding yt-dlp, set ignoreerrors to true.

In MPV case, setting ytdl-raw-options-append=ignore-errors= in mpv.conf doesn't seem to do anything, and yeah yt-dlp do use --ignore-errors.

Test case:

mpv https://www.youtube.com/playlist?list=PLVM1qRtVEeErISdPLpYEc53XEHU5m34cl
[ytdl_hook] ERROR: Incomplete data received
[ytdl_hook] youtube-dl failed: unexpected error occurred

yt-dlp's command line:
"yt-dlp" --no-warnings -J --flat-playlist --sub-format ass/srt/best --format bestvideo+bestaudio/best --quiet --ignore-no-formats-error --yes-playlist --extractor-args youtube:player_skip=webpage,configs,js;player_client=android,web;lang=vi,en --flat-playlist --ignore-errors -- https://www.youtube.com/playlist?list=PLVM1qRtVEeErISdPLpYEc53XEHU5m34cl

I tried to send all kind of error suppressings but the only success was to modify ytdl_hook.lua as in mpv-player/mpv#12511

@coletdjnz
Copy link
Member

coletdjnz commented Sep 29, 2023

Doing some digging, this appears to be a bug on YouTube's end, but we can take some steps in yt-dlp to handle it better.

In YouTube, if you own the playlist, you get a "recommended videos shelf" at the end of the playlist. It seems like yt-dlp tries to request this page (which is expected given the structure), but doesn't extract any videos (the traverser doesn't support the path required)

However, it seems like in a recent YouTube update they are adding this continuation for the recommended videos shelf to any playlist - even if you don't own it. This seems to be a bug on their end since it never returns with any videos/data in this case. You can see this for yourself in the browser - when you load a 1 page playlist that is not your own, there is a divider at the end and there is a spinner for a moment as it tries loads this shelf that has no videos/data.

image

What I'm thinking of doing:

  • Make Incomplete Data error a warning by default, with an extractor arg toggle to make it an error.
    • This will mean we will still get an Incomplete Data warning for this issue until YouTube fixes their backend.
      - Add a guard to block extraction of recommended videos shelf (after the page is requested) so we don't accidently extract it if we were to extend our traversal support in the future. not necessary atm

@gothicVI
Copy link

gothicVI commented Oct 2, 2023

Fails for me as well with the very first request:

import yt_dlp
ydl_opts: dict = {
    'no_warnings': True,
    'quiet': True,
}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
    ydl.extract_info('https://www.youtube.com/playlist?list=PL-osiE80TeTsWmV9i9c58mdDCSskIFdDS', download=False)

ERROR: Incomplete data received
Traceback (most recent call last):
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1567, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/utils/_utils.py", line 2427, in <lambda>
    return type(self.ydl)._handle_extraction_exceptions(lambda _, i: self._entries[i])(self.ydl, i)
                                                                     ~~~~~~~~~~~~~^^^
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/utils/_utils.py", line 2195, in __getitem__
    self._cache.extend(itertools.islice(self._iterable, n))
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/extractor/youtube.py", line 4933, in _entries
    response = self._extract_response(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/extractor/youtube.py", line 944, in _extract_response
    for retry in self.RetryManager():
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/utils/_utils.py", line 5112, in __iter__
    self.error_callback(self.error, self.attempt, self.retries)
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 3760, in _error_or_warning
    RetryManager.report_retry(
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/utils/_utils.py", line 5120, in report_retry
    raise e
yt_dlp.utils.ExtractorError: Incomplete data received

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1556, in extract_info
    return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1567, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1723, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1852, in process_ie_result
    return self.__process_playlist(ie_result, download)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1927, in __process_playlist
    entries = resolved_entries = list(entries)
                                 ^^^^^^^^^^^^^
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/utils/_utils.py", line 738, in _iter
    for x in iterable:
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/utils/_utils.py", line 2392, in get_requested_items
    for i, entry in self[index]:
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/utils/_utils.py", line 2454, in __getitem__
    entry = self._getter(i)
            ^^^^^^^^^^^^^^^
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/utils/_utils.py", line 2427, in get_entry
    return type(self.ydl)._handle_extraction_exceptions(lambda _, i: self._entries[i])(self.ydl, i)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1585, in wrapper
    self.report_error(str(e), e.format_traceback())
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1045, in report_error
    self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
  File "/home/sebastian/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 984, in trouble
    raise DownloadError(message, exc_info)
yt_dlp.utils.DownloadError: ERROR: Incomplete data received

this happens for all of the following playlists:

playlists = [
    'https://www.youtube.com/playlist?list=PL-osiE80TeTsWmV9i9c58mdDCSskIFdDS',
     'https://www.youtube.com/playlist?list=PL-osiE80TeTvipOqomVEeZ1HRrcEvtZB_',
     'https://www.youtube.com/playlist?list=PL5-da3qGB5IBITZj_dYSFqnd_15JgqwA6',
     'https://www.youtube.com/playlist?list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y',
     'https://www.youtube.com/playlist?list=PLB4tvLCynFjSixzoz4z2BGDCWxSW6rCRU',
     "https://www.youtube.com/playlist?list=PLB4tvLCynFjSafzzFD9AP0FrtAXAyMx0m",
     "https://www.youtube.com/playlist?list=PLB4tvLCynFjQGLrVOAzzwHYrCDyrZ03H1",
     "https://www.youtube.com/playlist?list=PLB4tvLCynFjRmGIVW4PuYzdzqH9vk91eR",
     'https://www.youtube.com/playlist?list=PLB4tvLCynFjQjcVftzhNm4As8Dn69PKa1',
     'https://www.youtube.com/playlist?list=PLB4tvLCynFjRQuv9-z0xYe3zoMmbL3sS-',
     "https://www.youtube.com/playlist?list=PLB4tvLCynFjTTSXUmzM_9WVJiVGoX3axg",
     "https://www.youtube.com/playlist?list=PLB4tvLCynFjRvNKAErLi7uduuVTdzbtvd",
     "https://www.youtube.com/playlist?list=PLB4tvLCynFjSzpDc0dvoA_DVRYybrQReu",
     "https://www.youtube.com/playlist?list=PLB4tvLCynFjRJchIJjKiGGhW4rI5kbmql",
     "https://www.youtube.com/playlist?list=PLB4tvLCynFjQpENhUwb-WGNyYUo9F1r1B",
     "https://www.youtube.com/playlist?list=PLB4tvLCynFjQm7ikab5mM4usj3-n3Bf7I",
     "https://www.youtube.com/playlist?list=PLB4tvLCynFjQj4F_rTGoZkX_eF2yovMz9",
     "https://www.youtube.com/playlist?list=PLB4tvLCynFjQSNMgYAdbBokLEPpgPh6iF",
     "https://www.youtube.com/playlist?list=PLB4tvLCynFjSXxsJ-8_2fgej53MyzAKFb",
]

No issues at all when extracting information from channel URLs though.

@Fabian42
Copy link

Fabian42 commented Oct 6, 2023

Can confirm, works with the commit from 3 days ago.

@Fabian42
Copy link

Fabian42 commented Oct 6, 2023

Actually, not quite: It still loops through the "Incomplete data received" warning, wasting time and bandwidth, and with --extractor-retries infinite, it even gets stuck in an infinite loop.

@coletdjnz
Copy link
Member

coletdjnz commented Oct 6, 2023

Actually, not quite: It still loops through the "Incomplete data received" warning, wasting time and bandwidth, and with --extractor-retries infinite, it even gets stuck in an infinite loop.

Don't use --extractor-retries infinite for YouTube

The bug is on YouTube's end and there have been other similar cases where retries don't help. Just that it's not always possible to tell the difference between when they can and not.

@sourcecodemage
Copy link

It appears to be fixed. I removed my workaround and ran yt-dlp-2023.10.7 Python module both in an outside of a debugger without issue. Thank you for the fix!

@kouider01
Copy link

I'm on 2023.11.16 and I get this problem on every Playlist I try to download.
While waiting for YouTube to fix it on their end, is there any workaround in the meantime? Any help is deeply appreciated.
Thanks for this great piece of software.

@Fabian42
Copy link

I used it on a playlist 11 hours ago and it worked. Please create a new bug report with verbose output enabled.

@jidanni
Copy link

jidanni commented Jan 26, 2024

$ yt-dlp --verbose --flat-playlist https://www.youtube.com/playlist?list=PLURD44UorvHSKJi4-cBcrpoaDy5QQ8UuF
[debug] Command-line config: ['--verbose', '--flat-playlist', 'https://www.youtube.com/playlist?list=PLURD44UorvHSKJi4-cBcrpoaDy5QQ8UuF']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8 (dumb), error utf-8 (dumb), screen utf-8 (dumb)
[debug] yt-dlp version stable@2023.12.30 from yt-dlp/yt-dlp [f10589e34] (debian*)
[debug] Python 3.11.7 (CPython x86_64 64bit) - Linux-6.6.13-amd64-x86_64-with-glibc2.37 (OpenSSL 3.1.4 24 Oct 2023, glibc 2.37)
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2023.11.17, mutagen-1.46.0, requests-2.31.0, sqlite3-3.45.0, urllib3-1.26.18, websockets-10.4
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests
[debug] Loaded 1798 extractors
[youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=PLURD44UorvHSKJi4-cBcrpoaDy5QQ8UuF
[youtube:tab] PLURD44UorvHSKJi4-cBcrpoaDy5QQ8UuF: Downloading webpage
[youtube:tab] PLURD44UorvHSKJi4-cBcrpoaDy5QQ8UuF: Redownloading playlist API JSON with unavailable videos
[download] Downloading playlist: Ernest P. Worrell
[youtube:tab] PLURD44UorvHSKJi4-cBcrpoaDy5QQ8UuF page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (1/3)...
[youtube:tab] PLURD44UorvHSKJi4-cBcrpoaDy5QQ8UuF page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (2/3)...
[youtube:tab] PLURD44UorvHSKJi4-cBcrpoaDy5QQ8UuF page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (3/3)...
[youtube:tab] PLURD44UorvHSKJi4-cBcrpoaDy5QQ8UuF page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Giving up after 3 retries
[youtube:tab] Playlist Ernest P. Worrell: Downloading 70 items of 70
[debug] The information of all playlist entries will be held in memory
[download] Downloading item 1 of 70
[download] Downloading item 2 of 70
[download] Downloading item 3 of 70...

aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this issue Apr 21, 2024
yt-dlp#8238)

Closes yt-dlp#8206

Adds `raise_incomplete_data` extractor arg to revert this behaviour and raise an error.

Authored by: coletdjnz
Co-authored-by: Simon Sawicki <contact@grub4k.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external issue Issue with an external tool site-bug Issue with a specific website
Projects
None yet
Development

No branches or pull requests