Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cddb415

Browse files
Update cosplay.py
1 parent 5f34ae8 commit cddb415

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

‎moumoubaimifan/cosplay/cosplay.py‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff 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

2932
def 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-
6454
if __name__ == '__main__':
6555
main(18136074)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /