Skip to content

Commit

Permalink
v1.7.3
Browse files Browse the repository at this point in the history
- `捷径`新增消息中心功能
- 内建支持CookieCloud本地化服务器,Cookie数据加密后保存在用户配置目录中,可在`设定`-`站点`中选择开启
- 优化了推荐详情页面,豆瓣推荐详情直接展示豆瓣数据源
- 修复了`蜜柑`无法搜索的问题
  • Loading branch information
jxxghp committed Mar 17, 2024
1 parent 0c58156 commit d4514ed
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

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

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

**声明:** 本项目不会收集用户敏感数据,Cookie同步也是基于CookieCloud项目实现,非本项目提供的能力。技术角度上CookieCloud采用端到端加密,在个人不泄露`用户KEY``端对端加密密码`的情况下第三方无法窃取任何用户信息(包括服务器持有者)。如果你不放心,可以不使用公共服务或者不使用本项目,但如果使用后发生了任何信息泄露与本项目无关!
Expand Down
13 changes: 8 additions & 5 deletions app/helper/cookiecloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ def download(self) -> Tuple[Optional[dict], str]:
req_url = "%s/get/%s" % (self._server, str(self._key).strip())
ret = self._req.get_res(url=req_url)
if ret and ret.status_code == 200:
result = ret.json()
if not result:
return {}, f"未从{self._server}下载到cookie数据"
try:
result = ret.json()
if not result:
return {}, f"未从{self._server}下载到cookie数据"
except Exception as err:
return {}, f"从{self._server}下载cookie数据错误:{str(err)}"
elif ret:
return None, f"远程同步CookieCloud失败,错误码:{ret.status_code}"
else:
Expand All @@ -62,7 +65,7 @@ def download(self) -> Tuple[Optional[dict], str]:
decrypted_data = decrypt(encrypted, crypt_key).decode('utf-8')
result = json.loads(decrypted_data)
except Exception as e:
return {}, "cookie解密失败" + str(e)
return {}, "cookie解密失败" + str(e)

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

# 读取文件
with open(file_path, encoding="utf-8", mode="r") as file:
Expand Down
2 changes: 0 additions & 2 deletions config/app.env
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,3 @@ DOWNLOAD_SUBTITLE=true
OCR_HOST=https://movie-pilot.org
# 插件市场仓库地址,多个地址使用`,`分隔,保留最后的/
PLUGIN_MARKET=https://github.com/jxxghp/MoviePilot-Plugins
# 是否启动本地CookieCloud服务,启用后,即可通过 http://localhost:3000/cookiecloud/ 使用cookiecloud服务
COOKIECLOUD_ENABLE_LOCAL=false
34 changes: 34 additions & 0 deletions database/versions/5813aaa7cb3a_1_0_15.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""1.0.15
Revision ID: 5813aaa7cb3a
Revises: f94cd1217fd7
Create Date: 2024-03-17 09:04:51.785716
"""
import contextlib

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5813aaa7cb3a'
down_revision = 'f94cd1217fd7'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with contextlib.suppress(Exception):
with op.batch_alter_table("message") as batch_op:
batch_op.add_column(sa.Column('note', sa.String, nullable=True))
try:
op.create_index('ix_message_reg_time', 'message', ['reg_time'], unique=False)
except Exception as err:
pass
# ### end Alembic commands ###


def downgrade() -> None:
pass
2 changes: 1 addition & 1 deletion database/versions/f94cd1217fd7_1_0_14.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ def upgrade() -> None:

def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
pass
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
APP_VERSION = 'v1.7.2'
APP_VERSION = 'v1.7.3'

0 comments on commit d4514ed

Please sign in to comment.