Tommy131 / KuaishouParser

全网功能最全的快手短视频解析工具
Apache License 2.0
101 stars 18 forks source link

Possibility of using www.kuaishou.com/graphql over live.kuaishou.com LIVE_GET_FEEDS API #12

Closed cydevdummy001 closed 1 year ago

cydevdummy001 commented 1 year ago

Is your feature request related to a problem? Please describe. Seems like the live.kuaishou.com has some stability issue (or my IP being silently banned 😢), always ended up getting [OwO/ERROR] > [KuaiModule] 无用户数据 after a few downloads. tried skipped the sensitive user info part and called LIVE_GET_FEEDS directly, the API is not working as well, returning empty data and result 2

Describe the solution you'd like Possible to leverage on operation visionProfilePhotoList provided by www.kuaishou.com/graphql instead of relying on live.kuaishou.com API?

Describe alternatives you've considered N/A

Additional context N/A

Tommy131 commented 1 year ago

Thank you for using this repository. Exactly, I got the same question like you. The cause of live.kuaishou.com 's server, they limit the request per minute / hour for client (IP). As I know for solution, you shouldn't request the target very often. You mentioned change the alternative API to www.kuaishou.com/graphl. But the problem is, this API can't fetch the posted photos by the target (user). So in the last update I removed support for it.

Tommy131 commented 1 year ago

As far as I know, this is due to did in the cookie. The Kuaishou server will identify the client device through did to block it. Since this value is issued by the Kuaishou server, it is currently impossible to crack it with my ability. But you can try to log in through the web, get the cookie and copy it into the config.json file. The general ban time is about 1-2 days. It's really annoying, but I can't find an another solution for now :(

cydevdummy001 commented 1 year ago

Thanks for taking time to look into the issue Tommy! :)

But the problem is, this API can't fetch the posted photos by the target (user). So in the last update I removed support for it.

Actually I'm ok with skipping the images, can you point me to the commit where the www.kuaishou.com/graphl is still working?

Tommy131 commented 1 year ago

I'll try to retake the feature in the next commit. For personal reason I'm on busy this week, I'll work with it first in the next week.

cydevdummy001 commented 1 year ago

No rush Tommy, thanks again for creating this awesome repo 🙇

Tommy131 commented 1 year ago

Dear user @cydevdummy001, I promised you to re-support API www_graphql usage. In the last 2 commits, the feature has been finalized. Check commit: https://github.com/Tommy131/KuaishouParser/commit/c8058ba467432fcb91669907bd23f42348698f7d

I closed this issue. If you have any question, feel free to repoen this issue and put your question(s) follow this comment.

Tommy131 commented 1 year ago

Please update the newest OwOFrame!

cydevdummy001 commented 1 year ago

Just tried it out, works perfectly, thanks Tommy.

FYI I encountered similar IP banning issue as before and resolved it by adding random sleep after complete download for each anchor.

Tommy131 commented 1 year ago

Just tried it out, works perfectly, thanks Tommy.

FYI I encountered similar IP banning issue as before and resolved it by adding random sleep after complete download for each anchor.

I had added it before I commited this :) Sometimes it works but not always.