mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
10.77k stars 889 forks source link

[instagram] support taken_at and imported_taken_at #3428

Open lx30011 opened 1 year ago

lx30011 commented 1 year ago

On the reels endpoint (/v1/feed/reels_media/) Instagram provides the taken_at and imported_taken_at keys.

response["reels_media"][0]["items"][0]["taken_at"]
response["reels_media"][0]["items"][0]["imported_taken_at"]

My understanding of the semantics is this: taken_at is the date the reel was uploaded (and this is what the extractors parse for the date key) imported_taken_at is the modification date of the media file uploaded imported_taken_at doesn't always exist, for example it doesn't exist when the story was created using the Instagram editor (no modification date). It does exist when the reel is an imported media file (modification date exists). It would be nice to parse imported_taken_at as a key for the story and highlights extractors.

lx30011 commented 1 year ago

I don't know why Instagram provides this key (maybe I'm wrong about it being the modification date) but it's been there for years. The instagram-private-api package has first included it in 2019. https://github.com/dilame/instagram-private-api/blob/23bf2b451dbc219eae6ed09fbc1a73a872528093/src/responses/reels-tray.feed.response.ts#L74