微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Instaloader 错误:“Instagram 响应 HTTP 错误“429 - 请求过多”

如何解决Instaloader 错误:“Instagram 响应 HTTP 错误“429 - 请求过多”

我写了一个 Instagram 抓取程序。当我运行程序时,它会崩溃并显示如下错误: 注意:我也尝试了很多次它建议的解决方案!

ERROR : " JSON Query to explore/tags/infinityroomyayoikusama/: 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
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 666 seconds,at 12:27." 

这是我的代码

#GET THE MOST LIKED POSTS FROM A HASHTAG IN A SPECIFIC PERIOD 

#Import packages
from itertools import islice
from math import ceil
import posts
from instaloader import Instaloader,Profile,Hashtag
from datetime import datetime
from itertools import dropwhile,takewhile


#Get top X posts from a Hashtag (photo,likes,comments,text)
L = Instaloader()
X_percentage = 10
hashtag = Hashtag.from_name(L.context,"visualarts")
posts_sorted_by_likes = sorted(hashtag.get_posts(),key=lambda p: p.likes + p.comments,reverse=True)
for post in islice(posts_sorted_by_likes,ceil(hashtag.mediacount * X_percentage / 100)):
    L.download_post( posts_sorted_by_likes[0],"visualarts" )


#Get posts from a hashtag in a Specific Period
SINCE = datetime(2019,5,1)
UNTIL = datetime(2019,3,1)
for post in takewhile(lambda p: p.date > UNTIL,dropwhile(lambda p: p.date > SINCE,posts)):
    print(post.date)
    L.download_post(post,"visualarts") 

我将如何解决错误?先感谢您!索菲亚

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。