mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-10 17:42:45 +08:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4a67ea052 | ||
|
|
a4df2f5213 | ||
|
|
4f89780a0f | ||
|
|
26d6201b30 | ||
|
|
c9a9ff2692 | ||
|
|
0be49953b4 | ||
|
|
0de952f090 | ||
|
|
2b570bf48f | ||
|
|
9476017af5 | ||
|
|
54f808485e | ||
|
|
fa5c82899b | ||
|
|
4a57071809 | ||
|
|
4631db9a45 | ||
|
|
0f09da55b0 | ||
|
|
b14b41c2c1 | ||
|
|
897758d829 | ||
|
|
c450dfc0fa |
@@ -188,7 +188,7 @@ MoviePilot需要配套下载器和媒体服务器配合使用。
|
||||
- 通过设置的超级管理员用户登录管理界面(默认用户:admin,默认端口:3000),**注意:初始密码为自动生成,需要在首次运行时的后台日志中查看!**
|
||||
- 通过CookieCloud同步快速添加站点,不需要使用的站点可在WEB管理界面中禁用或删除,无法同步的站点可手动新增。
|
||||
- 通过打开下载器监控实现下载完成后自动整理入库并刮削媒体信息。
|
||||
- 通过`微信`/`Telegram`/`Slack`/`SynologyChat`/`VoceChat`远程管理,其中 微信/Telegram 将会自动添加操作菜单(微信菜单条数有限制,部分菜单不显示);微信需要在官方页面设置回调地址,SynologyChat/VoceChat 需要设置机器人传入地址/Webhook,地址相对路径均为:`/api/v1/message/`。
|
||||
- 通过`微信`/`Telegram`/`Slack`/`SynologyChat`/`VoceChat`远程管理,其中 微信/Telegram 将会自动添加操作菜单(微信菜单条数有限制,部分菜单不显示);微信回调地址、SynologyChat传入地址地址相对路径均为:`/api/v1/message/`;VoceChat的Webhook地址相对路径为:`/api/v1/message/?token=moviepilot`,其中moviepilot为设置的`API_TOKEN`。
|
||||
- 设置媒体服务器Webhook,通过MoviePilot发送播放通知等。Webhook回调相对路径为`/api/v1/webhook?token=moviepilot`,其中`moviepilot`为设置的`API_TOKEN`。
|
||||
- 将MoviePilot做为Radarr或Sonarr服务器添加到Overseerr或Jellyseerr,可使用Overseerr/Jellyseerr浏览订阅。
|
||||
- 映射宿主机docker.sock文件到容器`/var/run/docker.sock`,以支持内建重启操作。实例:`-v /var/run/docker.sock:/var/run/docker.sock:ro`。
|
||||
|
||||
@@ -36,21 +36,11 @@ async def user_message(background_tasks: BackgroundTasks, request: Request):
|
||||
return schemas.Response(success=True)
|
||||
|
||||
|
||||
@router.get("/", summary="VoceChat验证")
|
||||
def vocechat_verify() -> Any:
|
||||
"""
|
||||
VoceChat验证响应
|
||||
"""
|
||||
return {"status": "OK"}
|
||||
|
||||
|
||||
@router.get("/", summary="微信验证")
|
||||
def wechat_verify(echostr: str, msg_signature: str,
|
||||
timestamp: Union[str, int], nonce: str) -> Any:
|
||||
"""
|
||||
微信验证响应
|
||||
"""
|
||||
logger.info(f"收到微信验证请求: {echostr}")
|
||||
try:
|
||||
wxcpt = WXBizMsgCrypt(sToken=settings.WECHAT_TOKEN,
|
||||
sEncodingAESKey=settings.WECHAT_ENCODING_AESKEY,
|
||||
@@ -68,6 +58,28 @@ def wechat_verify(echostr: str, msg_signature: str,
|
||||
return PlainTextResponse(sEchoStr)
|
||||
|
||||
|
||||
def vocechat_verify(token: str) -> Any:
|
||||
"""
|
||||
VoceChat验证响应
|
||||
"""
|
||||
if token == settings.API_TOKEN:
|
||||
return {"status": "OK"}
|
||||
return {"status": "ERROR"}
|
||||
|
||||
|
||||
@router.get("/", summary="回调请求验证")
|
||||
def incoming_verify(token: str = None, echostr: str = None, msg_signature: str = None,
|
||||
timestamp: Union[str, int] = None, nonce: str = None) -> Any:
|
||||
"""
|
||||
微信/VoceChat等验证响应
|
||||
"""
|
||||
logger.info(f"收到验证请求: token={token}, echostr={echostr}, "
|
||||
f"msg_signature={msg_signature}, timestamp={timestamp}, nonce={nonce}")
|
||||
if echostr and msg_signature and timestamp and nonce:
|
||||
return wechat_verify(echostr, msg_signature, timestamp, nonce)
|
||||
return vocechat_verify(token)
|
||||
|
||||
|
||||
@router.get("/switchs", summary="查询通知消息渠道开关", response_model=List[NotificationSwitch])
|
||||
def read_switchs(_: schemas.TokenPayload = Depends(verify_token)) -> Any:
|
||||
"""
|
||||
|
||||
@@ -164,7 +164,7 @@ class MediaInfo:
|
||||
# LOGO
|
||||
logo_path: str = None
|
||||
# 评分
|
||||
vote_average: int = 0
|
||||
vote_average: float = 0
|
||||
# 描述
|
||||
overview: str = None
|
||||
# 风格ID
|
||||
|
||||
@@ -48,7 +48,7 @@ class FileTransferModule(_ModuleBase):
|
||||
return False, f"目录不存在:{library_path}"
|
||||
if settings.TRANSFER_TYPE == "link":
|
||||
if library_path.stat().st_dev != download_devid:
|
||||
return False, "下载目录与媒体库目录不在同一设备,将导致硬链接失败"
|
||||
return False, f"下载目录 {download_path} 与媒体库目录 {library_path} 不在同一设备,将无法硬链接"
|
||||
return True, ""
|
||||
|
||||
def init_setting(self) -> Tuple[str, Union[str, bool]]:
|
||||
|
||||
@@ -39,7 +39,7 @@ class FilterModule(_ModuleBase):
|
||||
# 中字
|
||||
"CNSUB": {
|
||||
"include": [
|
||||
r'[中国國繁简](/|\s|\\|\|)?[繁简英粤]|[英简繁](/|\s|\\|\|)?[中繁简]|繁體|简体|[中国國][字配]|国语|國語|中文|中字'],
|
||||
r'[中国國繁简](/|\s|\\|\|)?[繁简英粤]|[英简繁](/|\s|\\|\|)?[中繁简]|繁體|简体|[中国國][字配]|国语|國語|中文|中字|简日|繁日|简繁|繁体|([\s,.-\[])(CHT|CHS|cht|chs)(|[\s,.-\]])'],
|
||||
"exclude": [],
|
||||
"tmdb": {
|
||||
"original_language": "zh,cn"
|
||||
|
||||
@@ -43,7 +43,8 @@ class TheMovieDbModule(_ModuleBase):
|
||||
"""
|
||||
测试模块连接性
|
||||
"""
|
||||
ret = RequestUtils().get_res(f"https://{settings.TMDB_API_DOMAIN}/3/movie/550?api_key={settings.TMDB_API_KEY}")
|
||||
ret = RequestUtils(proxies=settings.PROXY).get_res(
|
||||
f"https://{settings.TMDB_API_DOMAIN}/3/movie/550?api_key={settings.TMDB_API_KEY}")
|
||||
if ret and ret.status_code == 200:
|
||||
return True, ""
|
||||
elif ret:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from typing import Optional, Tuple, Union
|
||||
|
||||
|
||||
from app.core.config import settings
|
||||
from app.log import logger
|
||||
from app.modules import _ModuleBase
|
||||
@@ -9,7 +8,6 @@ from app.utils.http import RequestUtils
|
||||
|
||||
|
||||
class TheTvDbModule(_ModuleBase):
|
||||
|
||||
tvdb: tvdbapi.Tvdb = None
|
||||
|
||||
def init_module(self) -> None:
|
||||
@@ -25,7 +23,7 @@ class TheTvDbModule(_ModuleBase):
|
||||
"""
|
||||
测试模块连接性
|
||||
"""
|
||||
ret = RequestUtils().get_res("https://api.thetvdb.com/series/81189")
|
||||
ret = RequestUtils(proxies=settings.PROXY).get_res("https://api.thetvdb.com/series/81189")
|
||||
if ret and ret.status_code == 200:
|
||||
return True, ""
|
||||
elif ret:
|
||||
|
||||
@@ -67,6 +67,11 @@ class VoceChatModule(_ModuleBase):
|
||||
# 非新消息
|
||||
return None
|
||||
logger.debug(f"收到VoceChat请求:{msg_body}")
|
||||
# token校验
|
||||
token = args.get("token")
|
||||
if not token or token != settings.API_TOKEN:
|
||||
logger.warn(f"VoceChat请求token校验失败:{token}")
|
||||
return None
|
||||
# 文本内容
|
||||
content = msg_body.get("detail", {}).get("content")
|
||||
# 用户ID
|
||||
|
||||
@@ -98,10 +98,8 @@ class VoceChat:
|
||||
return None
|
||||
|
||||
try:
|
||||
index, image, caption = 1, "", "**%s**" % title
|
||||
index, caption = 1, "**%s**" % title
|
||||
for media in medias:
|
||||
if not image:
|
||||
image = media.get_message_image()
|
||||
if media.vote_average:
|
||||
caption = "%s\n%s. [%s](%s)\n_%s,%s_" % (caption,
|
||||
index,
|
||||
@@ -141,7 +139,6 @@ class VoceChat:
|
||||
|
||||
try:
|
||||
index, caption = 1, "**%s**" % title
|
||||
mediainfo = torrents[0].media_info
|
||||
for context in torrents:
|
||||
torrent = context.torrent_info
|
||||
site_name = torrent.site_name
|
||||
@@ -163,8 +160,7 @@ class VoceChat:
|
||||
else:
|
||||
chat_id = f"GID#{self._channel_id}"
|
||||
|
||||
return self.__send_request(userid=chat_id, caption=caption,
|
||||
image=mediainfo.get_message_image())
|
||||
return self.__send_request(userid=chat_id, caption=caption)
|
||||
|
||||
except Exception as msg_e:
|
||||
logger.error(f"发送消息失败:{msg_e}")
|
||||
@@ -183,17 +179,13 @@ class VoceChat:
|
||||
else:
|
||||
action = "send_to_user"
|
||||
idstr = userid[4:]
|
||||
|
||||
with lock:
|
||||
try:
|
||||
logger.info(f"VoceChat发送消息:action={action}, userid={idstr}, text={caption}")
|
||||
result = self._client.post_res(f"{self._host}api/bot/{action}/{idstr}", data=caption.encode("utf-8"))
|
||||
if result and result.status_code == 200:
|
||||
return True
|
||||
elif result is not None:
|
||||
logger.error(f"VoceChat发送消息失败,错误码:{result.status_code}")
|
||||
return False
|
||||
else:
|
||||
raise Exception("VoceChat发送消息失败,连接失败")
|
||||
except Exception as msg_e:
|
||||
logger.error(f"VoceChat发送消息错误:{str(msg_e)}")
|
||||
return False
|
||||
result = self._client.post_res(f"{self._host}api/bot/{action}/{idstr}", data=caption.encode("utf-8"))
|
||||
if result and result.status_code == 200:
|
||||
return True
|
||||
elif result is not None:
|
||||
logger.error(f"VoceChat发送消息失败,错误码:{result.status_code}")
|
||||
return False
|
||||
else:
|
||||
raise Exception("VoceChat发送消息失败,连接失败")
|
||||
|
||||
@@ -94,7 +94,7 @@ class MediaInfo(BaseModel):
|
||||
# 海报图片
|
||||
poster_path: Optional[str] = None
|
||||
# 评分
|
||||
vote_average: Optional[int] = 0
|
||||
vote_average: Optional[float] = 0
|
||||
# 描述
|
||||
overview: Optional[str] = None
|
||||
# 二级分类
|
||||
|
||||
@@ -1 +1 @@
|
||||
APP_VERSION = 'v1.7.0'
|
||||
APP_VERSION = 'v1.7.0-1'
|
||||
|
||||
Reference in New Issue
Block a user