mikf / gallery-dl

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

[Instagram] 'JSON object must be str, bytes or bytearray, not NoneType' #3604

Open Luke-L opened 1 year ago

Luke-L commented 1 year ago

The Instagram extractor is not working for me. I tried updating the program through the GitHub desktop app, but got the same error. Also, I would like to download the post's captions and tags into a csv or json file, but I'm not sure if that's possible.

B:\Github\gallery-dl>gallery-dl https://www.instagram.com/gluten_free_bagels/ -v
[gallery-dl][debug] Version 1.20.5 - Executable
[gallery-dl][debug] Python 3.7.9 - Windows-10-10.0.19041
[gallery-dl][debug] requests 2.27.1 - urllib3 1.26.8
[gallery-dl][debug] Starting DownloadJob for 'https://www.instagram.com/gluten_free_bagels/'
[instagram][debug] Using InstagramUserExtractor for 'https://www.instagram.com/gluten_free_bagels/'
[instagram][debug] Using InstagramPostsExtractor for 'https://www.instagram.com/gluten_free_bagels/posts/'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.instagram.com:443
[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /gluten_free_bagels/ HTTP/1.1" 200 None
[instagram][error] An unexpected error occurred: TypeError - the JSON object must be str, bytes or bytearray, not NoneType. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[instagram][debug]
Traceback (most recent call last):
  File "gallery_dl\job.pyc", line 76, in run
  File "gallery_dl\extractor\instagram.pyc", line 48, in items
  File "gallery_dl\extractor\instagram.pyc", line 433, in posts
  File "gallery_dl\extractor\instagram.pyc", line 347, in _extract_profile_page
  File "gallery_dl\extractor\instagram.pyc", line 340, in _extract_shared_data
  File "json\__init__.pyc", line 341, in loads
TypeError: the JSON object must be str, bytes or bytearray, not NoneType

Thanks for making this great tool. :)

mikf commented 1 year ago

[gallery-dl][debug] Version 1.20.5 - Executable

Update your gallery-dl. Latest version is 1.24.5 (1.20.5 is roughly one year old)

Also, I would like to download the post's captions and tags into a csv or json file, but I'm not sure if that's possible.

--write-metadata. Using a custom metadata post processor in your config file would allow for more control, but the command-line flag might be good enough.