Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
honue committed Apr 1, 2024
1 parent ea48d00 commit 8dfbc97
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"DouBanWatching": {
"name": "豆瓣书影音档案",
"description": "将在看的剧集同步到豆瓣书影音档案",
"version": "1.3",
"version": "1.4",
"icon": "https://raw.githubusercontent.com/honue/MoviePilot-Plugins/main/icons/douban.png",
"author": "honue",
"level": 1
Expand Down
10 changes: 7 additions & 3 deletions plugins/doubanwatching/DoubanHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ def __init__(self):
if cookie_dict is None:
logger.error(msg)
self.cookies = cookie_dict.get("douban.com")
if not cookie_dict or not self.cookies:

match = re.search(r'ck=(.*?);', self.cookies)
self.ck = match.group(1) if match else None

if not cookie_dict or not self.cookies or not self.ck:
logger.error(f"获取豆瓣cookie错误 {msg}")
self.headers = {
'User-Agent': settings.USER_AGENT,
Expand Down Expand Up @@ -82,7 +86,7 @@ def set_watching_status(self, subject_id: str, private: bool = True) -> bool:
self.headers["Host"] = "movie.douban.com"
self.headers["Cookie"] = self.cookies
data_json = {
"ck": "pv4g",
"ck": self.ck,
"interest": "do",
"rating": "",
"foldcollect": "U",
Expand All @@ -95,7 +99,7 @@ def set_watching_status(self, subject_id: str, private: bool = True) -> bool:
url=f"https://movie.douban.com/j/subject/{subject_id}/interest",
data=data_json)
if not response:
logger.error(f"{response.text} cookie:{self.cookies}")
logger.error(f"{response.text} ck:{self.ck}")
return False
if response.status_code == 200:
logger.debug(response.text)
Expand Down
2 changes: 1 addition & 1 deletion plugins/doubanwatching/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DouBanWatching(_PluginBase):
# 插件图标
plugin_icon = "douban.png"
# 插件版本
plugin_version = "1.3"
plugin_version = "1.4"
# 插件作者
plugin_author = "honue"
# 作者主页
Expand Down

0 comments on commit 8dfbc97

Please sign in to comment.