mikf / gallery-dl

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

[Instagram] KeyError - 'post_date' #6091

Closed throwaway242685 closed 2 months ago

throwaway242685 commented 2 months ago

I think IG stories are broken, or something... (?)

I'm running gallery-dl with these parameters:

--mtime date
--sleep 2-10
--sleep-request 15-45
--user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0"
-C "C:\0\(IG).txt"
-c "C:\0\0.json"
-o include=stories 

but, I'm getting this error:

[instagram][error] An unexpected error occurred: KeyError - 'post_date'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .

here's the full verbose log:

←[0;37m[gallery-dl][debug] Version 1.27.4-dev←[0m
←[0;37m[gallery-dl][debug] Python 3.8.10 - Windows-7-6.1.7601-SP1←[0m
←[0;37m[gallery-dl][debug] requests 2.32.3 - urllib3 2.2.1←[0m
←[0;37m[gallery-dl][debug] Configuration Files ['C:\\0\\0.json']←[0m
←[0;37m[gallery-dl][debug] Starting DownloadJob for 'https://www.instagram.com/i
d:66315136177'←[0m
←[0;37m[instagram][debug] Using InstagramUserExtractor for 'https://www.instagra
m.com/id:66315136177'←[0m
←[0;37m[instagram][debug] Using InstagramStoriesExtractor for 'https://www.insta
gram.com/stories/id:66315136177/'←[0m
←[0;37m[instagram][debug] Loading cookies from 'C:\0\(IG).txt'←[0m
←[0;37m[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.in
stagram.com:443←[0m
←[0;37m[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /api/v
1/feed/reels_media/?reel_ids=66315136177 HTTP/1.1" 200 3389←[0m
←[1;31m[instagram][error] An unexpected error occurred: KeyError - 'post_date'.
Please run gallery-dl again with the --verbose flag, copy its output and report
this issue on https://github.com/mikf/gallery-dl/issues .←[0m
←[0;37m[instagram][debug] ←[0m
Traceback (most recent call last):
  File "C:\Users\whatever\AppData\Local\Programs\Python\Python38-32\lib\site-package
s\gallery_dl\job.py", line 151, in run
    for msg in extractor:
  File "C:\Users\whatever\AppData\Local\Programs\Python\Python38-32\lib\site-package
s\gallery_dl\extractor\instagram.py", line 76, in items
    post = self._parse_post_rest(post)
  File "C:\Users\whatever\AppData\Local\Programs\Python\Python38-32\lib\site-package
s\gallery_dl\extractor\instagram.py", line 216, in _parse_post_rest
    data["date"] = data["post_date"]
KeyError: 'post_date'
throwaway242685 commented 2 months ago

this happens with all profiles :C

mikf commented 2 months ago

https://github.com/mikf/gallery-dl/issues/6081#issuecomment-2308943136

I've made a mistake and broke stories and highlight downloads. Revert back to the last dev build for now.

throwaway242685 commented 2 months ago

how do I revert back to that version?

i'm using gallery-dl from pip.

mikf commented 2 months ago

For v1.27.3

pip install gallery-dl==1.27.3

For the commit before https://github.com/mikf/gallery-dl/commit/a3642638109b22332072701fb157dcd6a4ef3a54

pip install --force-reinstall https://github.com/mikf/gallery-dl/archive/3bffe7a8bd8cf4434cd34153c781341dbfcbc177.zip