weixin_39732991
weixin_39732991
2020-12-27 11:59

Added 5 seconds to sleep to avoid to be logged-out

Fixed #104

该提问来源于开源项目:ahmdrz/goinsta

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_39637059 weixin_39637059 4月前

    Instagram between requests wants a delay time to avoid spammers

    That's the reason of my delays in test files. I think it can be 3 seconds. But ... For a member with more than 2K followers , It will take too long to fetch all of followers. I think it's better to implement it using generator patterns or something else like it. What's your idea ?

    点赞 评论 复制链接分享
  • weixin_39732991 weixin_39732991 4月前

    I think it can be 3 seconds. But ...

    I read about 5 seconds here: https://github.com/mgp25/Instagram-API/issues/1710#issuecomment-347415959

    For a member with more than 2K followers , It will take too long to fetch all of followers.

    Well I thought to save all followers to a DB the first time and yes, to get all followers my code takes a lot of time. (I thought to save all them in a DB and perform a re-check only if a number of followers change) I thought to implement a retry function or a generator pattern but how to be sure that Instagram doesn't block any kind of request from the same source? (even using goroutines)

    点赞 评论 复制链接分享
  • weixin_39982537 weixin_39982537 4月前

    This pull request won't be accepted for the following reasons: 1.- We are working on a new API (you can check it out at the alpha branch). This new API implements paging methods which allows pagination using a comfortable function (Next) and gives you control to call your Sleep function between calls. 2.- Personally I do not think the TotalUserFollow functions are necessary (it's an unneeded automation) unless you have a small number of followers/following. 3.- If you want to use this function with Sleep call you can use UserFollow functions.

    点赞 评论 复制链接分享
  • weixin_39982537 weixin_39982537 4月前

    https://godoc.org/gopkg.in/ahmdrz/goinsta.v2

    点赞 评论 复制链接分享
  • weixin_39637059 weixin_39637059 4月前

    Hi , I think it's not a good way to fix your problem. What's your idea ?

    点赞 评论 复制链接分享
  • weixin_39732991 weixin_39732991 4月前

    Instagram between requests wants a delay time to avoid spammers. A minimum delay is 5 seconds and with my fix I can take all followers I want without problems (maybe you can add a delay time in the request function), if you know a better solution let me know, I'm interested to fix it. 😊

    点赞 评论 复制链接分享

相关推荐