Skip to content

Commit

Permalink
修改与bangumi.online的联动
Browse files Browse the repository at this point in the history
  • Loading branch information
Ukenn2112 committed Dec 15, 2023
1 parent 74b1ef9 commit 2b8fd9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apiserver/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ def push():
from telebot import TeleBot
from telebot.types import InlineKeyboardButton, InlineKeyboardMarkup
logging.info(f"[I] push: 收到推送请求 {request.full_path}")
video_id = request.values.get("video_id")
video_id = request.values.get("vid")
subject_id = None
if video_id:
s = Session()
s.mount("https://", HTTPAdapter(max_retries=3))
r = s.post("https://api.bangumi.online/bgm/subject", data={"vid": video_id}, timeout=10).json()
r = s.post("https://gray.bangumi.online/api/bgm/subject", data={"vid": video_id}, timeout=10).json()
if r["code"] == 10000:
subject_id = r["data"]["season"]["id"]
subject_info = r["data"]["season"]["title"]["zh"] or r["data"]["season"]["title"]["ja"]
Expand Down

0 comments on commit 2b8fd9f

Please sign in to comment.