1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-05-13 16:35:43 -05:00

[IG] Allow integer media IDs

This value may already be in its integer form thus it will not be necessary to parse it out of a string
This commit is contained in:
Chris Ellsworth 2025-02-13 12:19:50 -08:00
parent 6ca23ffaa4
commit 8e8dbb408f

View file

@ -28,7 +28,8 @@
def _pk_to_id(media_id):
"""Source: https://stackoverflow.com/questions/24437823/getting-instagram-post-url-from-media-id"""
return encode_base_n(int(media_id.split('_')[0]), table=_ENCODING_CHARS)
pk = int(str(media_id).split('_')[0])
return encode_base_n(pk, table=_ENCODING_CHARS)
def _id_to_pk(shortcode):