首页 > 解决方案 > Instagram 响应 HTTP 错误“429 - 请求过多”

问题描述

我不确定如何修复以下代码以克服速率限制。此外,即使我将 max_count 设置为 100,我也不确定为什么它会在 10 个帖子处停止。

代码:

import instaloader

loader= instaloader.Instaloader(download_comments=True,
                    download_videos=True,
                    download_geotags=True,
                    save_metadata=True)

loader.download_hashtag('fashion', max_count=100, fast_update=False, profile_pic=False)

问题是:

(base) mona@mona:~/research/insta-scrape$ python instaloader_tester.py 
Retrieving pictures with hashtag #fashion...
[  1/100] #fashion/2020-11-30_03-20-10_UTC.jpg [@___eshika__rao   @ieshu_rao …] comments json 
[  2/100] #fashion/2020-11-30_03-04-22_UTC.jpg [would you let me ride shotgun…] comments json 
[  3/100] #fashion/2020-11-30_03-02-28_UTC.jpg [✨I bite back ✨] 
HTTP redirect from https://www.instagram.com/graphql/query to https://www.instagram.com/accounts/login/
JSON Query to graphql/query: 429 Too Many Requests: redirected to login [retrying; skip with ^C]
Requests within last 10/11/20/22/30/60 minutes grouped by type:
                              other:    1    1    1    1    1    1
   2b0673e0dc4580674a88d426fe00ea90:    3    3    3    3    3    3
 * 97b41c52301f77ce508f55e66d17620e:    4    4    4    4    4    4
Instagram responded with HTTP error "429 - Too Many Requests". Please
do not run multiple instances of Instaloader in parallel or within
short sequence. Also, do not use any Instagram App while Instaloader
is running.
The request will be retried in 655 seconds, at 23:04.

标签: pythonweb-scrapinginstagramrate-limitinginstaloader

解决方案


推荐阅读