Skip to content

Commit d4514ed

Browse files
committed
v1.7.3
- `捷径`新增消息中心功能 - 内建支持CookieCloud本地化服务器,Cookie数据加密后保存在用户配置目录中,可在`设定`-`站点`中选择开启 - 优化了推荐详情页面,豆瓣推荐详情直接展示豆瓣数据源 - 修复了`蜜柑`无法搜索的问题
1 parent 0c58156 commit d4514ed

File tree

6 files changed

+46
-11
lines changed

6 files changed

+46
-11
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
通过CookieCloud可以快速同步浏览器中保存的站点数据到MoviePilot,支持以下服务方式:
2525

26-
- 使用公共CookieCloud服务器(默认):服务器地址为:https://movie-pilot.org/cookiecloud
27-
- 使用内建的本地Cookie服务:设置`COOKIECLOUD_ENABLE_LOCAL``true`时启用,服务地址为:`http://localhost:${NGINX_PORT}/cookiecloud/`, Cookie数据加密保存在配置文件目录下的`cookies`文件中
26+
- 使用公共CookieCloud远程服务器(默认):服务器地址为:https://movie-pilot.org/cookiecloud
27+
- 使用内建的本地Cookie服务:`设定` - `站点` 中打开`启用本地CookieCloud服务器`后,将启用内建的CookieCloud提供服务,服务地址为:`http://localhost:${NGINX_PORT}/cookiecloud/`, Cookie数据加密保存在配置文件目录下的`cookies`文件中
2828
- 自建服务CookieCloud服务器:参考 [CookieCloud](https://github.com/easychen/CookieCloud) 项目进行搭建,docker镜像请点击 [这里](https://hub.docker.com/r/easychen/cookiecloud)
2929

3030
**声明:** 本项目不会收集用户敏感数据,Cookie同步也是基于CookieCloud项目实现,非本项目提供的能力。技术角度上CookieCloud采用端到端加密,在个人不泄露`用户KEY``端对端加密密码`的情况下第三方无法窃取任何用户信息(包括服务器持有者)。如果你不放心,可以不使用公共服务或者不使用本项目,但如果使用后发生了任何信息泄露与本项目无关!

app/helper/cookiecloud.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ def download(self) -> Tuple[Optional[dict], str]:
4545
req_url = "%s/get/%s" % (self._server, str(self._key).strip())
4646
ret = self._req.get_res(url=req_url)
4747
if ret and ret.status_code == 200:
48-
result = ret.json()
49-
if not result:
50-
return {}, f"未从{self._server}下载到cookie数据"
48+
try:
49+
result = ret.json()
50+
if not result:
51+
return {}, f"未从{self._server}下载到cookie数据"
52+
except Exception as err:
53+
return {}, f"从{self._server}下载cookie数据错误:{str(err)}"
5154
elif ret:
5255
return None, f"远程同步CookieCloud失败,错误码:{ret.status_code}"
5356
else:
@@ -62,7 +65,7 @@ def download(self) -> Tuple[Optional[dict], str]:
6265
decrypted_data = decrypt(encrypted, crypt_key).decode('utf-8')
6366
result = json.loads(decrypted_data)
6467
except Exception as e:
65-
return {}, "cookie解密失败" + str(e)
68+
return {}, "cookie解密失败" + str(e)
6669

6770
if not result:
6871
return {}, "cookie解密为空"
@@ -115,7 +118,7 @@ def _load_local_encrypt_data(self, uuid: str) -> Dict[str, Any]:
115118
file_path = os.path.join(self._local_path, os.path.basename(uuid) + ".json")
116119
# 检查文件是否存在
117120
if not os.path.exists(file_path):
118-
return None
121+
return {}
119122

120123
# 读取文件
121124
with open(file_path, encoding="utf-8", mode="r") as file:

config/app.env

-2
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,3 @@ DOWNLOAD_SUBTITLE=true
4343
OCR_HOST=https://movie-pilot.org
4444
# 插件市场仓库地址,多个地址使用`,`分隔,保留最后的/
4545
PLUGIN_MARKET=https://github.com/jxxghp/MoviePilot-Plugins
46-
# 是否启动本地CookieCloud服务,启用后,即可通过 http://localhost:3000/cookiecloud/ 使用cookiecloud服务
47-
COOKIECLOUD_ENABLE_LOCAL=false
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""1.0.15
2+
3+
Revision ID: 5813aaa7cb3a
4+
Revises: f94cd1217fd7
5+
Create Date: 2024-03-17 09:04:51.785716
6+
7+
"""
8+
import contextlib
9+
10+
from alembic import op
11+
import sqlalchemy as sa
12+
13+
14+
# revision identifiers, used by Alembic.
15+
revision = '5813aaa7cb3a'
16+
down_revision = 'f94cd1217fd7'
17+
branch_labels = None
18+
depends_on = None
19+
20+
21+
def upgrade() -> None:
22+
# ### commands auto generated by Alembic - please adjust! ###
23+
with contextlib.suppress(Exception):
24+
with op.batch_alter_table("message") as batch_op:
25+
batch_op.add_column(sa.Column('note', sa.String, nullable=True))
26+
try:
27+
op.create_index('ix_message_reg_time', 'message', ['reg_time'], unique=False)
28+
except Exception as err:
29+
pass
30+
# ### end Alembic commands ###
31+
32+
33+
def downgrade() -> None:
34+
pass

database/versions/f94cd1217fd7_1_0_14.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ def upgrade() -> None:
2828

2929
def downgrade() -> None:
3030
# ### commands auto generated by Alembic - please adjust! ###
31-
pass
31+
pass

version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
APP_VERSION = 'v1.7.2'
1+
APP_VERSION = 'v1.7.3'

0 commit comments

Comments
 (0)