Compare commits
14 Commits
84e6abb659
...
main
Author | SHA1 | Date | |
---|---|---|---|
e1ad94cfb1 | |||
62e643acf8 | |||
73caa30315 | |||
f626ea6b8b | |||
|
b984b83870 | ||
|
2153ad48db | ||
|
c9c43fde74 | ||
|
e2c9742f64 | ||
|
3d459a40f7 | ||
|
5675cd5b11 | ||
|
74a4d0bd66 | ||
|
2b8c313019 | ||
|
62fb6b80a3 | ||
|
eea86528d8 |
69
.gitea/workflows/build.yml
Normal file
69
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
name: MoviePilot Builder
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- test
|
||||||
|
# paths:
|
||||||
|
# - version.py
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ${{ secrets.DOCKER_REGISTRY && secrets.DOCKER_REGISTRY || 'docker.io' }}
|
||||||
|
REGISTRY_MIRROR: ${{ secrets.DOCKER_REGISTRY_MIRROR && secrets.DOCKER_REGISTRY_MIRROR || 'docker.io' }}
|
||||||
|
REPOSITORY: ${{ github.repository }}
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
|
BASEIMAGE: ${{ secrets.BASEIMAGE && secrets.BASEIMAGE || '' }}
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Docker-build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Build Docker Image
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Release version
|
||||||
|
id: release_version
|
||||||
|
run: |
|
||||||
|
app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
|
||||||
|
echo "app_version=$app_version" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Docker Meta
|
||||||
|
id: meta
|
||||||
|
uses: actions/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: gitea.icodef.com/codfrm/moviepilot
|
||||||
|
tags: |
|
||||||
|
type=raw,value=${{ env.app_version }}
|
||||||
|
type=raw,value=latest
|
||||||
|
|
||||||
|
- name: Set Up QEMU
|
||||||
|
uses: actions/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set Up Buildx
|
||||||
|
uses: actions/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login DockerHub
|
||||||
|
uses: actions/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build Image
|
||||||
|
uses: actions/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
# linux/arm64/v8
|
||||||
|
push: true
|
||||||
|
build-args: |
|
||||||
|
MOVIEPILOT_VERSION=${{ env.app_version }}
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
cache-from: type=local,src=/root/.cache/buildx-cache/${{ github.workflow }}-docker
|
||||||
|
cache-to: type=local,dest=/root/.cache/buildx-cache/${{ github.workflow }}-docker
|
231
.github/workflows/build.yml
vendored
231
.github/workflows/build.yml
vendored
@@ -1,231 +0,0 @@
|
|||||||
name: MoviePilot Builder
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths:
|
|
||||||
- version.py
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
Docker-build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Build Docker Image
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Release version
|
|
||||||
id: release_version
|
|
||||||
run: |
|
|
||||||
app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
|
|
||||||
echo "app_version=$app_version" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Docker Meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ${{ secrets.DOCKER_USERNAME }}/moviepilot
|
|
||||||
tags: |
|
|
||||||
type=raw,value=${{ env.app_version }}
|
|
||||||
type=raw,value=latest
|
|
||||||
|
|
||||||
- name: Set Up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set Up Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login DockerHub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build Image
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: Dockerfile
|
|
||||||
platforms: |
|
|
||||||
linux/amd64
|
|
||||||
linux/arm64/v8
|
|
||||||
push: true
|
|
||||||
build-args: |
|
|
||||||
MOVIEPILOT_VERSION=${{ env.app_version }}
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
cache-from: type=gha, scope=${{ github.workflow }}-docker
|
|
||||||
cache-to: type=gha, scope=${{ github.workflow }}-docker
|
|
||||||
|
|
||||||
Windows-build:
|
|
||||||
runs-on: windows-latest
|
|
||||||
name: Build Windows Binary
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Init Python 3.11.4
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.11.4'
|
|
||||||
cache: 'pip'
|
|
||||||
|
|
||||||
- name: Install Dependent Packages
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install wheel pyinstaller
|
|
||||||
pip install -r requirements.txt
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
- name: Prepare Frontend
|
|
||||||
run: |
|
|
||||||
# 下载nginx
|
|
||||||
Invoke-WebRequest -Uri "http://nginx.org/download/nginx-1.25.2.zip" -OutFile "nginx.zip"
|
|
||||||
Expand-Archive -Path "nginx.zip" -DestinationPath "nginx-1.25.2"
|
|
||||||
Move-Item -Path "nginx-1.25.2/nginx-1.25.2" -Destination "nginx"
|
|
||||||
Remove-Item -Path "nginx.zip"
|
|
||||||
Remove-Item -Path "nginx-1.25.2" -Recurse -Force
|
|
||||||
# 下载前端
|
|
||||||
$FRONTEND_VERSION = (Invoke-WebRequest -Uri "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | ConvertFrom-Json).tag_name
|
|
||||||
Invoke-WebRequest -Uri "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/$FRONTEND_VERSION/dist.zip" -OutFile "dist.zip"
|
|
||||||
Expand-Archive -Path "dist.zip" -DestinationPath "dist"
|
|
||||||
Move-Item -Path "dist/dist/*" -Destination "nginx/html" -Force
|
|
||||||
Remove-Item -Path "dist.zip"
|
|
||||||
Remove-Item -Path "dist" -Recurse -Force
|
|
||||||
Move-Item -Path "nginx/html/nginx.conf" -Destination "nginx/conf/nginx.conf" -Force
|
|
||||||
New-Item -Path "nginx/temp" -ItemType Directory -Force
|
|
||||||
New-Item -Path "nginx/temp/__keep__.txt" -ItemType File -Force
|
|
||||||
New-Item -Path "nginx/logs" -ItemType Directory -Force
|
|
||||||
New-Item -Path "nginx/logs/__keep__.txt" -ItemType File -Force
|
|
||||||
# 下载插件 jxxghp
|
|
||||||
Invoke-WebRequest -Uri "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" -OutFile "MoviePilot-Plugins-main.zip"
|
|
||||||
Expand-Archive -Path "MoviePilot-Plugins-main.zip" -DestinationPath "MoviePilot-Plugins-main"
|
|
||||||
Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/" -Force -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item -Path "MoviePilot-Plugins-main.zip"
|
|
||||||
Remove-Item -Path "MoviePilot-Plugins-main" -Recurse -Force
|
|
||||||
# 下载插件 thsrite
|
|
||||||
Invoke-WebRequest -Uri "https://github.com/thsrite/MoviePilot-Plugins/archive/refs/heads/main.zip" -OutFile "MoviePilot-Plugins-main.zip"
|
|
||||||
Expand-Archive -Path "MoviePilot-Plugins-main.zip" -DestinationPath "MoviePilot-Plugins-main"
|
|
||||||
Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/" -Force -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item -Path "MoviePilot-Plugins-main.zip"
|
|
||||||
Remove-Item -Path "MoviePilot-Plugins-main" -Recurse -Force
|
|
||||||
# 下载插件 honue
|
|
||||||
Invoke-WebRequest -Uri "https://github.com/honue/MoviePilot-Plugins/archive/refs/heads/main.zip" -OutFile "MoviePilot-Plugins-main.zip"
|
|
||||||
Expand-Archive -Path "MoviePilot-Plugins-main.zip" -DestinationPath "MoviePilot-Plugins-main"
|
|
||||||
Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/" -Force -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item -Path "MoviePilot-Plugins-main.zip"
|
|
||||||
Remove-Item -Path "MoviePilot-Plugins-main" -Recurse -Force
|
|
||||||
# 下载插件 InfinityPacer
|
|
||||||
Invoke-WebRequest -Uri "https://github.com/InfinityPacer/MoviePilot-Plugins/archive/refs/heads/main.zip" -OutFile "MoviePilot-Plugins-main.zip"
|
|
||||||
Expand-Archive -Path "MoviePilot-Plugins-main.zip" -DestinationPath "MoviePilot-Plugins-main"
|
|
||||||
Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/" -Force -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item -Path "MoviePilot-Plugins-main.zip"
|
|
||||||
Remove-Item -Path "MoviePilot-Plugins-main" -Recurse -Force
|
|
||||||
# 下载资源
|
|
||||||
Invoke-WebRequest -Uri "https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip" -OutFile "MoviePilot-Resources-main.zip"
|
|
||||||
Expand-Archive -Path "MoviePilot-Resources-main.zip" -DestinationPath "MoviePilot-Resources-main"
|
|
||||||
Move-Item -Path "MoviePilot-Resources-main/MoviePilot-Resources-main/resources/*" -Destination "app/helper/" -Force
|
|
||||||
Remove-Item -Path "MoviePilot-Resources-main.zip"
|
|
||||||
Remove-Item -Path "MoviePilot-Resources-main" -Recurse -Force
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
- name: Pyinstaller
|
|
||||||
run: |
|
|
||||||
pyinstaller frozen.spec
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
- name: Upload Windows File
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: windows
|
|
||||||
path: dist/MoviePilot.exe
|
|
||||||
|
|
||||||
Linux-build-amd64:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Build Linux Amd64
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Init Python 3.11.4
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.11.4'
|
|
||||||
cache: 'pip'
|
|
||||||
|
|
||||||
- name: Install Dependent Packages
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install wheel pyinstaller
|
|
||||||
pip install -r requirements.txt
|
|
||||||
find app/plugins -name requirements.txt -exec pip install -r {} \;
|
|
||||||
|
|
||||||
- name: Prepare Frontend
|
|
||||||
run: |
|
|
||||||
wget https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip
|
|
||||||
unzip main.zip
|
|
||||||
mv MoviePilot-Plugins-main/plugins/* app/plugins/
|
|
||||||
rm main.zip
|
|
||||||
rm -rf MoviePilot-Plugins-main
|
|
||||||
|
|
||||||
wget https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip
|
|
||||||
unzip main.zip
|
|
||||||
mv MoviePilot-Resources-main/resources/* app/helper/
|
|
||||||
rm main.zip
|
|
||||||
rm -rf MoviePilot-Resources-main
|
|
||||||
|
|
||||||
- name: Pyinstaller
|
|
||||||
run: |
|
|
||||||
pyinstaller frozen.spec
|
|
||||||
mv dist/MoviePilot dist/MoviePilot_Amd64
|
|
||||||
|
|
||||||
- name: Upload Linux File
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: linux-amd64
|
|
||||||
path: dist/MoviePilot_Amd64
|
|
||||||
|
|
||||||
Create-release:
|
|
||||||
permissions: write-all
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [ Windows-build, Docker-build, Linux-build-amd64]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Release Version
|
|
||||||
id: release_version
|
|
||||||
run: |
|
|
||||||
app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
|
|
||||||
echo "app_version=$app_version" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Download Artifact
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
|
|
||||||
- name: get release_informations
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir releases
|
|
||||||
mv ./windows/MoviePilot.exe ./releases/MoviePilot_Win_v${{ env.app_version }}.exe
|
|
||||||
mv ./linux-amd64/MoviePilot_Amd64 ./releases/MoviePilot_Amd64_v${{ env.app_version }}
|
|
||||||
|
|
||||||
- name: Create Release
|
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@latest
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
tag_name: v${{ env.app_version }}
|
|
||||||
release_name: v${{ env.app_version }}
|
|
||||||
body: ${{ github.event.commits[0].message }}
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
|
|
||||||
- name: Upload Release Asset
|
|
||||||
uses: dwenegar/upload-release-assets@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
release_id: ${{ steps.create_release.outputs.id }}
|
|
||||||
assets_path: |
|
|
||||||
./releases/
|
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,7 +4,6 @@ build/
|
|||||||
dist/
|
dist/
|
||||||
nginx/
|
nginx/
|
||||||
test.py
|
test.py
|
||||||
app/helper/sites.py
|
|
||||||
app/helper/*.so
|
app/helper/*.so
|
||||||
app/helper/*.pyd
|
app/helper/*.pyd
|
||||||
app/helper/*.bin
|
app/helper/*.bin
|
||||||
|
@@ -15,6 +15,9 @@ ENV LANG="C.UTF-8" \
|
|||||||
AUTH_SITE="iyuu" \
|
AUTH_SITE="iyuu" \
|
||||||
IYUU_SIGN=""
|
IYUU_SIGN=""
|
||||||
WORKDIR "/app"
|
WORKDIR "/app"
|
||||||
|
|
||||||
|
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources
|
||||||
|
|
||||||
RUN apt-get update -y \
|
RUN apt-get update -y \
|
||||||
&& apt-get upgrade -y \
|
&& apt-get upgrade -y \
|
||||||
&& apt-get -y install \
|
&& apt-get -y install \
|
||||||
@@ -50,6 +53,9 @@ RUN apt-get update -y \
|
|||||||
/var/lib/apt/lists/* \
|
/var/lib/apt/lists/* \
|
||||||
/var/tmp/*
|
/var/tmp/*
|
||||||
COPY requirements.txt requirements.txt
|
COPY requirements.txt requirements.txt
|
||||||
|
|
||||||
|
RUN pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
|
||||||
|
|
||||||
RUN apt-get update -y \
|
RUN apt-get update -y \
|
||||||
&& apt-get install -y build-essential \
|
&& apt-get install -y build-essential \
|
||||||
&& pip install --upgrade pip \
|
&& pip install --upgrade pip \
|
||||||
@@ -82,8 +88,6 @@ RUN cp -f /app/nginx.conf /etc/nginx/nginx.template.conf \
|
|||||||
&& mv /dist /public \
|
&& mv /dist /public \
|
||||||
&& curl -sL "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" | busybox unzip -d /tmp - \
|
&& curl -sL "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" | busybox unzip -d /tmp - \
|
||||||
&& mv -f /tmp/MoviePilot-Plugins-main/plugins/* /app/app/plugins/ \
|
&& mv -f /tmp/MoviePilot-Plugins-main/plugins/* /app/app/plugins/ \
|
||||||
&& curl -sL "https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip" | busybox unzip -d /tmp - \
|
|
||||||
&& mv -f /tmp/MoviePilot-Resources-main/resources/* /app/app/helper/ \
|
|
||||||
&& rm -rf /tmp/*
|
&& rm -rf /tmp/*
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
VOLUME [ "/config" ]
|
VOLUME [ "/config" ]
|
||||||
|
@@ -179,9 +179,9 @@ class SubscribeChain(ChainBase):
|
|||||||
text = f"评分:{mediainfo.vote_average}"
|
text = f"评分:{mediainfo.vote_average}"
|
||||||
# 群发
|
# 群发
|
||||||
if mediainfo.type == MediaType.TV:
|
if mediainfo.type == MediaType.TV:
|
||||||
link = settings.MP_DOMAIN('#/subscribe-tv?tab=mysub')
|
link = settings.MP_DOMAIN('#/subscribe/tv?tab=mysub')
|
||||||
else:
|
else:
|
||||||
link = settings.MP_DOMAIN('#/subscribe-movie?tab=mysub')
|
link = settings.MP_DOMAIN('#/subscribe/movie?tab=mysub')
|
||||||
self.post_message(Notification(mtype=NotificationType.Subscribe,
|
self.post_message(Notification(mtype=NotificationType.Subscribe,
|
||||||
title=f"{mediainfo.title_year} {metainfo.season} 已添加订阅",
|
title=f"{mediainfo.title_year} {metainfo.season} 已添加订阅",
|
||||||
text=text,
|
text=text,
|
||||||
@@ -922,9 +922,9 @@ class SubscribeChain(ChainBase):
|
|||||||
self.subscribeoper.delete(subscribe.id)
|
self.subscribeoper.delete(subscribe.id)
|
||||||
# 发送通知
|
# 发送通知
|
||||||
if mediainfo.type == MediaType.TV:
|
if mediainfo.type == MediaType.TV:
|
||||||
link = settings.MP_DOMAIN('#/subscribe-tv?tab=mysub')
|
link = settings.MP_DOMAIN('#/subscribe/tv?tab=mysub')
|
||||||
else:
|
else:
|
||||||
link = settings.MP_DOMAIN('#/subscribe-movie?tab=mysub')
|
link = settings.MP_DOMAIN('#/subscribe/movie?tab=mysub')
|
||||||
self.post_message(Notification(mtype=NotificationType.Subscribe,
|
self.post_message(Notification(mtype=NotificationType.Subscribe,
|
||||||
title=f'{mediainfo.title_year} {meta.season} 已完成{msgstr}',
|
title=f'{mediainfo.title_year} {meta.season} 已完成{msgstr}',
|
||||||
image=mediainfo.get_message_image(),
|
image=mediainfo.get_message_image(),
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import copy
|
||||||
import importlib
|
import importlib
|
||||||
import threading
|
import threading
|
||||||
import traceback
|
import traceback
|
||||||
@@ -11,8 +12,7 @@ from app.chain.subscribe import SubscribeChain
|
|||||||
from app.chain.system import SystemChain
|
from app.chain.system import SystemChain
|
||||||
from app.chain.transfer import TransferChain
|
from app.chain.transfer import TransferChain
|
||||||
from app.core.config import settings
|
from app.core.config import settings
|
||||||
from app.core.event import Event as ManagerEvent
|
from app.core.event import Event as ManagerEvent, eventmanager, EventManager
|
||||||
from app.core.event import eventmanager, EventManager
|
|
||||||
from app.core.plugin import PluginManager
|
from app.core.plugin import PluginManager
|
||||||
from app.helper.message import MessageHelper
|
from app.helper.message import MessageHelper
|
||||||
from app.helper.thread import ThreadHelper
|
from app.helper.thread import ThreadHelper
|
||||||
@@ -194,7 +194,7 @@ class Command(metaclass=Singleton):
|
|||||||
# 插件事件
|
# 插件事件
|
||||||
self.threader.submit(
|
self.threader.submit(
|
||||||
self.pluginmanager.run_plugin_method,
|
self.pluginmanager.run_plugin_method,
|
||||||
class_name, method_name, event
|
class_name, method_name, copy.deepcopy(event)
|
||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@@ -217,7 +217,7 @@ class Command(metaclass=Singleton):
|
|||||||
if hasattr(class_obj, method_name):
|
if hasattr(class_obj, method_name):
|
||||||
self.threader.submit(
|
self.threader.submit(
|
||||||
getattr(class_obj, method_name),
|
getattr(class_obj, method_name),
|
||||||
event
|
copy.deepcopy(event)
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"事件处理出错:{str(e)} - {traceback.format_exc()}")
|
logger.error(f"事件处理出错:{str(e)} - {traceback.format_exc()}")
|
||||||
|
37
app/helper/sites.py
Normal file
37
app/helper/sites.py
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
from app.schemas import Plugin
|
||||||
|
|
||||||
|
|
||||||
|
class SitesHelper:
|
||||||
|
"""
|
||||||
|
站点信息
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.auth_level = 3
|
||||||
|
self.auth_version = "1.3.2"
|
||||||
|
self.indexer_version = "1.4.7"
|
||||||
|
self.sites = [{
|
||||||
|
id: "1",
|
||||||
|
"domain": "rarbg",
|
||||||
|
}]
|
||||||
|
|
||||||
|
def get_indexer(self, domain: str) -> dict:
|
||||||
|
"""
|
||||||
|
获取站点信息
|
||||||
|
"""
|
||||||
|
for site in self.sites:
|
||||||
|
if site.get("domain") == domain:
|
||||||
|
return site
|
||||||
|
return {}
|
||||||
|
|
||||||
|
def get_indexers(self) -> list:
|
||||||
|
"""
|
||||||
|
获取所有站点信息
|
||||||
|
"""
|
||||||
|
return self.sites
|
||||||
|
|
||||||
|
def check(self, domain: str) -> tuple:
|
||||||
|
return True, ""
|
||||||
|
|
||||||
|
def check_user(self) -> tuple:
|
||||||
|
return True, ""
|
@@ -219,12 +219,13 @@ class FileTransferModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
# 字幕正则式
|
# 字幕正则式
|
||||||
_zhcn_sub_re = r"([.\[(](((zh[-_])?(cn|ch[si]|sg|sc))|zho?" \
|
_zhcn_sub_re = r"([.\[(](((zh[-_])?(cn|ch[si]|sg|sc))|zho?" \
|
||||||
r"|chinese|(cn|ch[si]|sg|zho?|eng)[-_&](cn|ch[si]|sg|zho?|eng)" \
|
r"|chinese|(cn|ch[si]|sg|zho?|eng)[-_&]?(cn|ch[si]|sg|zho?|eng)" \
|
||||||
r"|简[体中]?)[.\])])" \
|
r"|简[体中]?)[.\])])" \
|
||||||
r"|([\u4e00-\u9fa5]{0,3}[中双][\u4e00-\u9fa5]{0,2}[字文语][\u4e00-\u9fa5]{0,3})" \
|
r"|([\u4e00-\u9fa5]{0,3}[中双][\u4e00-\u9fa5]{0,2}[字文语][\u4e00-\u9fa5]{0,3})" \
|
||||||
r"|简体|简中|JPSC" \
|
r"|简体|简中|JPSC" \
|
||||||
r"|(?<![a-z0-9])gb(?![a-z0-9])"
|
r"|(?<![a-z0-9])gb(?![a-z0-9])"
|
||||||
_zhtw_sub_re = r"([.\[(](((zh[-_])?(hk|tw|cht|tc))" \
|
_zhtw_sub_re = r"([.\[(](((zh[-_])?(hk|tw|cht|tc))" \
|
||||||
|
r"|(cht|eng)[-_&]?(cht|eng)" \
|
||||||
r"|繁[体中]?)[.\])])" \
|
r"|繁[体中]?)[.\])])" \
|
||||||
r"|繁体中[文字]|中[文字]繁体|繁体|JPTC" \
|
r"|繁体中[文字]|中[文字]繁体|繁体|JPTC" \
|
||||||
r"|(?<![a-z0-9])big5(?![a-z0-9])"
|
r"|(?<![a-z0-9])big5(?![a-z0-9])"
|
||||||
|
@@ -1 +1 @@
|
|||||||
APP_VERSION = 'v1.9.12'
|
APP_VERSION = 'v1.9.16'
|
||||||
|
Reference in New Issue
Block a user