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

[IG] Update shortcode handling

As suggested in #12359
This commit is contained in:
Chris Ellsworth 2025-02-20 14:56:22 -08:00
parent 67cc2ff40d
commit 79a427e8b5

View file

@ -33,8 +33,10 @@ def _pk_to_id(media_id):
def _id_to_pk(shortcode):
"""Covert a shortcode to a numeric value"""
return decode_base_n(shortcode[:11], table=_ENCODING_CHARS)
"""Convert a shortcode to a numeric value"""
if len(shortcode) > 28:
shortcode = shortcode[:-28]
return decode_base_n(shortcode, table=_ENCODING_CHARS)
class InstagramBaseIE(InfoExtractor):