File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ def main(last_id):
2525 for item in res_json ["data" ]["list" ]:
2626 post_id = item ["post" ]["post_id" ]
2727 detail (post_id )
28+
29+ if res_json ["data" ]["last_id" ] != "" :
30+ return main (res_json ["data" ]["last_id" ])
2831
2932def detail (post_id ):
3033 url = f"https://bbs-api.mihoyo.com/post/wapi/getPostFull?gids=5&post_id={ post_id } &read=1"
@@ -48,18 +51,5 @@ def save_image(image_src):
4851
4952
5053
51- if __name__ == '__main__' :
52- main (18136074 )
53-
54- def main (last_id ):
55- url = f"https://bbs-api.mihoyo.com/post/wapi/getForumPostList?forum_id=47&gids=5&is_good=false&last_id={ last_id } &is_hot=false&page_size=20&sort_type=2"
56- res_json = request_get (url , "json" )
57- if res_json ["retcode" ] == 0 :
58- for item in res_json ["data" ]["list" ]:
59- detail (item ["post" ]["post_id" ])
60-
61- if res_json ["data" ]["last_id" ] != "" :
62- return main (res_json ["data" ]["last_id" ])
63-
6454if __name__ == '__main__' :
6555 main (18136074 )
You can’t perform that action at this time.
0 commit comments