1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-03-09 12:50:23 -05:00

[ie/instagram] Improve it more

Authored by: bashonly
This commit is contained in:
bashonly 2025-02-19 01:57:22 -06:00
parent e3d089ba9d
commit e0e481e668
No known key found for this signature in database
GPG key ID: 783F096F253D15B0

View file

@ -8,6 +8,7 @@
from ..networking.exceptions import HTTPError
from ..utils import (
ExtractorError,
bug_reports_message,
decode_base_n,
encode_base_n,
filter_dict,
@ -474,7 +475,13 @@ def _real_extract(self, url):
self.raise_login_required(error)
elif error:
raise ExtractorError(error, expected=True)
raise ExtractorError('Instagram sent empty media response')
elif len(video_id) > 28:
# It's a private post (video_id == shortcode + 28 extra characters)
self.raise_login_required()
raise ExtractorError(
'Instagram sent empty media response; check if this post is '
'accessible in your browser without being logged-in. If it is'
f'{bug_reports_message(before=",")}', expected=True)
media.update(xdt_shortcode_media)