Skip to content

Commit

Permalink
Merge pull request #271 from EstrellaXD/3.0-dev
Browse files Browse the repository at this point in the history
3.0
  • Loading branch information
EstrellaXD authored Jun 1, 2023
2 parents 344a8ff + 660eb7d commit 76e7e0f
Show file tree
Hide file tree
Showing 109 changed files with 3,108 additions and 1,694 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ config/bangumi.json/config/bangumi.json
dist.zip
data
config
/src/config
/src/data
.pytest_cache
test
.env
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/dev-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- name: Test
working-directory: ./src
run: |
mkdir -p config
pytest
dev-latest:
Expand All @@ -43,6 +44,17 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
estrellaxd/auto_bangumi
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ github.ref_name }}
type=raw,value=dev-latest
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
Expand All @@ -53,27 +65,23 @@ jobs:
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GITHUB_USERNAME }}
username: ${{ github.actor }}
password: ${{ secrets.ACCESS_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: |
estrellaxd/auto_bangumi:dev-latest
estrellaxd/auto_bangumi:${{ github.ref_name }}
ghcr.io/estrellaxd/auto_bangumi:dev-latest
ghcr.io/estrellaxd/auto_bangumi:${{ github.ref_name }}
tags: ${{ steps.meta.outputs.tags }}
file: Dockerfile

generate_release:
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Generate Release
uses: softprops/action-gh-release@v1
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- name: Test
working-directory: ./src
run: |
mkdir -p config
pytest

Expand Down Expand Up @@ -50,6 +51,7 @@ jobs:
with:
images: |
estrellaxd/auto_bangumi
ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
Expand All @@ -74,11 +76,9 @@ jobs:
with:
context: .
builder: ${{ steps.buildx.output.name }}
platforms: linux/amd64,linux/arm64,linux/arm
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: ${{ github.event_name == 'push' }}
tags: |
docker.io/estrellaxd/auto_bangumi:${{ steps.meta.outputs.tags }}
ghcr.io/estrellaxd/auto_bangumi:${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
32 changes: 32 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Create Pull Request

on:
push:
tags:
- '\d+\.\d+\.\d+'
- '\d+\.\d+'

jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Generate pull request body
id: pr
run: |
echo "docs/changelog/${{ github.ref }}.md"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.ACCESS_TOKEN }}
commit-message: 'chore: release ${{ github.ref }}'
title: 'chore: release ${{ github.ref }}'
body: |
${{ steps.pr.outputs.body }}
branch: release/${{ github.ref }}
base: main
labels: release
draft: false
branch-suffix: timestamp
delete-branch: false
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM python:3.11-alpine AS APP
FROM alpine:3.18 AS APP

ENV S6_SERVICES_GRACETIME=30000 \
S6_KILL_GRACETIME=60000 \
Expand All @@ -18,12 +18,21 @@ WORKDIR /app

COPY requirements.txt .
RUN apk add --no-cache \
bash \
ca-certificates \
coreutils \
curl \
jq \
shadow \
netcat-openbsd \
procps-ng \
python3 \
py3-bcrypt \
py3-pip \
s6-overlay \
bash && \
shadow \
tzdata && \
python3 -m pip install --upgrade pip && \
sed -i '/bcrypt/d' requirements.txt && \
pip install --no-cache-dir -r requirements.txt && \
# Download WebUI
curl -sL "https://github.com/Rewrite0/Auto_Bangumi_WebUI/releases/latest/download/dist.zip" | busybox unzip -q -d /app - && \
Expand Down
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,32 @@
<p align="center">
<img src="https://github.com/EstrellaXD/Auto_Bangumi/blob/main/docs/image/auto_bangumi_v2.png#gh-light-mode-only" width=50%/ alt="">
<img src="https://github.com/EstrellaXD/Auto_Bangumi/blob/main/docs/image/auto_bangumi_icon_v2-dark.png#gh-dark-mode-only" width=50%/ alt="">
<img src="docs/image/light-icon.png#gh-light-mode-only" width=50%/ alt="">
<img src="docs/image/dark-icon.png#gh-dark-mode-only" width=50%/ alt="">
</p>
<p align="center">
<img title="docker build version" src="https://img.shields.io/docker/v/estrellaxd/auto_bangumi" alt="">
<img title="release date" src="https://img.shields.io/github/release-date/estrellaxd/auto_bangumi" alt="">
<img title="docker pull" src="https://img.shields.io/docker/pulls/estrellaxd/auto_bangumi" alt="">
<img title="python version" src="https://img.shields.io/badge/python-3.11-blue" alt="">
<img title="telegram" src="https://img.shields.io/badge/telegram-autobangumi_update-blue" herf="https://t.me/autobangumi_update" alt="">
</p>


# 项目说明

<p align="center">
<img title="mikan project" src="https://mikanani.me/images/mikan-pic.png" alt="" width="10%">
<img title="qbittorrent" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/New_qBittorrent_Logo.svg/600px-New_qBittorrent_Logo.svg.png" width="10%">
<img title="AutoBangumi" src="docs/image/window.png" alt="" width=75%>
</p>

本项目是基于 [Mikan Project](https://mikanani.me)[qBittorrent](https://qbittorrent.org) 的全自动追番整理下载工具。只需要在 [Mikan Project](https://mikanani.me) 上订阅番剧,就可以全自动追番。并且整理完成的名称和目录可以直接被 [Plex]()[Jellyfin]() 等媒体库软件识别,无需二次刮削。

基于 [infuse](https://firecore.com/infuse)[Plex](https://plex.tv) 的效果如下:

<img title="plex" src="https://tva1.sinaimg.cn/large/e6c9d24ely1h47zd0v04zj21a50u0gvr.jpg" alt="" width=50%><img title="infuse" src="https://tva1.sinaimg.cn/large/e6c9d24ely1h47zd0gqz3j21a50u0dqc.jpg" alt="" width=50%>

[主项目地址](https://www.github.com/EstrellaXD/Auto_Bangumi)
/ [WebUI 仓库](https://github.com/Rewrite0/Auto_Bangumi_WebUI)
/ [WebUI 仓库](https://github.com/Rewrite0/Auto_Bangumi_WebUI)
/ [Wiki 说明](https://www.github.com/EstrellaXD/Auto_Bangumi/wiki)


## AutoBangumi 功能说明

- 简易单次配置就能持续使用
- 无需介入的 `RSS` 解析器,解析番组信息并且自动生成下载规则。
- 番剧文件整理:

```
Bangumi
├── bangumi_A_title
Expand All @@ -50,12 +43,15 @@
├── bangumi_B_title
│   └─── Season 1
```
- 全自动重命名,重命名后 95% 以上的番剧可以直接被媒体库软件直接刮削
- 全自动重命名,重命名后 99% 以上的番剧可以直接被媒体库软件直接刮削
```
[Lilith-Raws] Kakkou no Iinazuke - 07 [Baha][WEB-DL][1080p][AVC AAC][CHT][MP4].mp4
>>
Kakkou no Iinazuke S01E07.mp4
```

- 自定义重命名,可以根据上级文件夹对所有子文件重命名。
- 季中追番可以补全当季遗漏的所有剧集
- 高度可自定义的功能选项,可以针对不同媒体库软件微调
Expand All @@ -77,21 +73,24 @@
## Roadmap

***开发中的功能:***

- Web UI #57
- 文件统一整理,对单个规则或者文件微调文件夹可以自动调整所有对应的文件。
- 通知功能,可以通过 IFTTT 等方式通知用户番剧更新进度。✅
- 剧场版以及合集的支持。✅
- 各类 API 接口。

***计划开发的功能:***

- 对其他站点种子的解析归类。
- 本地化番剧订阅方式。
- Transmission & Aria2 的支持。
- 更完善的 WebUI。


# 声明

## 致谢

感谢 [Sean](https://github.com/findix) 提供的大量帮助
感谢 [Rewrite0](https://github.com/Rewrite0) 开发的 WebUI

Expand All @@ -100,6 +99,5 @@
[![Star History Chart](https://api.star-history.com/svg?repos=EstrellaXD/Auto_Bangumi&type=Date)](https://star-history.com/#EstrellaXD/Auto_Bangumi)

## Licence
[MIT licence](https://github.com/EstrellaXD/Auto_Bangumi/blob/main/LICENSE)


[MIT licence](https://github.com/EstrellaXD/Auto_Bangumi/blob/main/LICENSE)
24 changes: 24 additions & 0 deletions dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash


# This script is used to run the development environment.

python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple install -r requirements.txt

cd src || exit

CONFIG_DIR="config"

if [ ! -d "$CONFIG_DIR" ]; then
echo "The directory '$CONFIG_DIR' is missing."
mkdir config
fi

VERSION_FILE="module/__version__.py"

if [ ! -f "$VERSION_FILE" ]; then
echo "The file '$VERSION_FILE' is missing."
echo "VERSION='DEV_VERSION'" >> "$VERSION_FILE"
fi

python3 main.py
46 changes: 46 additions & 0 deletions docs/changelog/3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## New

### 全新的 WebUI

- 登陆功能,现在 AB 可以设定用户名和密码进行登陆。部分操作需要在登陆后才可以进行。
- 全新的海报墙
- 番剧管理功能
- 可以对番剧的季度信息名称进行修改,修改完成之后会自动修改**自动下载规则**/**已经下载完成的文件路径**, 并重命名。
- 全新的链接解析器,解析完成链接之后可以手动更改下载信息,选择下载季度或者增加自动下载规则。
- 删除番剧,可以一键删除番剧以及其种子文件。
- 可以对单独番剧自定义下载规则,此规则与全局规则不冲突。
- 全新的配置界面,可以更方便的配置应用程序规则。
- 新增初始化启动页面,在第一次启动 AB 时会引导填入相关配置。
- 下载器链接检查器,可以检查与 qBittorrent 的连通性
- RSS 地址检查器,可以检查 RSS 是否有效。
- 新增程序管理按钮,可以在 WebUI 中启动停止程序。且可以重启容器。

### 解析器

- 全新的解析器,可以选择不同类型来源获取官方标题和海报地址。
- 支持更换 RSS 订阅源而不用重新生成数据库。

### 通知模块

- 新增 `Bark` 通知模块.
- 全新的通知方式,现在可以给 Telegram 推送海报,番剧名称,更新集数。

### 数据迁移

- 现在从旧版本升级可以自动迁移数据。
- 从旧版本迁移的数据也可以自动匹配海报。

## Fix

- 针对 Windows 路径可能出现的重命名 Bug。

## Change

-`json` 迁移至 `sqlite` 存储数据
- 从多进程迁移至多线程
- 重构主程序
- 加速启动关闭时间
- 重构解析器模块
- 重构重命名模块
- 暂时移除 `normal` 模式
- 增加 `ghcr.io` 镜像
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ services:
- PGID=${GID}
- PUID=${UID}
- AB_DOWNLOADER_HOST=qbittorrent:${QB_PORT}
- AB_RSS=${AB_RSS}
- AB_DOWNLOAD_PATH=/downloads/Bangumi
volumes:
- ./config:/app/config
- ./data:/app/data
Expand Down
Binary file removed docs/image/auto_bangumi_icon_v2-dark.png
Binary file not shown.
Binary file removed docs/image/auto_bangumi_v2.png
Binary file not shown.
Binary file added docs/image/dark-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/image/light-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/image/window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/wiki
Submodule wiki updated from 9dc9f4 to df8c30
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
anyio
beautifulsoup4
bs4
certifi
charset-normalizer
click
Expand All @@ -19,3 +19,7 @@ uvicorn
attrdict
jinja2
python-dotenv
python-jose
passlib
bcrypt
python-multipart
Loading

0 comments on commit 76e7e0f

Please sign in to comment.