├── .github └── workflows │ └── container-build.yml ├── .gitignore ├── Dockerfile ├── README.md ├── README_chs.md ├── app.json ├── content ├── Caddyfile ├── aria2 │ ├── aria2_chs.conf │ ├── aria2_en.conf │ ├── clean.sh │ ├── core │ ├── delete.sh │ ├── dht.dat │ ├── tracker.sh │ └── upload.sh ├── bashrc ├── callapi.sh ├── entrypoint.sh ├── gallery-dl.conf ├── gdltorclone.sh ├── homer_conf │ ├── AriaNg.ico │ ├── OliveTin.png │ ├── filebrowser.png │ ├── homer_chs.yml │ ├── homer_en.yml │ ├── pyload.png │ ├── qbit.ico │ ├── rcloneng.png │ ├── ttyd.png │ └── vue.png ├── install.sh ├── olivetin_config.yaml ├── pyload.cfg ├── pyload_to_rclone.sh ├── pyload_to_rclone_package_extracted.sh ├── qbit.conf ├── qbittorclone.sh ├── rclone_options.conf ├── rclonejobstatus.sh ├── script.conf ├── script_core.sh ├── service │ ├── 1 │ │ ├── log │ │ │ └── run │ │ └── run │ ├── 2 │ │ ├── log │ │ │ └── run │ │ └── run │ ├── 4 │ │ ├── log │ │ │ └── run │ │ └── run │ ├── 5 │ │ ├── log │ │ │ └── run │ │ └── run │ ├── 6 │ │ ├── log │ │ │ └── run │ │ └── run │ ├── backup_files │ │ ├── log │ │ │ └── run │ │ └── run │ ├── caddy │ │ ├── log │ │ │ └── run │ │ └── run │ ├── filebrowser │ │ ├── log │ │ │ └── run │ │ └── run │ ├── nodestatus-client │ │ ├── log │ │ │ └── run │ │ └── run │ ├── olivetin │ │ ├── log │ │ │ └── run │ │ └── run │ └── ttyd │ │ ├── log │ │ └── run │ │ └── run ├── ytdlp.sh ├── ytdlptorclone.sh ├── ytdlptotg.sh ├── ytdlpup.sh └── ytdlpuptg.sh ├── docs ├── README_colab.md ├── README_colab_chs.md ├── README_docker.md ├── README_docker_chs.md ├── README_doprax.md ├── README_doprax_chs.md ├── README_heroku.md └── README_heroku_chs.md ├── heroku.yml └── screenshots ├── branch.png ├── colab.jpeg ├── colab_chs.jpeg ├── deploy.png ├── docker.jpeg ├── docker_chs.jpeg ├── doprax.jpeg ├── doprax_chs.jpeg ├── heroku.jpeg ├── heroku_chs.jpeg └── volume.png /.github/workflows/container-build.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | # This workflow uses actions that are not certified by GitHub. 4 | # They are provided by a third-party and are governed by 5 | # separate terms of service, privacy policy, and support 6 | # documentation. 7 | 8 | on: 9 | push: 10 | # Publish semver tags as releases. 11 | tags: [ 'v*.*.*' ] 12 | 13 | env: 14 | # Use docker.io for Docker Hub if empty 15 | REGISTRY: ghcr.io 16 | # github.repository as / 17 | IMAGE_NAME: ${{ github.repository }} 18 | 19 | jobs: 20 | docker: 21 | runs-on: ubuntu-latest 22 | steps: 23 | 24 | - name: Checkout repository 25 | uses: actions/checkout@v3 26 | 27 | - name: Set up Docker Buildx 28 | uses: docker/setup-buildx-action@v2 29 | 30 | - name: Log into registry ${{ env.REGISTRY }} 31 | if: github.event_name != 'pull_request' 32 | uses: docker/login-action@v2 33 | with: 34 | registry: ${{ env.REGISTRY }} 35 | username: ${{ github.actor }} 36 | password: ${{ secrets.GITHUB_TOKEN }} 37 | 38 | - name: Extract Docker metadata 39 | id: meta 40 | uses: docker/metadata-action@v4 41 | with: 42 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 43 | flavor: | 44 | latest=true 45 | tags: | 46 | type=ref,event=branch 47 | type=ref,event=pr 48 | type=semver,pattern={{version}} 49 | type=semver,pattern={{major}}.{{minor}} 50 | 51 | - name: Build and push Docker image 52 | id: build-and-push 53 | uses: docker/build-push-action@v3 54 | with: 55 | builder: ${{ steps.buildx.outputs.name }} 56 | context: . 57 | push: true 58 | tags: ${{ steps.meta.outputs.tags }} 59 | labels: ${{ steps.meta.outputs.labels }} 60 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /README.md 2 | /README_chs.md -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:alpine 2 | 3 | COPY ./content /workdir/ 4 | 5 | RUN apk add --no-cache curl caddy jq bash runit tzdata ttyd p7zip ffmpeg findutils \ 6 | && chmod +x /workdir/service/*/run /workdir/service/*/log/run /workdir/*.sh \ 7 | && /workdir/install.sh \ 8 | && rm -rf /workdir/install.sh /tmp/* ${HOME}/.cache ${HOME}/.cargo 9 | 10 | ENV PORT=3000 11 | ENV GLOBAL_USER=admin 12 | ENV GLOBAL_PASSWORD=password 13 | ENV GLOBAL_LANGUAGE=en 14 | ENV GLOBAL_PORTAL_PATH=/mypath 15 | ENV TZ=UTC 16 | 17 | EXPOSE 3000 18 | 19 | ENTRYPOINT ["sh","/workdir/entrypoint.sh"] 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [点击前往中文说明](README_chs.md) 2 | 3 | ## Attention 4 | - Anyone who can login into this app has full access to data in this app and Rclone remotes. Do not share with other ppl, and do not store sensitive information with this app. 5 | 6 | This project integrates yt-dlp, Aria2, gallery-dl, qBittorrent, pyLoad Download Manager, rclone auto-upload, Telegram notification and their WebUI plus other Web Apps into a single package which is easy to deploy. 7 | 8 | ## [Docker Deployment](docs/README_docker.md) 9 | 10 |
11 | Screenshot 12 | 13 | ![avatar](screenshots/docker.jpeg) 14 | 15 |
16 | 17 | 26 | ## [Heroku Deployment](docs/README_heroku.md) 27 | 28 | Heroku stopped offering free product plans and shut down free dynos starting Nov. 28, 2022. 29 | 30 |
31 | Screenshot 32 | 33 | ![avatar](screenshots/heroku.jpeg) 34 | 35 |
36 | 37 | ## [Doprax Deployment](docs/README_doprax.md) 38 | 39 | Doprax has stopped offering free plan. 40 | 41 |
42 | Screenshot 43 | 44 | ![avatar](screenshots/doprax.jpeg) 45 | 46 |
47 | 48 | ## Acknowledgments 49 | 50 | - [alexta69/metube](https://github.com/alexta69/metube) Simple and easy-to-use yt-dlp frontend. 51 | - [P3TERX/aria2.conf](https://github.com/P3TERX/aria2.conf) Rely on the Aria2 script from P3TERX to automatically trigger the Rclone upload after the Aria2 downloads completed. 52 | - [wahyd4/aria2-ariang-docker](https://github.com/wahyd4/aria2-ariang-docker) Inspiration for this project. 53 | - [bastienwirtz/homer](https://github.com/bastienwirtz/homer) A very simple static homepage for your server. 54 | - [mayswind/AriaNg](https://github.com/mayswind/AriaNg) | [filebrowser/filebrowser](https://github.com/filebrowser/filebrowser) | [aria2/aria2](https://github.com/aria2/aria2) | [rclone/rclone](https://github.com/rclone/rclone) | [yt-dlp/yt-dlp](https://github.com/yt-dlp/yt-dlp) | [userdocs/qbittorrent-nox-static](https://github.com/userdocs/qbittorrent-nox-static) | [WDaan/VueTorrent](https://github.com/WDaan/VueTorrent) | [OliveTin/OliveTin](https://github.com/OliveTin/OliveTin) | [pyload/pyload](https://github.com/pyload/pyload) | [mikf/gallery-dl](https://github.com/mikf/gallery-dl) -------------------------------------------------------------------------------- /README_chs.md: -------------------------------------------------------------------------------- 1 | ## 注意 2 | 3 | - 所有可以登陆此APP的用户可以访问/修改此APP以及Rclone远程存储的所有数据,不要存放敏感数据,不要与他人共享使用。 4 | 5 | 本项目集成了yt-dlp、Aria2、gallery-dl、qBittorrent、pyLoad下载管理器、Rclone联动自动上传功能、Telegram任务完成通知以及它们的WebUI和更多Web应用。 6 | 7 | ## [Docker 部署](docs/README_docker_chs.md) 8 | 9 |
10 | 截图 11 | 12 | ![avatar](screenshots/docker_chs.jpeg) 13 | 14 |
15 | 16 | 25 | ## [Heroku 部署](docs/README_heroku_chs.md) 26 | 27 | Heroku已于2022年11月关闭免费服务 28 | 29 |
30 | 截图 31 | 32 | ![avatar](screenshots/heroku_chs.jpeg) 33 | 34 |
35 | 36 | ## [Doprax 部署](docs/README_doprax_chs.md) 37 | 38 | Doprax 已停止提供免费服务 39 | 40 |
41 | 截图 42 | 43 | ![avatar](screenshots/doprax_chs.jpeg) 44 | 45 |
46 | 47 | ## 鸣谢 48 | 49 | - [alexta69/metube](https://github.com/alexta69/metube) 简洁好用的yt-dlp前端。 50 | - [P3TERX/aria2.conf](https://github.com/P3TERX/aria2.conf) 依靠来自P3TERX的Aria2脚本,实现了Aria2下载完成自动触发Rclone上传。 51 | - [wahyd4/aria2-ariang-docker](https://github.com/wahyd4/aria2-ariang-docker) 启发了本项目的总体思路。 52 | - [bastienwirtz/homer](https://github.com/bastienwirtz/homer) 使用yaml配置文件的静态导航页,便于自定义。 53 | - [mayswind/AriaNg](https://github.com/mayswind/AriaNg) | [filebrowser/filebrowser](https://github.com/filebrowser/filebrowser) | [aria2/aria2](https://github.com/aria2/aria2) | [rclone/rclone](https://github.com/rclone/rclone) | [yt-dlp/yt-dlp](https://github.com/yt-dlp/yt-dlp) | [userdocs/qbittorrent-nox-static](https://github.com/userdocs/qbittorrent-nox-static) | [WDaan/VueTorrent](https://github.com/WDaan/VueTorrent) | [OliveTin/OliveTin](https://github.com/OliveTin/OliveTin) | [pyload/pyload](https://github.com/pyload/pyload) | [mikf/gallery-dl](https://github.com/mikf/gallery-dl) -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Deploy", 3 | "description": "Deploy", 4 | "keywords": ["Deploy"], 5 | "env": { 6 | "GLOBAL_USER": { 7 | "description": "Username for all web services except qbit", 8 | "value": "admin" 9 | }, 10 | "GLOBAL_PASSWORD": { 11 | "description": "Password for all web services except qbit, double as Aria2 RPC token. Recommend strong password.", 12 | "value": "password" 13 | }, 14 | "GLOBAL_LANGUAGE": { 15 | "description": "Set language of portal page, qbit & filebrowser.(en or chs)", 16 | "value": "en" 17 | }, 18 | "GLOBAL_PORTAL_PATH": { 19 | "description": "Portal page & base URL for all web services. Set this to an uncommon path. Do not set to blank or '/'", 20 | "value": "/mypath" 21 | }, 22 | "CLOUDFLARE_WORKERS_HOST": { 23 | "description": "Cloudflare workers service Hostname", 24 | "value": "example.example.workers.dev" 25 | }, 26 | "CLOUDFLARE_WORKERS_KEY": { 27 | "description": "Cloudflare workers service Key", 28 | "value": "mykey" 29 | }, 30 | "TZ": { 31 | "description": "Timezone", 32 | "value": "UTC" 33 | }, 34 | "NodeStatus_DSN": { 35 | "description": "Optional. NodeStatus server connection info, default blank value will disable NodeStatus. Example: wss://username:password@status.mydomain.com", 36 | "value": "" 37 | } 38 | }, 39 | "stack": "container" 40 | } 41 | -------------------------------------------------------------------------------- /content/Caddyfile: -------------------------------------------------------------------------------- 1 | # Created by wy580477 for customized container 2 | { 3 | log { 4 | exclude http.handlers.reverse_proxy 5 | } 6 | } 7 | :{$PORT} { 8 | encode gzip 9 | # Redirect http to https 10 | @http-req { 11 | header X-Forwarded-Proto http 12 | } 13 | redir @http-req https://{host}{uri} 14 | # Configure ttyd 15 | handle {$GLOBAL_PORTAL_PATH}/ttyd* { 16 | redir {$GLOBAL_PORTAL_PATH}/ttyd {$GLOBAL_PORTAL_PATH}/ttyd/ 17 | uri strip_prefix {$GLOBAL_PORTAL_PATH}/ttyd 18 | basicauth { 19 | {$GLOBAL_USER} HASH 20 | } 21 | reverse_proxy * localhost:61803 22 | } 23 | # Configure AriaNg 24 | handle {$GLOBAL_PORTAL_PATH}/ariang* { 25 | redir {$GLOBAL_PORTAL_PATH}/ariang {$GLOBAL_PORTAL_PATH}/ariang/ 26 | uri strip_prefix {$GLOBAL_PORTAL_PATH}/ariang 27 | basicauth { 28 | {$GLOBAL_USER} HASH 29 | } 30 | root * /workdir/ariang 31 | file_server 32 | } 33 | # Configure qbittorrent 34 | handle {$GLOBAL_PORTAL_PATH}/qbit* { 35 | redir {$GLOBAL_PORTAL_PATH}/qbit {$GLOBAL_PORTAL_PATH}/qbit/ 36 | uri strip_prefix {$GLOBAL_PORTAL_PATH}/qbit 37 | reverse_proxy * { 38 | to localhost:61804 39 | header_up Host "127.0.0.1:61804" 40 | } 41 | } 42 | # Direct /api to qBittorrent WebUI port, for connecting from services which don't support custom path. 43 | #handle /api* { 44 | # reverse_proxy * localhost:61804 45 | #} 46 | # Configure Vuetorrent 47 | handle {$GLOBAL_PORTAL_PATH}/vue* { 48 | redir {$GLOBAL_PORTAL_PATH}/vue {$GLOBAL_PORTAL_PATH}/vue/ 49 | uri strip_prefix {$GLOBAL_PORTAL_PATH}/vue 50 | handle /api* { 51 | reverse_proxy * { 52 | to localhost:61804 53 | header_up Host "127.0.0.1:61804" 54 | } 55 | } 56 | root * /workdir/vuetorrent/public 57 | file_server 58 | } 59 | # Configure Rclone Web UI 60 | handle {$GLOBAL_PORTAL_PATH}/rcloneweb* { 61 | redir {$GLOBAL_PORTAL_PATH}/rcloneweb {$GLOBAL_PORTAL_PATH}/rcloneweb/ 62 | uri strip_prefix {$GLOBAL_PORTAL_PATH}/rcloneweb 63 | basicauth { 64 | {$GLOBAL_USER} HASH 65 | } 66 | root * /workdir/rcloneweb/build 67 | file_server 68 | } 69 | # Configure Rclone RC 70 | handle_path {$GLOBAL_PORTAL_PATH}/rclonerc { 71 | reverse_proxy * localhost:61802 72 | } 73 | # Configure Rclone Serve 74 | handle_path {$GLOBAL_PORTAL_PATH}/rclonerc/* { 75 | reverse_proxy * localhost:61802 76 | } 77 | # Configure Rclone Serve Webdav 78 | handle {$GLOBAL_PORTAL_PATH}/rclonedav* { 79 | redir {$GLOBAL_PORTAL_PATH}/rclonedav {$GLOBAL_PORTAL_PATH}/rclonedav/ 80 | uri strip_prefix {$GLOBAL_PORTAL_PATH}/rclonedav 81 | reverse_proxy * localhost:61805 82 | } 83 | # Configure Aria2 RPC 84 | handle {$GLOBAL_PORTAL_PATH}/jsonrpc { 85 | uri replace {$GLOBAL_PORTAL_PATH}/jsonrpc /jsonrpc 86 | reverse_proxy /jsonrpc localhost:61800 87 | } 88 | handle {$GLOBAL_PORTAL_PATH}/rpc { 89 | uri replace {$GLOBAL_PORTAL_PATH}/rpc /rpc 90 | reverse_proxy /rpc localhost:61800 91 | } 92 | # Configure Filebrowser 93 | handle {$GLOBAL_PORTAL_PATH}/files* { 94 | reverse_proxy {$GLOBAL_PORTAL_PATH}/files* localhost:61801 95 | } 96 | # Configure OliveTin 97 | handle {$GLOBAL_PORTAL_PATH}/olivetin* { 98 | redir {$GLOBAL_PORTAL_PATH}/olivetin {$GLOBAL_PORTAL_PATH}/olivetin/ 99 | uri strip_prefix {$GLOBAL_PORTAL_PATH}/olivetin 100 | basicauth { 101 | {$GLOBAL_USER} HASH 102 | } 103 | reverse_proxy * localhost:61806 104 | } 105 | # Configure pyload 106 | handle {$GLOBAL_PORTAL_PATH}/pyload* { 107 | redir {$GLOBAL_PORTAL_PATH}/pyload {$GLOBAL_PORTAL_PATH}/pyload/ 108 | basicauth { 109 | {$GLOBAL_USER} HASH 110 | } 111 | reverse_proxy * localhost:61808 112 | } 113 | # Configure homer 114 | handle {$GLOBAL_PORTAL_PATH}* { 115 | redir {$GLOBAL_PORTAL_PATH} {$GLOBAL_PORTAL_PATH}/ 116 | uri strip_prefix {$GLOBAL_PORTAL_PATH} 117 | basicauth { 118 | {$GLOBAL_USER} HASH 119 | } 120 | root * /workdir/homer 121 | file_server 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /content/aria2/aria2_chs.conf: -------------------------------------------------------------------------------- 1 | # 2 | # https://github.com/P3TERX/aria2.conf 3 | # File name:aria2.conf 4 | # Description: Awesome Aria2 configuration file 5 | # Version: 2021.09.15 6 | # 7 | # Copyright (c) 2018-2021 P3TERX 8 | # 9 | # This is free software, licensed under the MIT License. 10 | # See /LICENSE for more informationo 11 | # 12 | # Modified by wy580477 for customized container 13 | # 14 | # 修改后,通过 ttyd 执行 "sv restart 2" 重启 aria2 服务后生效。 15 | # 16 | 17 | 18 | ## 文件保存设置 ## 19 | 20 | # 下载目录。可使用绝对路径或相对路径, 默认: 当前启动位置。 勿修改此项设置。 21 | dir=/mnt/data/aria2_downloads 22 | 23 | # 磁盘缓存, 0 为禁用缓存,默认:16M 24 | # 磁盘缓存的作用是把下载的数据块临时存储在内存中,然后集中写入硬盘,以减少磁盘 I/O ,提升读写性能,延长硬盘寿命。 25 | # 建议在有足够的内存空闲情况下适当增加,但不要超过剩余可用内存空间大小。 26 | # 此项值仅决定上限,实际对内存的占用取决于网速(带宽)和设备性能等其它因素。 27 | disk-cache=16M 28 | 29 | # 文件预分配方式, 可选:none, prealloc, trunc, falloc, 默认:prealloc 30 | # 预分配对于机械硬盘可有效降低磁盘碎片、提升磁盘读写性能、延长磁盘寿命。 31 | # 机械硬盘使用 ext4(具有扩展支持),btrfs,xfs 或 NTFS(仅 MinGW 编译版本)等文件系统建议设置为 falloc 32 | # 若无法下载,提示 fallocate failed.cause:Operation not supported 则说明不支持,请设置为 none 33 | # prealloc 分配速度慢, trunc 无实际作用,不推荐使用。 34 | # 固态硬盘不需要预分配,只建议设置为 none ,否则可能会导致双倍文件大小的数据写入,从而影响寿命。 35 | # 所需时间 none < falloc ? trunc « prealloc, falloc和trunc需要文件系统和内核支持 36 | file-allocation=none 37 | 38 | # 文件预分配大小限制。小于此选项值大小的文件不预分配空间,单位 K 或 M,默认:5M 39 | no-file-allocation-limit=64M 40 | 41 | # 断点续传 42 | continue=true 43 | 44 | # 始终尝试断点续传,无法断点续传则终止下载,默认:true 45 | always-resume=false 46 | 47 | # 不支持断点续传的 URI 数值,当 always-resume=false 时生效。 48 | # 达到这个数值从将头开始下载,值为 0 时所有 URI 不支持断点续传时才从头开始下载。 49 | max-resume-failure-tries=0 50 | 51 | # 获取服务器文件时间,默认:false 52 | remote-time=true 53 | 54 | 55 | ## 进度保存设置 ## 56 | 57 | # 从会话文件中读取下载任务 58 | input-file=/mnt/data/config/aria2.session 59 | 60 | # 会话文件保存路径,勿修改。 61 | # 在Aria2退出时保存`错误/未完成`的下载任务到会话文件 62 | save-session=/mnt/data/config/aria2.session 63 | 64 | # 任务状态改变后保存会话的间隔时间(秒), 0 为仅在进程正常退出时保存, 默认:0 65 | # 为了及时保存任务状态、防止任务丢失,此项值只建议设置为 1 66 | save-session-interval=1 67 | 68 | # 自动保存任务进度到控制文件(*.aria2)的间隔时间(秒),0 为仅在进程正常退出时保存,默认:60 69 | # 此项值也会间接影响从内存中把缓存的数据写入磁盘的频率 70 | # 想降低磁盘 IOPS (每秒读写次数)则提高间隔时间 71 | # 想在意外非正常退出时尽量保存更多的下载进度则降低间隔时间 72 | # 非正常退出:进程崩溃、系统崩溃、SIGKILL 信号、设备断电等 73 | auto-save-interval=5 74 | 75 | # 强制保存,即使任务已完成也保存信息到会话文件, 默认:false 76 | # 开启后会在任务完成后保留 .aria2 文件,文件被移除且任务存在的情况下重启后会重新下载。 77 | # 关闭后已完成的任务列表会在重启后清空。 78 | force-save=false 79 | 80 | 81 | ## 下载连接设置 ## 82 | 83 | # 文件未找到重试次数,默认:0 (禁用) 84 | # 重试时同时会记录重试次数,所以也需要设置 max-tries 这个选项 85 | max-file-not-found=10 86 | 87 | # 最大尝试次数,0 表示无限,默认:5 88 | max-tries=0 89 | 90 | # 重试等待时间(秒), 默认:0 (禁用) 91 | retry-wait=10 92 | 93 | # 连接超时时间(秒)。默认:60 94 | connect-timeout=10 95 | 96 | # 超时时间(秒)。默认:60 97 | timeout=10 98 | 99 | # 最大同时下载任务数, 运行时可修改, 默认:5 100 | max-concurrent-downloads=5 101 | 102 | # 单服务器最大连接线程数, 任务添加时可指定, 默认:1 103 | # 最大值为 16, 且受限于单任务最大连接线程数(split)所设定的值。 104 | max-connection-per-server=16 105 | 106 | # 单任务最大连接线程数, 任务添加时可指定, 默认:5 107 | split=64 108 | 109 | # 文件最小分段大小, 添加时可指定, 取值范围 1M-1024M (增强版最小值为 1K), 默认:20M 110 | # 比如此项值为 10M, 当文件为 20MB 会分成两段并使用两个来源下载, 文件为 15MB 则只使用一个来源下载。 111 | # 理论上值越小使用下载分段就越多,所能获得的实际线程数就越大,下载速度就越快,但受限于所下载文件服务器的策略。 112 | min-split-size=4M 113 | 114 | # HTTP/FTP 下载分片大小,所有分割都必须是此项值的倍数,最小值为 1M (增强版为 1K),默认:1M 115 | piece-length=1M 116 | 117 | # 允许分片大小变化。默认:false 118 | # false:当分片大小与控制文件中的不同时将会中止下载 119 | # true:丢失部分下载进度继续下载 120 | allow-piece-length-change=true 121 | 122 | # 最低下载速度限制。当下载速度低于或等于此选项的值时关闭连接,此选项与 BT 下载无关。单位 K 或 M ,默认:0 (无限制) 123 | lowest-speed-limit=0 124 | 125 | # 全局最大下载速度限制, 运行时可修改, 默认:0 (无限制) 126 | max-overall-download-limit=5M 127 | 128 | # 单任务下载速度限制, 默认:0 (无限制) 129 | max-download-limit=0 130 | 131 | # 禁用 IPv6, 默认:false. Heroku无ipv6网络,勿修改此项。 132 | disable-ipv6=true 133 | 134 | # GZip 支持,默认:false 135 | http-accept-gzip=true 136 | 137 | # URI 复用,默认: true 138 | reuse-uri=false 139 | 140 | # 禁用 netrc 支持,默认:false 141 | no-netrc=true 142 | 143 | # 允许覆盖,当相关控制文件(.aria2)不存在时从头开始重新下载。默认:false 144 | allow-overwrite=false 145 | 146 | # 文件自动重命名,此选项仅在 HTTP(S)/FTP 下载中有效。新文件名在名称之后扩展名之前加上一个点和一个数字(1..9999)。默认:true 147 | auto-file-renaming=true 148 | 149 | # 使用 UTF-8 处理 Content-Disposition ,默认:false 150 | content-disposition-default-utf8=true 151 | 152 | # 最低 TLS 版本,可选:TLSv1.1、TLSv1.2、TLSv1.3 默认:TLSv1.2 153 | #min-tls-version=TLSv1.2 154 | 155 | 156 | ## BT/PT 下载设置 ## 157 | 158 | # BT 监听端口(TCP), 默认:6881-6999 159 | # Heroku只有nat网络,此项设置没有实际意义。 160 | listen-port=60500-61500 161 | 162 | # DHT 网络与 UDP tracker 监听端口(UDP), 默认:6881-6999 163 | # Heroku只有nat网络,此项设置没有实际意义。 164 | dht-listen-port=60500-61500 165 | 166 | # 启用 IPv4 DHT 功能, PT 下载(私有种子)会自动禁用, 默认:true 167 | enable-dht=true 168 | 169 | # 启用 IPv6 DHT 功能, PT 下载(私有种子)会自动禁用,默认:false 170 | # 在没有 IPv6 支持的环境开启可能会导致 DHT 功能异常 171 | # Heroku无ipv6网络,勿修改此项。 172 | enable-dht6=false 173 | 174 | # 指定 BT 和 DHT 网络中的 IP 地址 175 | # 使用场景:在家庭宽带没有公网 IP 的情况下可以把 BT 和 DHT 监听端口转发至具有公网 IP 的服务器,在此填写服务器的 IP ,可以提升 BT 下载速率。 176 | #bt-external-ip= 177 | 178 | # IPv4 DHT 文件路径,默认:$HOME/.aria2/dht.dat 179 | dht-file-path=/mnt/data/config/dht.dat 180 | 181 | # IPv4 DHT 网络引导节点 182 | dht-entry-point=dht.transmissionbt.com:6881 183 | 184 | # 本地节点发现, PT 下载(私有种子)会自动禁用 默认:false 185 | bt-enable-lpd=false 186 | 187 | # 指定用于本地节点发现的接口,可能的值:接口,IP地址 188 | # 如果未指定此选项,则选择默认接口。 189 | #bt-lpd-interface= 190 | 191 | # 启用节点交换, PT 下载(私有种子)会自动禁用, 默认:true 192 | enable-peer-exchange=true 193 | 194 | # BT 下载最大连接数(单任务),运行时可修改。0 为不限制,默认:55 195 | # 理想情况下连接数越多下载越快,但在实际情况是只有少部分连接到的做种者上传速度快,其余的上传慢或者不上传。 196 | # 如果不限制,当下载非常热门的种子或任务数非常多时可能会因连接数过多导致进程崩溃或网络阻塞。 197 | # 进程崩溃:如果设备 CPU 性能一般,连接数过多导致 CPU 占用过高,因资源不足 Aria2 进程会强制被终结。 198 | # 网络阻塞:在内网环境下,即使下载没有占满带宽也会导致其它设备无法正常上网。因远古低性能路由器的转发性能瓶颈导致。 199 | #bt-max-peers= 200 | 201 | # BT 下载期望速度值(单任务),运行时可修改。单位 K 或 M 。默认:50K 202 | # BT 下载速度低于此选项值时会临时提高连接数来获得更快的下载速度,不过前提是有更多的做种者可供连接。 203 | # 实测临时提高连接数没有上限,但不会像不做限制一样无限增加,会根据算法进行合理的动态调节。 204 | #bt-request-peer-speed-limit= 205 | 206 | # 全局最大上传速度限制, 运行时可修改, 默认:0 (无限制) 207 | # 设置过低可能影响 BT 下载速度 208 | max-overall-upload-limit=5M 209 | 210 | # 单任务上传速度限制, 默认:0 (无限制) 211 | max-upload-limit=0 212 | 213 | # 最小分享率。当种子的分享率达到此选项设置的值时停止做种, 0 为一直做种, 默认:1.0 214 | # 强烈建议您将此选项设置为大于等于 1.0 215 | seed-ratio=1.0 216 | 217 | # 最小做种时间(分钟)。设置为 0 时将在 BT 任务下载完成后停止做种。 218 | seed-time=0 219 | 220 | # 做种前检查文件哈希, 默认:true 221 | bt-hash-check-seed=true 222 | 223 | # 继续之前的BT任务时, 无需再次校验, 默认:false 224 | bt-seed-unverified=false 225 | 226 | # BT tracker 服务器连接超时时间(秒)。默认:60 227 | # 建立连接后,此选项无效,将使用 bt-tracker-timeout 选项的值 228 | bt-tracker-connect-timeout=10 229 | 230 | # BT tracker 服务器超时时间(秒)。默认:60 231 | bt-tracker-timeout=10 232 | 233 | # BT 服务器连接间隔时间(秒)。默认:0 (自动) 234 | #bt-tracker-interval=0 235 | 236 | # BT 下载优先下载文件开头或结尾 237 | bt-prioritize-piece=head=32M,tail=32M 238 | 239 | # 保存通过 WebUI(RPC) 上传的种子文件(.torrent),默认:true 240 | # 所有涉及种子文件保存的选项都建议开启,不保存种子文件有任务丢失的风险。 241 | # 通过 RPC 自定义临时下载目录可能不会保存种子文件。 242 | rpc-save-upload-metadata=true 243 | 244 | # 下载种子文件(.torrent)自动开始下载, 默认:true,可选:false|mem 245 | # true:保存种子文件 246 | # false:仅下载种子文件 247 | # mem:将种子保存在内存中 248 | follow-torrent=true 249 | 250 | # 种子文件下载完后暂停任务,默认:false 251 | # 在开启 follow-torrent 选项后下载种子文件或磁力会自动开始下载任务进行下载,而同时开启当此选项后会建立相关任务并暂停。 252 | pause-metadata=false 253 | 254 | # 保存磁力链接元数据为种子文件(.torrent), 默认:false 255 | bt-save-metadata=true 256 | 257 | # 加载已保存的元数据文件(.torrent),默认:false 258 | bt-load-saved-metadata=true 259 | 260 | # 删除 BT 下载任务中未选择文件,默认:false 261 | bt-remove-unselected-file=true 262 | 263 | # BT强制加密, 默认: false 264 | # 启用后将拒绝旧的 BT 握手协议并仅使用混淆握手及加密。可以解决部分运营商对 BT 下载的封锁,且有一定的防版权投诉与迅雷吸血效果。 265 | # 此选项相当于后面两个选项(bt-require-crypto=true, bt-min-crypto-level=arc4)的快捷开启方式,但不会修改这两个选项的值。 266 | bt-force-encryption=true 267 | 268 | # BT加密需求,默认:false 269 | # 启用后拒绝与旧的 BitTorrent 握手协议(\19BitTorrent protocol)建立连接,始终使用混淆处理握手。 270 | #bt-require-crypto=true 271 | 272 | # BT最低加密等级,可选:plain(明文),arc4(加密),默认:plain 273 | #bt-min-crypto-level=arc4 274 | 275 | # 分离仅做种任务,默认:false 276 | # 从正在下载的任务中排除已经下载完成且正在做种的任务,并开始等待列表中的下一个任务。 277 | bt-detach-seed-only=true 278 | 279 | 280 | ## 客户端伪装 ## 281 | 282 | # 自定义 User Agent 283 | #user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36 Edg/93.0.961.47 284 | user-agent=Deluge 1.3.15 285 | 286 | # BT 客户端伪装 287 | # PT 下载需要保持 user-agent 和 peer-agent 两个参数一致 288 | # 部分 PT 站对 Aria2 有特殊封禁机制,客户端伪装不一定有效,且有封禁账号的风险。 289 | peer-agent=Deluge 1.3.15 290 | peer-id-prefix=-DE13F0- 291 | 292 | 293 | ## RPC 设置 ## 294 | 295 | # 启用 JSON-RPC/XML-RPC 服务器, 勿修改 296 | enable-rpc=true 297 | 298 | # 接受所有远程请求,web界面跨域授权需要,默认:false 299 | rpc-allow-origin-all=true 300 | 301 | # 允许外部访问, false的话只监听本地端口,默认:false 302 | rpc-listen-all=false 303 | 304 | # RPC 监听端口, 勿修改 305 | rpc-listen-port=61800 306 | 307 | # RPC 密钥 308 | # 此项由容器变量控制,勿修改。 309 | rpc-secret=PASSWORD 310 | 311 | # RPC 最大请求大小 312 | rpc-max-request-size=10M 313 | 314 | # RPC 服务 SSL/TLS 加密, 默认:false 315 | # 启用加密后必须使用 https 或者 wss 协议连接 316 | # 不推荐开启,建议使用 web server 反向代理,比如 Nginx、Caddy ,灵活性更强。 317 | # 勿修改此选项。 318 | #rpc-secure=false 319 | 320 | # 在 RPC 服务中启用 SSL/TLS 加密时的证书文件(.pem/.crt) 321 | #rpc-certificate=/root/.aria2/xxx.pem 322 | 323 | # 在 RPC 服务中启用 SSL/TLS 加密时的私钥文件(.key) 324 | #rpc-private-key=/root/.aria2/xxx.key 325 | 326 | # 事件轮询方式, 可选:epoll, kqueue, port, poll, select, 不同系统默认值不同 327 | #event-poll=select 328 | 329 | 330 | ## 高级选项 ## 331 | 332 | # 启用异步 DNS 功能。默认:true 333 | async-dns=true 334 | 335 | # 指定异步 DNS 服务器列表,未指定则从 /etc/resolv.conf 中读取。 336 | async-dns-server=8.8.8.8,1.1.1.1 337 | 338 | enable-mmap=true 339 | 340 | # 指定单个网络接口,可能的值:接口,IP地址,主机名 341 | # 如果接口具有多个 IP 地址,则建议指定 IP 地址。 342 | # 已知指定网络接口会影响依赖本地 RPC 的连接的功能场景,即通过 localhost 和 127.0.0.1 无法与 Aria2 服务端进行讯通。 343 | #interface= 344 | 345 | # 指定多个网络接口,多个值之间使用逗号(,)分隔。 346 | # 使用 interface 选项时会忽略此项。 347 | #multiple-interface= 348 | 349 | 350 | ## 日志设置 ## 351 | 352 | # 日志文件保存路径,忽略或设置为空为不保存,默认:不保存 353 | #log= 354 | 355 | # 日志级别,可选 debug, info, notice, warn, error 。默认:debug 356 | #log-level=notice 357 | 358 | # 控制台日志级别,可选 debug, info, notice, warn, error ,默认:notice 359 | console-log-level=notice 360 | 361 | # 安静模式,禁止在控制台输出日志,默认:false 362 | quiet=false 363 | 364 | show-console-readout=false 365 | 366 | # 下载进度摘要输出间隔时间(秒),0 为禁止输出。默认:60 367 | summary-interval=0 368 | 369 | 370 | ## 执行额外命令 ## 371 | 372 | # 下载停止后执行的命令 373 | # 从 正在下载 到 删除、错误、完成 时触发。暂停被标记为未开始下载,故与此项无关。 374 | on-download-stop=/workdir/aria2/delete.sh 375 | 376 | # 下载完成后执行的命令 377 | # 此项未定义则执行 下载停止后执行的命令 (on-download-stop) 378 | on-download-complete=/workdir/aria2/upload.sh 379 | 380 | # 下载错误后执行的命令 381 | # 此项未定义则执行 下载停止后执行的命令 (on-download-stop) 382 | #on-download-error= 383 | 384 | # 下载暂停后执行的命令 385 | #on-download-pause= 386 | 387 | # 下载开始后执行的命令 388 | #on-download-start= 389 | 390 | # BT 下载完成后执行的命令,BT 下载完成后做种前执行的命令 391 | #on-bt-download-complete= 392 | 393 | 394 | # BT trackers 395 | bt-tracker=http://1337.abcvg.info:80/announce,http://207.241.226.111:6969/announce,http://207.241.231.226:6969/announce,http://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,http://[2001:470:1:189:0:1:2:3]:6969/announce,http://[2a04:ac00:1:3dd8::1:2710]:2710/announce,http://bt.okmp3.ru:2710/announce,http://buny.uk:6969/announce,http://fxtt.ru:80/announce,http://milanesitracker.tekcities.com:80/announce,http://nyaa.tracker.wf:7777/announce,http://open.acgnxtracker.com:80/announce,http://open.acgtracker.com:1096/announce,http://open.tracker.ink:6969/announce,http://opentracker.i2p.rocks:6969/announce,http://opentracker.xyz:80/announce,http://p4p.arenabg.com:1337/announce,http://retracker.hotplug.ru:2710/announce,http://share.camoe.cn:8080/announce,http://t.acg.rip:6699/announce,http://t.nyaatracker.com:80/announce,http://t.overflow.biz:6969/announce,http://t.publictracker.xyz:6969/announce,http://tracker.birkenwald.de:6969/announce,http://tracker.bt4g.com:2095/announce,http://tracker.dler.org:6969/announce,http://tracker.files.fm:6969/announce,http://tracker.gbitt.info:80/announce,http://tracker.ipv6tracker.ru:80/announce,http://tracker.lelux.fi:80/announce,http://tracker.loadbt.com:6969/announce,http://tracker.merded.xyz:8000/announce,http://tracker.mywaifu.best:6969/announce,http://tracker.opentrackr.org:1337/announce,http://tracker.zerobytes.xyz:1337/announce,http://tracker1.bt.moack.co.kr:80/announce,http://tracker1.itzmx.com:8080/announce,http://tracker2.dler.org:80/announce,http://vps02.net.orel.ru:80/announce,https://1337.abcvg.info:443/announce,https://abir0dev.github.io:443/announce,https://carbon-bonsai-621.appspot.com:443/announce,https://chihaya-heroku.120181311.xyz:443/announce,https://opentracker.cc:443/announce,https://opentracker.i2p.rocks:443/announce,https://tp.m-team.cc:443/announce.php,https://tr.abiir.top:443/announce,https://tr.abir.ga:443/announce,https://tr.abirxo.cf:443/announce,https://tr.burnabyhighstar.com:443/announce,https://tr.doogh.club:443/announce,https://tr.fuckbitcoin.xyz:443/announce,https://tr.highstar.shop:443/announce,https://tr.ready4.icu:443/announce,https://tr.torland.ga:443/announce,https://tracker.babico.name.tr:443/announce,https://tracker.foreverpirates.co:443/announce,https://tracker.imgoingto.icu:443/announce,https://tracker.iriseden.fr:443/announce,https://tracker.kuroy.me:443/announce,https://tracker.lilithraws.cf:443/announce,https://tracker.lilithraws.org:443/announce,https://tracker.moeblog.cn:443/announce,https://tracker.nanoha.org:443/announce,https://tracker.nitrix.me:443/announce,https://tracker.yarr.pt:443/announce,https://trackme.theom.nz:443/announce,udp://207.241.226.111:6969/announce,udp://207.241.231.226:6969/announce,udp://212.1.226.176:2710/announce,udp://52.58.128.163:6969/announce,udp://6ahddutb1ucc3cp.ru:6969/announce,udp://78.30.254.12:2710/announce,udp://9.rarbg.com:2810/announce,udp://91.216.110.52:451/announce,udp://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,udp://[2001:470:1:189:0:1:2:3]:6969/announce,udp://[2a03:7220:8083:cd00::1]:451/announce,udp://[2a04:ac00:1:3dd8::1:2710]:2710/announce,udp://[2a0f:e586:f:f::220]:6969/announce,udp://abufinzio.monocul.us:6969/announce,udp://admin.videoenpoche.info:6969/announce,udp://bclearning.top:6969/announce,udp://bt1.archive.org:6969/announce,udp://bt2.archive.org:6969/announce,udp://bubu.mapfactor.com:6969/announce,udp://camera.lei001.com:6969/announce,udp://concen.org:6969/announce,udp://cutiegirl.ru:6969/announce,udp://engplus.ru:6969/announce,udp://exodus.desync.com:6969/announce,udp://fe.dealclub.de:6969/announce,udp://inferno.demonoid.is:3391/announce,udp://ipv4.tracker.harry.lu:80/announce,udp://ipv6.babico.name.tr:8000/announce,udp://ipv6.tracker.harry.lu:80/announce,udp://ipv6.tracker.monitorit4.me:6969/announce,udp://leet-tracker.moe:23861/announce,udp://leet-tracker.moe:38151/announce,udp://mirror.aptus.co.tz:6969/announce,udp://movies.zsw.ca:6969/announce,udp://mts.tvbit.co:6969/announce,udp://open.demonii.com:1337/announce,udp://open.dstud.io:6969/announce,udp://open.free-tracker.ga:6969/announce,udp://open.stealth.si:80/announce,udp://open.tracker.ink:6969/announce,udp://opentor.org:2710/announce,udp://opentracker.i2p.rocks:6969/announce,udp://p4p.arenabg.com:1337/announce,udp://public.publictracker.xyz:6969/announce,udp://retracker.hotplug.ru:2710/announce,udp://retracker.lanta-net.ru:2710/announce,udp://retracker.netbynet.ru:2710/announce,udp://run.publictracker.xyz:6969/announce,udp://torrentclub.space:6969/announce,udp://tr.bangumi.moe:6969/announce,udp://tr.cili001.com:8070/announce,udp://tracker-udp.gbitt.info:80/announce,udp://tracker.0x.tf:6969/announce,udp://tracker.altrosky.nl:6969/announce,udp://tracker.auctor.tv:6969/announce,udp://tracker.babico.name.tr:8000/announce,udp://tracker.beeimg.com:6969/announce,udp://tracker.birkenwald.de:6969/announce,udp://tracker.bitsearch.to:1337/announce,udp://tracker.cyberia.is:6969/announce,udp://tracker.ddunlimited.net:6969/announce,udp://tracker.dler.com:6969/announce,udp://tracker.dler.org:6969/announce,udp://tracker.edkj.club:6969/announce,udp://tracker.fatkhoala.org:13710/announce,udp://tracker.filemail.com:6969/announce,udp://tracker.htp.re:4444/announce,udp://tracker.jordan.im:6969/announce,udp://tracker.leech.ie:1337/announce,udp://tracker.lelux.fi:6969/announce,udp://tracker.loadbt.com:6969/announce,udp://tracker.merded.xyz:8000/announce,udp://tracker.moeking.me:6969/announce,udp://tracker.monitorit4.me:6969/announce,udp://tracker.openbittorrent.com:6969/announce,udp://tracker.opentrackr.org:1337/announce,udp://tracker.pomf.se:80/announce,udp://tracker.skynetcloud.site:6969/announce,udp://tracker.theoks.net:6969/announce,udp://tracker.tiny-vps.com:6969/announce,udp://tracker.torrent.eu.org:451/announce,udp://tracker.zerobytes.xyz:1337/announce,udp://tracker1.bt.moack.co.kr:80/announce,udp://tracker1.itzmx.com:8080/announce,udp://tracker1.myporn.club:9337/announce,udp://tracker2.dler.com:80/announce,udp://tracker2.dler.org:80/announce,udp://tracker2.itzmx.com:6961/announce,udp://tracker3.itzmx.com:6961/announce,udp://tracker4.itzmx.com:2710/announce,udp://tracker6.lelux.fi:6969/announce,udp://u4.trakx.crim.ist:1337/announce,udp://vibe.sleepyinternetfun.xyz:1738/announce,udp://xxx.xxtor.com:3074/announce,ws://hub.bugout.link:80/announce,wss://tracker.openwebtorrent.com:443/announce 396 | 397 | -------------------------------------------------------------------------------- /content/aria2/aria2_en.conf: -------------------------------------------------------------------------------- 1 | # 2 | # https://github.com/P3TERX/aria2.conf 3 | # File name:aria2_en.conf 4 | # Description: Awesome Aria2 configuration file 5 | # Version: 2021.09.15 6 | # 7 | # Copyright (c) 2018-2021 P3TERX 8 | # 9 | # This is free software, licensed under the MIT License. 10 | # See /LICENSE for more informationo 11 | # 12 | # Modified by wy580477 for customized container 13 | # 14 | # Run "sv restart 2" in ttyd after editing for changes to take effect 15 | # 16 | 17 | 18 | ## Files saving setting ## 19 | 20 | # The directory to store the downloaded file. Do not modify this option. 21 | dir=/mnt/data/aria2_downloads 22 | 23 | # Enable disk cache. If SIZE is 0, the disk cache is disabled. 24 | # The one advantage of the disk cache is reduce the disk I/O because the data are written in larger unit. 25 | disk-cache=16M 26 | 27 | # Specify file allocation method. Possible Values: none, prealloc, trunc, falloc Default: prealloc 28 | # "prealloc" pre-allocates file space before download begins. This may take some time depending on the size of the file. 29 | # "falloc" is your best choice newer file systems on HDD such as ext4 (with extents support), btrfs, xfs. 30 | # "trunc" does not help avoiding fragmentation. 31 | # SSD doesn't need file pre-allocation, "none" is the best choice. 32 | # If download fails,show "fallocate failed.cause:Operation not supported", set this option to "none" 33 | file-allocation=none 34 | 35 | # No file allocation is made for files whose size is smaller than SIZE. 36 | no-file-allocation-limit=64M 37 | 38 | # Continue downloading a partially downloaded file. Currently this option is only applicable to HTTP(S)/FTP downloads. 39 | continue=true 40 | 41 | # Always resume download. 42 | # If true is given, aria2 always tries to resume download and if resume is not possible, aborts download. 43 | # If false is given, when all resume attempts fail, aria2 downloads file from scratch. 44 | always-resume=false 45 | 46 | # When used with --always-resume=false, aria2 downloads file from scratch when aria2 detects N number of URIs that does not support resume. 47 | # If N is 0, aria2 downloads file from scratch when all given URIs do not support resume. 48 | max-resume-failure-tries=0 49 | 50 | # Retrieve timestamp of the remote file from the remote HTTP/FTP server and if it is available, apply it to the local file. 51 | remote-time=true 52 | 53 | 54 | ## Session saving setting ## 55 | 56 | # Read download tasks from file. 57 | input-file=/mnt/data/config/aria2.session 58 | 59 | # Save error/unfinished dowload tasks on exit. 60 | # Do not modify this option. 61 | save-session=/mnt/data/config/aria2.session 62 | 63 | # Save error/unfinished downloads to a file specified by save-session option every SEC seconds. 64 | # If 0 is given, file will be saved only when aria2 exits. 65 | save-session-interval=1 66 | 67 | # Save a control file(*.aria2) every SEC seconds. 68 | # If 0 is given, a control file is not saved during download. 69 | auto-save-interval=5 70 | 71 | # Save download with save-session option even if the download is completed or removed. 72 | # If set to false, downloaded task list will be empty after reboot. 73 | force-save=false 74 | 75 | 76 | ## Connection setting ## 77 | 78 | # If aria2 receives "file not found" status NUM times, then force the download to fail. 79 | max-file-not-found=10 80 | 81 | # Set number of tries. 0 means unlimited. 82 | max-tries=0 83 | 84 | # Set the seconds to wait between retries. 85 | retry-wait=10 86 | 87 | # Set the connect timeout in seconds to establish connection to HTTP/FTP/proxy server. 88 | connect-timeout=10 89 | 90 | # Set timeout in seconds. 91 | timeout=10 92 | 93 | # Set the maximum number of parallel downloads for every queue item. 94 | max-concurrent-downloads=5 95 | 96 | # The maximum number of connections to one server for each download. 97 | max-connection-per-server=16 98 | 99 | # Download a file using N connections. 100 | split=64 101 | 102 | # aria2 does not split less than 2*SIZE byte range. 103 | min-split-size=1M 104 | 105 | # Set a piece length for HTTP/FTP downloads. 106 | piece-length=1M 107 | 108 | # If false is given, aria2 aborts download when a piece length is different from one in a control file. 109 | # If true is given, you can proceed but some download progress will be lost. Default: false 110 | allow-piece-length-change=true 111 | 112 | # Close connection if download speed is lower than or equal to this value. 113 | # This option does not affect BitTorrent downloads. 114 | lowest-speed-limit=0 115 | 116 | # Set max overall download speed. 0 means unrestricted. 117 | max-overall-download-limit=5M 118 | 119 | # Set max download speed per each download. 0 means unrestricted. 120 | max-download-limit=0 121 | 122 | # Disable IPv6. Heroku dyno doesn't have ipv6 network, keep it disabled. 123 | disable-ipv6=true 124 | 125 | # Send Accept: deflate, gzip request header. 126 | http-accept-gzip=true 127 | 128 | # Reuse already used URIs if no unused URIs are left. 129 | reuse-uri=false 130 | 131 | # Disables netrc support. 132 | no-netrc=true 133 | 134 | # Restart download from scratch if the corresponding control file doesn't exist. 135 | allow-overwrite=false 136 | 137 | # Rename file name if the same file already exists. This option works only in HTTP(S)/FTP download. 138 | auto-file-renaming=true 139 | 140 | # Handle quoted string in Content-Disposition header as UTF-8 instead of ISO-8859-1. 141 | content-disposition-default-utf8=true 142 | 143 | # Specify minimum SSL/TLS version to enable. Possible Values: TLSv1.1, TLSv1.2, TLSv1.3 Default: TLSv1.2 144 | #min-tls-version=TLSv1.2 145 | 146 | 147 | ## Bittorrent setting ## 148 | 149 | # Set TCP port number for BitTorrent downloads. 150 | listen-port=60500-61500 151 | 152 | # Set UDP listening port used by DHT(IPv4, IPv6) and UDP tracker. 153 | dht-listen-port=60500-61500 154 | 155 | # Enable IPv4 DHT functionality. It also enables UDP tracker support. 156 | # If a private flag is set in a torrent, aria2 doesn't use DHT for that download even if true is given. 157 | enable-dht=true 158 | 159 | # Enable IPv6 DHT functionality. 160 | # If a private flag is set in a torrent, aria2 doesn't use DHT for that download even if true is given. 161 | # Heroku dyno doesn't have ipv6 network, keep it disabled. 162 | enable-dht6=false 163 | 164 | # Specify the external IP address to use in BitTorrent download and DHT. It may be sent to BitTorrent tracker. 165 | #bt-external-ip= 166 | 167 | # IPv4 DHT routing table file PATH 168 | dht-file-path=/mnt/data/config/dht.dat 169 | 170 | # Set host and port as an entry point to IPv4 DHT network. 171 | dht-entry-point=dht.transmissionbt.com:6881 172 | 173 | # Enable Local Peer Discovery. 174 | # If a private flag is set in a torrent, aria2 doesn't use this feature for that download even if true is given. 175 | bt-enable-lpd=false 176 | 177 | # Use given interface for Local Peer Discovery. If this option is not specified, the default interface is chosen. 178 | #bt-lpd-interface= 179 | 180 | # Enable Peer Exchange extension. 181 | # If a private flag is set in a torrent, this feature is disabled for that download even if true is given. 182 | enable-peer-exchange=true 183 | 184 | # Specify the maximum number of peers per torrent. 0 means unlimited. 185 | #bt-max-peers= 186 | 187 | # If the whole download speed of every torrent is lower than SPEED, 188 | # aria2 temporarily increases the number of peers to try for more download speed. Default: 50K 189 | #bt-request-peer-speed-limit= 190 | 191 | # Set max overall upload speed. 0 means unrestricted. 192 | max-overall-upload-limit=5M 193 | 194 | # Set max upload speed per each torrent. 0 means unrestricted. 195 | max-upload-limit=0 196 | 197 | # Specify share ratio. Seed completed torrents until share ratio reaches RATIO. 198 | # Specify 0.0 if you intend to do seeding regardless of share ratio. 199 | # If --seed-time option is specified along with this option, seeding ends when at least one of the conditions is satisfied. 200 | seed-ratio=1.0 201 | 202 | # Specify seeding time in (fractional) minutes. 203 | seed-time=0 204 | 205 | # If true is given, after hash check using --check-integrity option and file is complete, continue to seed file. 206 | # If you want to check file and download it only when it is damaged or incomplete, set this option to false. 207 | # This option has effect only on BitTorrent download. 208 | bt-hash-check-seed=true 209 | 210 | # Seed previously downloaded files without verifying piece hashes. 211 | bt-seed-unverified=false 212 | 213 | # Set the connect timeout in seconds to establish connection to tracker. 214 | # After the connection is established, this option makes no effect and --bt-tracker-timeout option is used instead. 215 | bt-tracker-connect-timeout=10 216 | 217 | # Set timeout in seconds. 218 | bt-tracker-timeout=10 219 | 220 | # Set the interval in seconds between tracker requests. 221 | # If 0 is set, aria2 determines interval based on the response of tracker and the download progress. Default: 0 222 | #bt-tracker-interval=0 223 | 224 | # Try to download first and last pieces of each file first. This is useful for previewing files. 225 | bt-prioritize-piece=head=32M,tail=32M 226 | 227 | # Save the uploaded torrent or metalink meta data in the directory specified by --dir option. 228 | rpc-save-upload-metadata=true 229 | 230 | # If true or mem is specified, when a torrent file is downloaded, aria2 downloads files mentioned in it. 231 | # If mem is specified, a torrent file is not written to the disk, but is just kept in memory. 232 | # If false is specified, the .torrent file is downloaded to the disk, but its contents are not downloaded. 233 | follow-torrent=true 234 | 235 | # Pause downloads created as a result of metadata download. 236 | # This option is effective only when --enable-rpc=true is given. 237 | pause-metadata=false 238 | 239 | # Save meta data as ".torrent" file. This option has effect only when BitTorrent Magnet URI is used. 240 | bt-save-metadata=true 241 | 242 | # Before getting torrent metadata from DHT, first try to read file saved by --bt-save-metadata option. 243 | # If it is successful, then skip downloading metadata from DHT. 244 | bt-load-saved-metadata=true 245 | 246 | # Removes the unselected files when download is completed in BitTorrent. 247 | bt-remove-unselected-file=true 248 | 249 | # Requires BitTorrent message payload encryption with arc4. 250 | # If true is given, deny legacy BitTorrent handshake and only use Obfuscation handshake and always encrypt message payload. 251 | # This is a shorthand of bt-require-crypto bt-min-crypto-level=arc4. This option does not change the option value of those options. 252 | bt-force-encryption=true 253 | 254 | # If true is given, deny legacy BitTorrent handshake and only use Obfuscation handshake 255 | #bt-require-crypto=true 256 | 257 | # Set minimum level of encryption method. 258 | #bt-min-crypto-level=arc4 259 | 260 | # Exclude seed only downloads when counting concurrent active downloads. 261 | bt-detach-seed-only=true 262 | 263 | 264 | ## Client camouflage ## 265 | # Do not relay on settings here to bypass private tracker restriction, you could get your account banned. 266 | 267 | # Set user agent for HTTP(S) downloads. 268 | #user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36 Edg/93.0.961.47 269 | user-agent=Deluge 1.3.15 270 | 271 | # Specify the string used during the bitorrent extended handshake for the peer's client version. 272 | # Download from private traker needs user-agent match peer-agent. 273 | peer-agent=Deluge 1.3.15 274 | 275 | # Specify the prefix of peer ID. 276 | peer-id-prefix=-DE13F0- 277 | 278 | 279 | ## RPC setting ## 280 | 281 | # Enable JSON-RPC/XML-RPC server. Do not modify this option. 282 | enable-rpc=true 283 | 284 | # Add Access-Control-Allow-Origin header field with value * to the RPC response. 285 | rpc-allow-origin-all=true 286 | 287 | # Listen incoming JSON-RPC/XML-RPC requests on all network interfaces. 288 | # If false is given, listen only on local loopback interface. 289 | rpc-listen-all=false 290 | 291 | # Specify a port number for JSON-RPC/XML-RPC server to listen to. 292 | # Do not modify this option. 293 | rpc-listen-port=61800 294 | 295 | # Set RPC secret authorization token. 296 | # Controlled by container env, do not modify this option. 297 | rpc-secret=PASSWORD 298 | 299 | # Set max size of JSON-RPC/XML-RPC request. If aria2 detects the request is more than SIZE bytes, it drops connection. 300 | rpc-max-request-size=10M 301 | 302 | # RPC transport will be encrypted by SSL/TLS. Do not modify this option. 303 | #rpc-secure=false 304 | 305 | # Use the certificate in FILE for RPC server. 306 | #rpc-certificate=/root/.aria2/xxx.pem 307 | 308 | # Use the private key in FILE for RPC server. 309 | #rpc-private-key=/root/.aria2/xxx.key 310 | 311 | # Specify the method for polling events. 312 | #event-poll=select 313 | 314 | 315 | ## Advanced setting ## 316 | 317 | # Enable asynchronous DNS. Default: true 318 | async-dns=true 319 | 320 | # Comma separated list of DNS server address used in asynchronous DNS resolver. 321 | # Otherwise asynchronous DNS resolver reads DNS server addresses from /etc/resolv.conf. 322 | async-dns-server=8.8.8.8,1.1.1.1 323 | 324 | enable-mmap=true 325 | 326 | # Bind sockets to given interface. 327 | # If an interface has multiple addresses, it is highly recommended to specify IP address explicitly. 328 | #interface= 329 | 330 | # Comma separated list of interfaces to bind sockets to. 331 | #multiple-interface= 332 | 333 | 334 | ## Log setting ## 335 | 336 | # The file name of the log file. If - is specified, log is written to stdout. 337 | # If empty string("") is specified, or this option is omitted, no log is written to disk at all. 338 | #log= 339 | 340 | # Set log level to output. LEVEL is either debug, info, notice, warn or error. 341 | #log-level=notice 342 | 343 | # Set log level to output to console. LEVEL is either debug, info, notice, warn or error. 344 | console-log-level=notice 345 | 346 | # Make aria2 quiet (no console output). 347 | quiet=false 348 | 349 | show-console-readout=false 350 | 351 | # Set interval in seconds to output download progress summary. Setting 0 suppresses the output. 352 | summary-interval=0 353 | 354 | 355 | ## Event Hook ## 356 | 357 | # Set the command to be executed after download stopped. 358 | # Triggered after download deleted/aborted due to error/completed. Paused downloads don't trigger this option. 359 | on-download-stop=/workdir/aria2/delete.sh 360 | 361 | # Set the command to be executed after download completed. 362 | # For BitTorrent, this option is called after download completed and seeding is over. 363 | on-download-complete=/workdir/aria2/upload.sh 364 | 365 | # Set the command to be executed after download aborted due to error. 366 | #on-download-error= 367 | 368 | # Set the command to be executed after download was paused. 369 | #on-download-pause= 370 | 371 | # Set the command to be executed after download got started. 372 | #on-download-start= 373 | 374 | # Set the command to be executed after bt download completed but before seeding. 375 | #on-bt-download-complete= 376 | 377 | 378 | # BT trackers 379 | bt-tracker=http://1337.abcvg.info:80/announce,http://207.241.226.111:6969/announce,http://207.241.231.226:6969/announce,http://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,http://[2001:470:1:189:0:1:2:3]:6969/announce,http://[2a04:ac00:1:3dd8::1:2710]:2710/announce,http://bt.okmp3.ru:2710/announce,http://buny.uk:6969/announce,http://fxtt.ru:80/announce,http://milanesitracker.tekcities.com:80/announce,http://nyaa.tracker.wf:7777/announce,http://open.acgnxtracker.com:80/announce,http://open.acgtracker.com:1096/announce,http://open.tracker.ink:6969/announce,http://opentracker.i2p.rocks:6969/announce,http://opentracker.xyz:80/announce,http://p4p.arenabg.com:1337/announce,http://retracker.hotplug.ru:2710/announce,http://share.camoe.cn:8080/announce,http://t.acg.rip:6699/announce,http://t.nyaatracker.com:80/announce,http://t.overflow.biz:6969/announce,http://t.publictracker.xyz:6969/announce,http://tracker.birkenwald.de:6969/announce,http://tracker.bt4g.com:2095/announce,http://tracker.dler.org:6969/announce,http://tracker.files.fm:6969/announce,http://tracker.gbitt.info:80/announce,http://tracker.ipv6tracker.ru:80/announce,http://tracker.lelux.fi:80/announce,http://tracker.loadbt.com:6969/announce,http://tracker.merded.xyz:8000/announce,http://tracker.mywaifu.best:6969/announce,http://tracker.opentrackr.org:1337/announce,http://tracker.zerobytes.xyz:1337/announce,http://tracker1.bt.moack.co.kr:80/announce,http://tracker1.itzmx.com:8080/announce,http://tracker2.dler.org:80/announce,http://vps02.net.orel.ru:80/announce,https://1337.abcvg.info:443/announce,https://abir0dev.github.io:443/announce,https://carbon-bonsai-621.appspot.com:443/announce,https://chihaya-heroku.120181311.xyz:443/announce,https://opentracker.cc:443/announce,https://opentracker.i2p.rocks:443/announce,https://tp.m-team.cc:443/announce.php,https://tr.abiir.top:443/announce,https://tr.abir.ga:443/announce,https://tr.abirxo.cf:443/announce,https://tr.burnabyhighstar.com:443/announce,https://tr.doogh.club:443/announce,https://tr.fuckbitcoin.xyz:443/announce,https://tr.highstar.shop:443/announce,https://tr.ready4.icu:443/announce,https://tr.torland.ga:443/announce,https://tracker.babico.name.tr:443/announce,https://tracker.foreverpirates.co:443/announce,https://tracker.imgoingto.icu:443/announce,https://tracker.iriseden.fr:443/announce,https://tracker.kuroy.me:443/announce,https://tracker.lilithraws.cf:443/announce,https://tracker.lilithraws.org:443/announce,https://tracker.moeblog.cn:443/announce,https://tracker.nanoha.org:443/announce,https://tracker.nitrix.me:443/announce,https://tracker.yarr.pt:443/announce,https://trackme.theom.nz:443/announce,udp://207.241.226.111:6969/announce,udp://207.241.231.226:6969/announce,udp://212.1.226.176:2710/announce,udp://52.58.128.163:6969/announce,udp://6ahddutb1ucc3cp.ru:6969/announce,udp://78.30.254.12:2710/announce,udp://9.rarbg.com:2810/announce,udp://91.216.110.52:451/announce,udp://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,udp://[2001:470:1:189:0:1:2:3]:6969/announce,udp://[2a03:7220:8083:cd00::1]:451/announce,udp://[2a04:ac00:1:3dd8::1:2710]:2710/announce,udp://[2a0f:e586:f:f::220]:6969/announce,udp://abufinzio.monocul.us:6969/announce,udp://admin.videoenpoche.info:6969/announce,udp://bclearning.top:6969/announce,udp://bt1.archive.org:6969/announce,udp://bt2.archive.org:6969/announce,udp://bubu.mapfactor.com:6969/announce,udp://camera.lei001.com:6969/announce,udp://concen.org:6969/announce,udp://cutiegirl.ru:6969/announce,udp://engplus.ru:6969/announce,udp://exodus.desync.com:6969/announce,udp://fe.dealclub.de:6969/announce,udp://inferno.demonoid.is:3391/announce,udp://ipv4.tracker.harry.lu:80/announce,udp://ipv6.babico.name.tr:8000/announce,udp://ipv6.tracker.harry.lu:80/announce,udp://ipv6.tracker.monitorit4.me:6969/announce,udp://leet-tracker.moe:23861/announce,udp://leet-tracker.moe:38151/announce,udp://mirror.aptus.co.tz:6969/announce,udp://movies.zsw.ca:6969/announce,udp://mts.tvbit.co:6969/announce,udp://open.demonii.com:1337/announce,udp://open.dstud.io:6969/announce,udp://open.free-tracker.ga:6969/announce,udp://open.stealth.si:80/announce,udp://open.tracker.ink:6969/announce,udp://opentor.org:2710/announce,udp://opentracker.i2p.rocks:6969/announce,udp://p4p.arenabg.com:1337/announce,udp://public.publictracker.xyz:6969/announce,udp://retracker.hotplug.ru:2710/announce,udp://retracker.lanta-net.ru:2710/announce,udp://retracker.netbynet.ru:2710/announce,udp://run.publictracker.xyz:6969/announce,udp://torrentclub.space:6969/announce,udp://tr.bangumi.moe:6969/announce,udp://tr.cili001.com:8070/announce,udp://tracker-udp.gbitt.info:80/announce,udp://tracker.0x.tf:6969/announce,udp://tracker.altrosky.nl:6969/announce,udp://tracker.auctor.tv:6969/announce,udp://tracker.babico.name.tr:8000/announce,udp://tracker.beeimg.com:6969/announce,udp://tracker.birkenwald.de:6969/announce,udp://tracker.bitsearch.to:1337/announce,udp://tracker.cyberia.is:6969/announce,udp://tracker.ddunlimited.net:6969/announce,udp://tracker.dler.com:6969/announce,udp://tracker.dler.org:6969/announce,udp://tracker.edkj.club:6969/announce,udp://tracker.fatkhoala.org:13710/announce,udp://tracker.filemail.com:6969/announce,udp://tracker.htp.re:4444/announce,udp://tracker.jordan.im:6969/announce,udp://tracker.leech.ie:1337/announce,udp://tracker.lelux.fi:6969/announce,udp://tracker.loadbt.com:6969/announce,udp://tracker.merded.xyz:8000/announce,udp://tracker.moeking.me:6969/announce,udp://tracker.monitorit4.me:6969/announce,udp://tracker.openbittorrent.com:6969/announce,udp://tracker.opentrackr.org:1337/announce,udp://tracker.pomf.se:80/announce,udp://tracker.skynetcloud.site:6969/announce,udp://tracker.theoks.net:6969/announce,udp://tracker.tiny-vps.com:6969/announce,udp://tracker.torrent.eu.org:451/announce,udp://tracker.zerobytes.xyz:1337/announce,udp://tracker1.bt.moack.co.kr:80/announce,udp://tracker1.itzmx.com:8080/announce,udp://tracker1.myporn.club:9337/announce,udp://tracker2.dler.com:80/announce,udp://tracker2.dler.org:80/announce,udp://tracker2.itzmx.com:6961/announce,udp://tracker3.itzmx.com:6961/announce,udp://tracker4.itzmx.com:2710/announce,udp://tracker6.lelux.fi:6969/announce,udp://u4.trakx.crim.ist:1337/announce,udp://vibe.sleepyinternetfun.xyz:1738/announce,udp://xxx.xxtor.com:3074/announce,ws://hub.bugout.link:80/announce,wss://tracker.openwebtorrent.com:443/announce 380 | 381 | -------------------------------------------------------------------------------- /content/aria2/clean.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:clean.sh 5 | # Description: Remove redundant files after Aria2 download is complete 6 | # Version: 3.0 7 | # 8 | # Copyright (c) 2018-2021 P3TERX 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a copy 11 | # of this software and associated documentation files (the "Software"), to deal 12 | # in the Software without restriction, including without limitation the rights 13 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | # copies of the Software, and to permit persons to whom the Software is 15 | # furnished to do so, subject to the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included in all 18 | # copies or substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | 29 | CHECK_CORE_FILE() { 30 | CORE_FILE="$(dirname $0)/core" 31 | if [[ -f "${CORE_FILE}" ]]; then 32 | . "${CORE_FILE}" 33 | else 34 | echo "!!! core file does not exist !!!" 35 | exit 1 36 | fi 37 | } 38 | 39 | CHECK_CORE_FILE "$@" 40 | CHECK_PARAMETER "$@" 41 | CHECK_FILE_NUM 42 | CHECK_SCRIPT_CONF 43 | GET_TASK_INFO 44 | GET_DOWNLOAD_DIR 45 | CONVERSION_PATH 46 | CLEAN_UP 47 | exit 0 48 | -------------------------------------------------------------------------------- /content/aria2/core: -------------------------------------------------------------------------------- 1 | # 2 | # https://github.com/P3TERX/aria2.conf 3 | # File name:core 4 | # Description: Aria2 additional function script core file 5 | # Version: 3.3 6 | # 7 | # Copyright (c) 2018-2021 P3TERX 8 | # 9 | # Permission is hereby granted, free of charge, to any person obtaining a copy 10 | # of this software and associated documentation files (the "Software"), to deal 11 | # in the Software without restriction, including without limitation the rights 12 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | # copies of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be included in all 17 | # copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | # SOFTWARE. 26 | # 27 | # Modified by wy580477 for customized container 28 | # 29 | 30 | TASK_GID=$1 31 | FILE_NUM=$2 32 | FILE_PATH=$3 33 | ARIA2_CONF_DIR="$(dirname $0)" 34 | ARIA2_CONF="/mnt/data/config/aria2.conf" 35 | ARIA2_SESSION="/mnt/data/config/aria2.session" 36 | SCRIPT_CONF="/mnt/data/config/script.conf" 37 | RED_FONT_PREFIX="\033[31m" 38 | LIGHT_GREEN_FONT_PREFIX="\033[1;32m" 39 | YELLOW_FONT_PREFIX="\033[1;33m" 40 | LIGHT_PURPLE_FONT_PREFIX="\033[1;35m" 41 | FONT_COLOR_SUFFIX="\033[0m" 42 | INFO="[${LIGHT_GREEN_FONT_PREFIX}INFO${FONT_COLOR_SUFFIX}]" 43 | ERROR="[${RED_FONT_PREFIX}ERROR${FONT_COLOR_SUFFIX}]" 44 | WARNING="[${YELLOW_FONT_PREFIX}WARNING${FONT_COLOR_SUFFIX}]" 45 | 46 | DATE_TIME() { 47 | date +"%m/%d %H:%M:%S" 48 | } 49 | 50 | CHECK_PARAMETER() { 51 | [[ $# -eq 0 ]] && { 52 | echo && echo -e "${ERROR} This script can only be used by passing parameters through Aria2." 53 | exit 1 54 | } 55 | } 56 | 57 | CHECK_FILE_NUM() { 58 | [[ ${FILE_NUM} -eq 0 ]] && { 59 | echo && echo -e "$(DATE_TIME) ${WARRING} Number of files is zero, maybe a Magnet Link." 60 | exit 0 61 | } 62 | } 63 | 64 | CHECK_SCRIPT_CONF() { 65 | if [[ -f "${SCRIPT_CONF}" ]]; then 66 | LOAD_SCRIPT_CONF 67 | else 68 | echo && echo "!!! '${SCRIPT_CONF}' does not exist !!!" 69 | exit 1 70 | fi 71 | } 72 | 73 | LOAD_SCRIPT_CONF() { 74 | TELEGRAM_BOT_TOKEN="$(grep ^telegram-bot-token "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 75 | TELEGRAM_CHAT_ID="$(grep ^telegram-chat-id "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 76 | TELEGRAM_TITLE="$(grep ^telegram-notification-title "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 77 | TG_PROXY="$(grep ^telegram-proxy "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 78 | TG_EXCLUDE_FILE_EXTENSION="$(grep ^telegram-exclude-file-extension "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 79 | TG_INCLUDE_FILE_EXTENSION="$(grep ^telegram-include-file-extension "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 80 | DRIVE_NAME="$(grep ^drive-name "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 81 | DRIVE_NAME_AUTO="$(sed -n '1p' /mnt/data/config/rclone.conf | sed "s/.*\[//g;s/\].*//g;s/\r$//")" 82 | if [ "${DRIVE_NAME}" = "auto" ]; then 83 | DRIVENAME=${DRIVE_NAME_AUTO} 84 | else 85 | DRIVENAME=${DRIVE_NAME} 86 | fi 87 | UPLOAD_MODE="$(grep ^aria2-upload-mode "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 88 | GLOBAL_DRIVE_DIR="$(grep ^drive-dir "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 89 | ARIA_DRIVE_DIR="$(grep ^aria2-drive-dir "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 90 | if [ "${ARIA_DRIVE_DIR}" = "" ]; then 91 | DRIVE_DIR=${GLOBAL_DRIVE_DIR}/aria2 92 | else 93 | DRIVE_DIR=${ARIA_DRIVE_DIR} 94 | fi 95 | EXCLUDE_FILE_EXTENSION="$(grep ^exclude-file-extension "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 96 | INCLUDE_FILE_EXTENSION="$(grep ^include-file-extension "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 97 | UPLOAD_LOG_PATH="$(grep ^upload-log "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 98 | DEST_DIR="$(grep ^dest-dir "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 99 | MOVE_LOG_PATH="$(grep ^move-log "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 100 | DELETE_ON_REMOVED="$(grep ^delete-on-removed "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 101 | DELETE_ON_ERROR="$(grep ^delete-on-error "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 102 | DELETE_ON_UNKNOWN="$(grep ^delete-on-unknown "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 103 | DELETE_DOT_ARIA2="$(grep ^delete-dot-aria2 "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 104 | DELETE_DOT_TORRENT="$(grep ^delete-dot-torrent "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 105 | DELETE_EMPTY_DIR="$(grep ^delete-empty-dir "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 106 | MIN_SIZE="$(grep ^min-size "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 107 | INCLUDE_FILE="$(grep ^include-file "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 108 | EXCLUDE_FILE="$(grep ^exclude-file "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 109 | INCLUDE_FILE_REGEX="$(grep ^include-file-regex "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 110 | EXCLUDE_FILE_REGEX="$(grep ^exclude-file-regex "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 111 | } 112 | 113 | READ_ARIA2_CONF() { 114 | if [ ! -f "${ARIA2_CONF}" ]; then 115 | echo -e "$(DATE_TIME) ${ERROR} '${ARIA2_CONF}' does not exist." 116 | exit 1 117 | else 118 | ARIA2_DOWNLOAD_DIR=$(grep ^dir "${ARIA2_CONF}" | cut -d= -f2-) 119 | RPC_PORT=61800 120 | RPC_SECRET=$(grep ^rpc-secret "${ARIA2_CONF}" | cut -d= -f2-) 121 | SAVE_SESSION_INTERVAL=$(grep ^save-session-interval "${ARIA2_CONF}" | cut -d= -f2-) 122 | [[ ${ARIA2_DOWNLOAD_DIR} && ${RPC_PORT} && ${SAVE_SESSION_INTERVAL} ]] || { 123 | echo -e "$(DATE_TIME) ${ERROR} Aria2 configuration file incomplete." 124 | exit 1 125 | } 126 | RPC_ADDRESS="localhost:${RPC_PORT}/jsonrpc" 127 | fi 128 | } 129 | 130 | RPC_TASK_INFO() { 131 | if [[ "${RPC_SECRET}" ]]; then 132 | RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.tellStatus","id":"P3TERX","params":["token:'"${GLOBAL_PASSWORD}"'","'${TASK_GID}'"]}' 133 | else 134 | RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.tellStatus","id":"P3TERX","params":["token:'"${GLOBAL_PASSWORD}"'","'${TASK_GID}'"]}' 135 | fi 136 | curl "${RPC_ADDRESS}" -fsSd "${RPC_PAYLOAD}" || curl "https://${RPC_ADDRESS}" -kfsSd "${RPC_PAYLOAD}" 137 | } 138 | 139 | GET_TASK_INFO() { 140 | READ_ARIA2_CONF 141 | RPC_RESULT="$(RPC_TASK_INFO)" 142 | } 143 | 144 | GET_DOWNLOAD_DIR() { 145 | [[ -z ${RPC_RESULT} ]] && { 146 | echo -e "$(DATE_TIME) ${ERROR} Aria2 RPC interface error!" 147 | exit 1 148 | } 149 | DOWNLOAD_DIR=$(echo "${RPC_RESULT}" | jq -r '.result.dir') 150 | [[ -z "${DOWNLOAD_DIR}" || "${DOWNLOAD_DIR}" = "null" ]] && { 151 | echo ${RPC_RESULT} | jq '.result' 152 | echo -e "$(DATE_TIME) ${ERROR} Failed to get download directory!" 153 | exit 1 154 | } 155 | } 156 | 157 | GET_TASK_STATUS() { 158 | TASK_STATUS=$(echo "${RPC_RESULT}" | jq -r '.result.status') 159 | [[ -z "${TASK_STATUS}" || "${TASK_STATUS}" = "null" ]] && { 160 | echo "${RPC_RESULT}" | jq '.result' 161 | echo -e "$(DATE_TIME) ${ERROR} Failed to get task status!" 162 | exit 1 163 | } 164 | } 165 | 166 | GET_INFO_HASH() { 167 | INFO_HASH=$(echo "${RPC_RESULT}" | jq -r '.result.infoHash') 168 | if [[ -z "${INFO_HASH}" ]]; then 169 | echo "${RPC_RESULT}" | jq '.result' 170 | echo -e "$(DATE_TIME) ${ERROR} Failed to get Info Hash!" 171 | exit 1 172 | elif [[ "${INFO_HASH}" = "null" ]]; then 173 | return 1 174 | else 175 | TORRENT_FILE="${DOWNLOAD_DIR}/${INFO_HASH}.torrent" 176 | fi 177 | } 178 | 179 | CONVERSION_PATH() { 180 | RELATIVE_PATH="${FILE_PATH#"${DOWNLOAD_DIR}/"}" 181 | TASK_FILE_NAME="${RELATIVE_PATH%%/*}" 182 | TASK_PATH="${DOWNLOAD_DIR}/${TASK_FILE_NAME}" 183 | } 184 | 185 | OUTPUT_LOG() { 186 | echo -e "${LOG}" 187 | [[ "${LOG_PATH}" && -e "${LOG_PATH%/*}" ]] && echo -e "${LOG}" | sed "s,\x1B\[[0-9;]*m,,g" >>"${LOG_PATH}" 188 | } 189 | 190 | CHECK_DOT_ARIA2() { 191 | if [ -f "${FILE_PATH}.aria2" ]; then 192 | DOT_ARIA2_FILE="${FILE_PATH}.aria2" 193 | elif [ -f "${TASK_PATH}.aria2" ]; then 194 | DOT_ARIA2_FILE="${TASK_PATH}.aria2" 195 | else 196 | DOT_ARIA2_FILE='null' 197 | echo -e "$(DATE_TIME) ${INFO} .aria2 file does not exist." 198 | return 1 199 | fi 200 | } 201 | 202 | DELETE_DOT_ARIA2() { 203 | if [[ "${DELETE_DOT_ARIA2}" = "true" ]] && CHECK_DOT_ARIA2; then 204 | echo -e "$(DATE_TIME) ${INFO} Deleting .aria2 file ..." 205 | rm -vf "${DOT_ARIA2_FILE}" 206 | fi 207 | } 208 | 209 | DELETE_TORRENT_FILES() { 210 | sleep $(($SAVE_SESSION_INTERVAL + 1)) 211 | TORRENT_FILES=$(ls "${DOWNLOAD_DIR}" | grep '.*.torrent') 212 | if [[ -f "${ARIA2_SESSION}" && -n "${TORRENT_FILES}" ]]; then 213 | for TORRENT_FILE in "${TORRENT_FILES}"; do 214 | if [[ -n "${TORRENT_FILE}" && -z $(cat "${ARIA2_SESSION}" | grep -i "${TORRENT_FILE%.*}") ]]; then 215 | echo -e "$(DATE_TIME) ${INFO} Deleting .torrent file (enhanced) ..." 216 | rm -vf ${DOWNLOAD_DIR}/${TORRENT_FILE} 217 | fi 218 | done 219 | else 220 | [[ ! -f "${ARIA2_SESSION}" ]] && 221 | echo -e "$(DATE_TIME) ${ERROR} '${ARIA2_SESSION}' does not exist." || 222 | echo -e "$(DATE_TIME) ${WARRING} .torrent file does not exist." 223 | fi 224 | } 225 | 226 | DELETE_DOT_TORRENT() { 227 | if GET_INFO_HASH; then 228 | if [[ "${DELETE_DOT_TORRENT}" = "true" || "${DELETE_DOT_TORRENT}" = "normal" ]] && [[ -f "${TORRENT_FILE}" ]]; then 229 | echo -e "$(DATE_TIME) ${INFO} Deleting .torrent file ..." 230 | rm -vf ${TORRENT_FILE} 231 | elif [[ "${DELETE_DOT_TORRENT}" = "true" || "${DELETE_DOT_TORRENT}" = "enhanced" ]]; then 232 | DELETE_TORRENT_FILES 233 | elif [[ "${DELETE_DOT_TORRENT}" = "normal" ]]; then 234 | echo -e "$(DATE_TIME) ${WARRING} .torrent file may exist but cannot be found. Recommended to enable enhanced mode." 235 | else 236 | echo -e "$(DATE_TIME) ${INFO} Delete .torrent file function is disabled." 237 | fi 238 | else 239 | echo -e "$(DATE_TIME) ${INFO} General download task, skipped delete .torrent file." 240 | fi 241 | } 242 | 243 | DELETE_EMPTY_DIR() { 244 | if [[ "${DELETE_EMPTY_DIR}" = "true" ]]; then 245 | echo -e "$(DATE_TIME) ${INFO} Deleting empty directory ..." 246 | find /mnt/data/aria2_downloads -depth -mindepth 1 -type d -empty -exec rm -vrf {} \; 2>/dev/null 247 | fi 248 | } 249 | 250 | DELETE_EXCLUDE_FILE() { 251 | if [[ ${FILE_NUM} -gt 1 ]] && [[ -n ${MIN_SIZE} || -n ${INCLUDE_FILE} || -n ${EXCLUDE_FILE} || -n ${EXCLUDE_FILE_REGEX} || -n ${INCLUDE_FILE_REGEX} ]]; then 252 | echo -e "${INFO} Deleting excluded files ..." 253 | [[ -n ${MIN_SIZE} ]] && find "${TASK_PATH}" -type f -size -${MIN_SIZE} -print0 | xargs -0 rm -vf 254 | [[ -n ${EXCLUDE_FILE} ]] && find "${TASK_PATH}" -type f -regextype posix-extended -iregex ".*\.(${EXCLUDE_FILE})" -print0 | xargs -0 rm -vf 255 | [[ -n ${INCLUDE_FILE} ]] && find "${TASK_PATH}" -type f -regextype posix-extended ! -iregex ".*\.(${INCLUDE_FILE})" -print0 | xargs -0 rm -vf 256 | [[ -n ${EXCLUDE_FILE_REGEX} ]] && find "${TASK_PATH}" -type f -regextype posix-extended -iregex "${EXCLUDE_FILE_REGEX}" -print0 | xargs -0 rm -vf 257 | [[ -n ${INCLUDE_FILE_REGEX} ]] && find "${TASK_PATH}" -type f -regextype posix-extended ! -iregex "${INCLUDE_FILE_REGEX}" -print0 | xargs -0 rm -vf 258 | fi 259 | } 260 | 261 | CLEAN_UP() { 262 | DELETE_DOT_ARIA2 263 | DELETE_DOT_TORRENT 264 | DELETE_EXCLUDE_FILE 265 | DELETE_EMPTY_DIR 266 | } 267 | 268 | TG_DL_FINISHED() { 269 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 270 | SEND_TG_MSG Aria2 "${TASK_FILE_NAME} 任务已完成" 271 | else 272 | SEND_TG_MSG Aria2 "${TASK_FILE_NAME} task completed" 273 | fi 274 | } 275 | 276 | TG_DL_FINISHED_RCLONE() { 277 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 278 | SEND_TG_MSG Aria2 "${TASK_FILE_NAME} 任务已完成并发送上传任务至 Rclone" 279 | else 280 | SEND_TG_MSG Aria2 "${TASK_FILE_NAME} task completed and send upload job to Rclone" 281 | fi 282 | } 283 | 284 | SEND_TG_MSG() { 285 | if [[ -f "${LOCAL_PATH}" ]] && [[ "${TG_EXCLUDE_FILE_EXTENSION}" != "" ]] && [[ "${TASK_FILE_NAME}" =~ \.(${TG_EXCLUDE_FILE_EXTENSION})$ ]]; then 286 | exit 0 287 | elif [[ -f "${LOCAL_PATH}" ]] && [[ "${TG_INCLUDE_FILE_EXTENSION}" != "" ]] && [[ ! "${TASK_FILE_NAME}" =~ \.(${TG_INCLUDE_FILE_EXTENSION})$ ]]; then 288 | exit 0 289 | fi 290 | if [ "${TELEGRAM_CHAT_ID}" != "" ]; then 291 | title="$TELEGRAM_TITLE $1" 292 | timestamp="$(DATE_TIME)" 293 | msg="$title $timestamp\n$(echo "$2" | sed -e 's|\\|\\\\|g' -e 's|\n|\\n|g' -e 's|\t|\\t|g' -e 's|\"|\\"|g')" 294 | entities="[{\"offset\":0,\"length\":${#title},\"type\":\"bold\"},{\"offset\":$((${#title} + 1)),\"length\":${#timestamp},\"type\":\"italic\"}]" 295 | data="{\"chat_id\":\"$TELEGRAM_CHAT_ID\",\"text\":\"$msg\",\"entities\":$entities,\"disable_notification\": true}" 296 | if [ "${TG_PROXY}" != "" ]; then 297 | PROXY_PARAM="-x ${TG_PROXY}" 298 | curl -s "${PROXY_PARAM}" -o /dev/null -H 'Content-Type: application/json' -X POST -d "$data" https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage 299 | else 300 | curl -s -o /dev/null -H 'Content-Type: application/json' -X POST -d "$data" https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage 301 | fi 302 | fi 303 | } -------------------------------------------------------------------------------- /content/aria2/delete.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:delete.sh 5 | # Description: Delete files after Aria2 download error or task removed 6 | # Version: 3.0 7 | # 8 | # Copyright (c) 2018-2021 P3TERX 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a copy 11 | # of this software and associated documentation files (the "Software"), to deal 12 | # in the Software without restriction, including without limitation the rights 13 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | # copies of the Software, and to permit persons to whom the Software is 15 | # furnished to do so, subject to the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included in all 18 | # copies or substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | 29 | CHECK_CORE_FILE() { 30 | CORE_FILE="$(dirname $0)/core" 31 | if [[ -f "${CORE_FILE}" ]]; then 32 | . "${CORE_FILE}" 33 | else 34 | echo "!!! core file does not exist !!!" 35 | exit 1 36 | fi 37 | } 38 | 39 | CHECK_RPC_CONECTION() { 40 | READ_ARIA2_CONF 41 | if [[ "${RPC_SECRET}" ]]; then 42 | RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.getVersion","id":"P3TERX","params":["token:'${RPC_SECRET}'"]}' 43 | else 44 | RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.getVersion","id":"P3TERX"}' 45 | fi 46 | (curl "${RPC_ADDRESS}" -fsSd "${RPC_PAYLOAD}" || curl "https://${RPC_ADDRESS}" -kfsSd "${RPC_PAYLOAD}") >/dev/null 47 | } 48 | 49 | DELETE_ON_STOP() { 50 | if [[ "${TASK_STATUS}" = "error" && "${DELETE_ON_ERROR}" = "true" ]] || [[ "${TASK_STATUS}" = "removed" && "${DELETE_ON_REMOVED}" = "true" ]]; then 51 | if [[ -f "${TASK_PATH}.aria2" ]]; then 52 | echo -e "$(DATE_TIME) ${INFO} Download task ${TASK_STATUS}, deleting files..." 53 | rm -vrf "${TASK_PATH}.aria2" "${TASK_PATH}" 54 | else 55 | [[ -e "${TASK_PATH}" ]] && 56 | echo -e "$(DATE_TIME) ${WARRING} Skip delete. Download completed files: ${TASK_PATH}" || 57 | echo -e "$(DATE_TIME) ${WARRING} Skip delete. File does not exist: ${TASK_PATH}" 58 | fi 59 | else 60 | echo -e "$(DATE_TIME) ${WARRING} Skip delete. Task status invalid: ${TASK_STATUS}" 61 | fi 62 | } 63 | 64 | DELETE_ON_UNKNOWN() { 65 | if [[ -f "${FILE_PATH}.aria2" ]]; then 66 | echo -e "$(DATE_TIME) ${INFO} Download task force removed, deleting files..." 67 | rm -vrf "${FILE_PATH}.aria2" "${FILE_PATH}" 68 | else 69 | [[ -e "${FILE_PATH}" ]] && 70 | echo -e "$(DATE_TIME) ${WARRING} Skip delete. Download completed files: ${FILE_PATH}" || 71 | echo -e "$(DATE_TIME) ${WARRING} Skip delete. File does not exist: ${FILE_PATH}" 72 | fi 73 | } 74 | 75 | DELETE_FILE() { 76 | if GET_TASK_INFO; then 77 | GET_DOWNLOAD_DIR 78 | GET_TASK_STATUS 79 | CONVERSION_PATH 80 | DELETE_ON_STOP 81 | CLEAN_UP 82 | elif CHECK_RPC_CONECTION && [[ "${DELETE_ON_UNKNOWN}" = "true" && ${FILE_NUM} -eq 1 ]]; then 83 | DELETE_ON_UNKNOWN 84 | else 85 | echo -e "$(DATE_TIME) ${ERROR} Aria2 RPC interface error!" 86 | exit 1 87 | fi 88 | } 89 | 90 | CHECK_CORE_FILE "$@" 91 | CHECK_PARAMETER "$@" 92 | CHECK_FILE_NUM 93 | CHECK_SCRIPT_CONF 94 | DELETE_FILE 95 | exit 0 96 | -------------------------------------------------------------------------------- /content/aria2/dht.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/content/aria2/dht.dat -------------------------------------------------------------------------------- /content/aria2/tracker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:tracker.sh 5 | # Description: Get BT trackers and add to Aria2 6 | # Version: 3.1 7 | # 8 | # Copyright (c) 2018-2021 P3TERX 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a copy 11 | # of this software and associated documentation files (the "Software"), to deal 12 | # in the Software without restriction, including without limitation the rights 13 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | # copies of the Software, and to permit persons to whom the Software is 15 | # furnished to do so, subject to the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included in all 18 | # copies or substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # BT tracker is provided by the following project. 29 | # https://github.com/XIU2/TrackersListCollection 30 | # 31 | # Fallback URLs provided by jsDelivr 32 | # https://www.jsdelivr.com 33 | # 34 | # 注意: 执行此文件将会覆盖aria2配置文件原有tracker列表。 35 | # Warning: This script will override your tracker list in aria2 config file. 36 | # 37 | 38 | RED_FONT_PREFIX="\033[31m" 39 | GREEN_FONT_PREFIX="\033[32m" 40 | YELLOW_FONT_PREFIX="\033[1;33m" 41 | LIGHT_PURPLE_FONT_PREFIX="\033[1;35m" 42 | FONT_COLOR_SUFFIX="\033[0m" 43 | INFO="[${GREEN_FONT_PREFIX}INFO${FONT_COLOR_SUFFIX}]" 44 | ERROR="[${RED_FONT_PREFIX}ERROR${FONT_COLOR_SUFFIX}]" 45 | ARIA2_CONF=${1:-aria2*.conf} 46 | SCRIPT_CONF="/mnt/data/config/script.conf" 47 | ARIA2_AUTO_TRACKER="$(grep ^aria2-auto-tracker-update "${SCRIPT_CONF}" | cut -d= -f2-)" 48 | DOWNLOADER="curl -fsSL --connect-timeout 3 --max-time 3 --retry 2" 49 | NL=$'\n' 50 | 51 | DATE_TIME() { 52 | date +"%m/%d %H:%M:%S" 53 | } 54 | 55 | GET_TRACKERS() { 56 | 57 | if [[ -z "${CUSTOM_TRACKER_URL}" ]]; then 58 | echo && echo -e "$(DATE_TIME) ${INFO} Get BT trackers..." 59 | TRACKER=$( 60 | ${DOWNLOADER} https://trackerslist.com/all_aria2.txt || 61 | ${DOWNLOADER} https://cdn.jsdelivr.net/gh/XIU2/TrackersListCollection@master/all_aria2.txt || 62 | ${DOWNLOADER} https://trackers.p3terx.com/all_aria2.txt 63 | ) 64 | else 65 | echo && echo -e "$(DATE_TIME) ${INFO} Get BT trackers from url(s):${CUSTOM_TRACKER_URL} ..." 66 | URLS=$(echo ${CUSTOM_TRACKER_URL} | tr "," "$NL") 67 | for URL in $URLS; do 68 | TRACKER+="$(${DOWNLOADER} ${URL} | tr "," "\n")$NL" 69 | done 70 | TRACKER="$(echo "$TRACKER" | awk NF | sort -u | sed 'H;1h;$!d;x;y/\n/,/' )" 71 | fi 72 | 73 | [[ -z "${TRACKER}" ]] && { 74 | echo 75 | echo -e "$(DATE_TIME) ${ERROR} Unable to get trackers, network failure or invalid links." && exit 1 76 | } 77 | } 78 | 79 | ECHO_TRACKERS() { 80 | echo -e " 81 | --------------------[BitTorrent Trackers]-------------------- 82 | ${TRACKER} 83 | --------------------[BitTorrent Trackers]-------------------- 84 | " 85 | } 86 | 87 | ADD_TRACKERS() { 88 | echo -e "$(DATE_TIME) ${INFO} Adding BT trackers to Aria2 configuration file ${LIGHT_PURPLE_FONT_PREFIX}${ARIA2_CONF}${FONT_COLOR_SUFFIX} ..." && echo 89 | if [ ! -f ${ARIA2_CONF} ]; then 90 | echo -e "$(DATE_TIME) ${ERROR} '${ARIA2_CONF}' does not exist." 91 | exit 1 92 | else 93 | [ -z $(grep "bt-tracker=" ${ARIA2_CONF}) ] && echo "bt-tracker=" >>${ARIA2_CONF} 94 | sed -i "s@^\(bt-tracker=\).*@\1${TRACKER}@" ${ARIA2_CONF} && echo -e "$(DATE_TIME) ${INFO} BT trackers successfully added to Aria2 configuration file !" 95 | fi 96 | } 97 | 98 | ADD_TRACKERS_RPC() { 99 | if [[ "${RPC_SECRET}" ]]; then 100 | RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.changeGlobalOption","id":"P3TERX","params":["token:'${RPC_SECRET}'",{"bt-tracker":"'${TRACKER}'"}]}' 101 | else 102 | RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.changeGlobalOption","id":"P3TERX","params":[{"bt-tracker":"'${TRACKER}'"}]}' 103 | fi 104 | curl "${RPC_ADDRESS}" -fsSd "${RPC_PAYLOAD}" || curl "https://${RPC_ADDRESS}" -kfsSd "${RPC_PAYLOAD}" 105 | } 106 | 107 | ADD_TRACKERS_RPC_STATUS() { 108 | RPC_RESULT=$(ADD_TRACKERS_RPC) 109 | [[ $(echo ${RPC_RESULT} | grep OK) ]] && 110 | echo -e "$(DATE_TIME) ${INFO} BT trackers successfully added to Aria2 !" || 111 | echo -e "$(DATE_TIME) ${ERROR} Network failure or Aria2 RPC interface error!" 112 | } 113 | 114 | ADD_TRACKERS_REMOTE_RPC() { 115 | echo -e "$(DATE_TIME) ${INFO} Adding BT trackers to remote Aria2: ${LIGHT_PURPLE_FONT_PREFIX}${RPC_ADDRESS%/*}${FONT_COLOR_SUFFIX} ..." && echo 116 | ADD_TRACKERS_RPC_STATUS 117 | } 118 | 119 | ADD_TRACKERS_LOCAL_RPC() { 120 | if [ ! -f ${ARIA2_CONF} ]; then 121 | echo -e "$(DATE_TIME) ${ERROR} '${ARIA2_CONF}' does not exist." 122 | exit 1 123 | else 124 | RPC_PORT=$(grep ^rpc-listen-port ${ARIA2_CONF} | cut -d= -f2-) 125 | RPC_SECRET=$(grep ^rpc-secret ${ARIA2_CONF} | cut -d= -f2-) 126 | [[ ${RPC_PORT} ]] || { 127 | echo -e "$(DATE_TIME) ${ERROR} Aria2 configuration file incomplete." 128 | exit 1 129 | } 130 | RPC_ADDRESS="localhost:${RPC_PORT}/jsonrpc" 131 | echo -e "$(DATE_TIME) ${INFO} Adding BT trackers to Aria2 ..." && echo 132 | ADD_TRACKERS_RPC_STATUS 133 | fi 134 | } 135 | 136 | [ $(command -v curl) ] || { 137 | echo -e "$(DATE_TIME) ${ERROR} curl is not installed." 138 | exit 1 139 | } 140 | 141 | 142 | if [ "${ARIA2_AUTO_TRACKER}" != "enable" ]; then 143 | exit 0 144 | elif [ "$1" = "cat" ]; then 145 | GET_TRACKERS 146 | ECHO_TRACKERS 147 | elif [ "$1" = "RPC" ]; then 148 | RPC_ADDRESS="$2/jsonrpc" 149 | RPC_SECRET="$3" 150 | GET_TRACKERS 151 | ECHO_TRACKERS 152 | ADD_TRACKERS_REMOTE_RPC 153 | elif [ "$2" = "RPC" ]; then 154 | GET_TRACKERS 155 | ECHO_TRACKERS 156 | ADD_TRACKERS 157 | echo 158 | ADD_TRACKERS_LOCAL_RPC 159 | else 160 | GET_TRACKERS 161 | ECHO_TRACKERS 162 | ADD_TRACKERS 163 | fi 164 | 165 | exit 0 166 | -------------------------------------------------------------------------------- /content/aria2/upload.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:move_remote.sh 5 | 6 | # Description: Move files to finished folder after Aria2 download is complete, then use Rclone to move files to Rclone Remote. 7 | # Version: 3.1 8 | # 9 | # Copyright (c) 2018-2021 P3TERX 10 | # 11 | # Modified by wy580477 for customized container 12 | # 13 | # Permission is hereby granted, free of charge, to any person obtaining a copy 14 | # of this software and associated documentation files (the "Software"), to deal 15 | # in the Software without restriction, including without limitation the rights 16 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | # copies of the Software, and to permit persons to whom the Software is 18 | # furnished to do so, subject to the following conditions: 19 | # 20 | # The above copyright notice and this permission notice shall be included in all 21 | # copies or substantial portions of the Software. 22 | # 23 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 29 | # SOFTWARE. 30 | 31 | CHECK_CORE_FILE() { 32 | CORE_FILE="$(dirname $0)/core" 33 | if [[ -f "${CORE_FILE}" ]]; then 34 | . "${CORE_FILE}" 35 | else 36 | echo && echo "!!! core file does not exist !!!" 37 | exit 1 38 | fi 39 | } 40 | 41 | TASK_INFO() { 42 | echo -e " 43 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 44 | ${LIGHT_PURPLE_FONT_PREFIX}Task GID:${FONT_COLOR_SUFFIX} ${TASK_GID} 45 | ${LIGHT_PURPLE_FONT_PREFIX}Number of Files:${FONT_COLOR_SUFFIX} ${FILE_NUM} 46 | ${LIGHT_PURPLE_FONT_PREFIX}First File Path:${FONT_COLOR_SUFFIX} ${FILE_PATH} 47 | ${LIGHT_PURPLE_FONT_PREFIX}Task File Name:${FONT_COLOR_SUFFIX} ${TASK_FILE_NAME} 48 | ${LIGHT_PURPLE_FONT_PREFIX}Task Path:${FONT_COLOR_SUFFIX} ${TASK_PATH} 49 | ${LIGHT_PURPLE_FONT_PREFIX}Aria2 Download Directory:${FONT_COLOR_SUFFIX} ${ARIA2_DOWNLOAD_DIR} 50 | ${LIGHT_PURPLE_FONT_PREFIX}Custom Download Directory:${FONT_COLOR_SUFFIX} ${DOWNLOAD_DIR} 51 | ${LIGHT_PURPLE_FONT_PREFIX}Local Path:${FONT_COLOR_SUFFIX} ${LOCAL_PATH} 52 | ${LIGHT_PURPLE_FONT_PREFIX}Remote Path:${FONT_COLOR_SUFFIX} ${REMOTE_PATH} 53 | ${LIGHT_PURPLE_FONT_PREFIX}.aria2 File Path:${FONT_COLOR_SUFFIX} ${DOT_ARIA2_FILE} 54 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 55 | " 56 | } 57 | 58 | OUTPUT_UPLOAD_LOG() { 59 | LOG="${UPLOAD_LOG}" 60 | LOG_PATH="${UPLOAD_LOG_PATH}" 61 | OUTPUT_LOG 62 | } 63 | 64 | DEFINITION_PATH() { 65 | LOCAL_PATH="${TASK_PATH}" 66 | D_PATH="$(echo ${ARIA2_DOWNLOAD_DIR} | sed 's/\r$//')" 67 | PATH_SUFFIX="${DOWNLOAD_DIR#"${D_PATH}"}" 68 | if [[ "${ARIA_DRIVE_DIR}" =~ :/ ]]; then 69 | REMOTE_PATH="${ARIA_DRIVE_DIR}${PATH_SUFFIX}" 70 | else 71 | REMOTE_PATH="${DRIVENAME}:${DRIVE_DIR}${PATH_SUFFIX}" 72 | fi 73 | } 74 | 75 | UPLOAD_FILE() { 76 | if [ "${UPLOAD_MODE}" = "disable" ]; then 77 | echo "$(DATE_TIME) [INFO] Auto-upload to Rclone remote disabled" 78 | TG_DL_FINISHED 79 | exit 0 80 | elif [[ -f "${LOCAL_PATH}" ]] && [[ "${EXCLUDE_FILE_EXTENSION}" != "" ]] && [[ "${TASK_FILE_NAME}" =~ \.(${EXCLUDE_FILE_EXTENSION})$ ]]; then 81 | echo "$(DATE_TIME) [INFO] File is excluded from auto-upload" 82 | TG_DL_FINISHED 83 | exit 0 84 | elif [[ -f "${LOCAL_PATH}" ]] && [[ "${INCLUDE_FILE_EXTENSION}" != "" ]] && [[ ! "${TASK_FILE_NAME}" =~ \.(${INCLUDE_FILE_EXTENSION})$ ]]; then 85 | echo "$(DATE_TIME) [INFO] File is excluded from auto-upload" 86 | TG_DL_FINISHED 87 | exit 0 88 | else 89 | TG_DL_FINISHED_RCLONE 90 | fi 91 | echo -e "$(DATE_TIME) ${INFO} Start upload files..." 92 | TASK_INFO 93 | if [ -f "${LOCAL_PATH}" ]; then 94 | JOB_ID="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"srcFs":"'"${DOWNLOAD_DIR}"'","srcRemote":"'"${TASK_FILE_NAME}"'","dstFs":"'"${REMOTE_PATH}"'","dstRemote":"'"${TASK_FILE_NAME}"'","_async":"true"}' 'localhost:61802/operations/'${UPLOAD_MODE}'file' | jq .jobid | sed 's/\"//g')" 95 | else 96 | JOB_ID="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"srcFs":"'"${LOCAL_PATH}"'","dstFs":"'"${REMOTE_PATH}"'/'"${TASK_FILE_NAME}"'","_async":"true"}' 'localhost:61802/sync/'${UPLOAD_MODE}'' | jq .jobid | sed 's/\"//g')" 97 | fi 98 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 99 | RCLONE_SEND_MSG="已成功发生任务至 Rclone" 100 | RCLONE_NO_STATUS_MSG="无法获取 Rclone 任务状态" 101 | RCLONE_SUCCESS_MSG="Rclone 任务已成功完成" 102 | RCLONE_ERROR_MSG="Rclone 错误" 103 | RCLONE_FAIL_MSG="无法发送任务至 Rclone" 104 | else 105 | RCLONE_SEND_MSG="Successfully send job to Rclone" 106 | RCLONE_NO_STATUS_MSG="Faile to get Rclone job status" 107 | RCLONE_SUCCESS_MSG="Rclone job successfully finished" 108 | RCLONE_ERROR_MSG="Rclone Error" 109 | RCLONE_FAIL_MSG="Failed to send job to Rclone" 110 | fi 111 | RCLONE_ERROR="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"${JOB_ID}"'"}' 'localhost:61802/job/status' | jq .error | sed 's/\"//g')" 112 | if [[ "${JOB_ID}" != "" ]] && [[ "${RCLONE_ERROR}" = "" ]]; then 113 | UPLOAD_LOG="$(DATE_TIME) ${INFO} ${RCLONE_SEND_MSG}: ${LOCAL_PATH} -> ${REMOTE_PATH}" 114 | OUTPUT_UPLOAD_LOG 115 | RCLONE_FINISHED="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"${JOB_ID}"'"}' 'localhost:61802/job/status' | jq .finished)" 116 | while [[ "${RCLONE_FINISHED}" = "false" ]]; do 117 | RCLONE_FINISHED="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"${JOB_ID}"'"}' 'localhost:61802/job/status' | jq .finished)" 118 | RCLONE_ERROR="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"${JOB_ID}"'"}' 'localhost:61802/job/status' | jq .error | sed 's/\"//g')" 119 | sleep 10 120 | done 121 | RCLONE_SUCCESS="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"${JOB_ID}"'"}' 'localhost:61802/job/status' | jq .success)" 122 | if [ "${RCLONE_FINISHED}" = "" ]; then 123 | echo "[INFO] ${RCLONE_NO_STATUS_MSG}: ${LOCAL_PATH} -> ${REMOTE_PATH}" 124 | SEND_TG_MSG Rclone "[INFO] ${RCLONE_NO_STATUS_MSG}: ${LOCAL_PATH} -> ${REMOTE_PATH}" 125 | elif [ "${RCLONE_ERROR}" != "" ]; then 126 | echo "[ERROR] ${RCLONE_ERROR_MSG}: ${RCLONE_ERROR}, ${LOCAL_PATH} -> ${REMOTE_PATH}" 127 | SEND_TG_MSG Rclone "[ERROR] ${RCLONE_ERROR_MSG}: ${RCLONE_ERROR}, ${LOCAL_PATH} -> ${REMOTE_PATH}" 128 | elif [ "${RCLONE_SUCCESS}" = "true" ]; then 129 | echo "[INFO] ${RCLONE_SUCCESS_MSG}: ${LOCAL_PATH} -> ${REMOTE_PATH}" 130 | SEND_TG_MSG Rclone "[INFO] ${RCLONE_SUCCESS_MSG}: ${LOCAL_PATH} -> ${REMOTE_PATH}" 131 | fi 132 | DELETE_EMPTY_DIR 133 | elif [ "${RCLONE_ERROR}" != "" ]; then 134 | UPLOAD_LOG="$(DATE_TIME) [ERROR] ${RCLONE_ERROR_MSG}: ${RCLONE_ERROR}, ${LOCAL_PATH} -> ${REMOTE_PATH}" 135 | OUTPUT_UPLOAD_LOG 136 | SEND_TG_MSG Rclone "[ERROR] ${RCLONE_ERROR_MSG}: ${RCLONE_ERROR}, ${LOCAL_PATH} -> ${REMOTE_PATH}" 137 | else 138 | curl -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"${JOB_ID}"'"}' 'localhost:61802/job/status' 139 | UPLOAD_LOG="$(DATE_TIME) [ERROR] ${RCLONE_FAIL_MSG}: ${LOCAL_PATH}" 140 | OUTPUT_UPLOAD_LOG 141 | SEND_TG_MSG Rclone "[ERROR] ${RCLONE_FAIL_MSG}: ${LOCAL_PATH}" 142 | fi 143 | } 144 | 145 | CHECK_CORE_FILE "$@" 146 | CHECK_SCRIPT_CONF 147 | CHECK_FILE_NUM 148 | GET_TASK_INFO 149 | GET_DOWNLOAD_DIR 150 | CONVERSION_PATH 151 | DEFINITION_PATH 152 | CLEAN_UP 153 | UPLOAD_FILE 154 | exit 0 155 | -------------------------------------------------------------------------------- /content/bashrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export LS_OPTIONS='--color=auto' 4 | alias ls='ls $LS_OPTIONS' 5 | alias ll='ls $LS_OPTIONS -l' 6 | alias l='ls $LS_OPTIONS -lA' 7 | export PS1='\w$ ' 8 | export HOME=/mnt/data 9 | alias dlpr="yt-dlp --exec ytdlptorclone.sh -P /mnt/data/videos" 10 | alias dlptg="yt-dlp --exec ytdlpuptg.sh -P /mnt/data/videos" 11 | alias gdlr="gallery-dl -c /mnt/data/config/gallery-dl.conf --exec-after '/workdir/gdltorclone.sh {}'" 12 | cd 13 | -------------------------------------------------------------------------------- /content/callapi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"srcFs":"'"$2"'","dstFs":"'"$3"'","_async":"true"}' 'localhost:61802/sync/'$1'' 4 | EXIT_CODE=$? 5 | if [ ${EXIT_CODE} -eq 0 ]; then 6 | echo "[INFO] Successfully send job to rclone: $2 -> $3" 7 | else 8 | echo "[ERROR] Failed to send job to rclone: $2" 9 | fi -------------------------------------------------------------------------------- /content/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Write dyno start time 4 | echo $(date +%s) >/workdir/container_start_time 5 | 6 | # Restore backup 7 | RESTORE_BACKUP() { 8 | BACKUP=$(curl --retry 4 https://${CLOUDFLARE_WORKERS_HOST}/backup?key=${CLOUDFLARE_WORKERS_KEY} | jq .value | sed "s|\"||g") 9 | DIR_TMP="$(mktemp -d)" 10 | echo ${BACKUP} | base64 -d >${DIR_TMP}/backup.tar.gz 11 | tar -zxf ${DIR_TMP}/backup.tar.gz -C /mnt/data 12 | mv /mnt/data/config/settings /workdir/.pyload 2>/dev/null 13 | mv /mnt/data/config/gallery-dl /mnt/data/.cache 2>/dev/null 14 | mv /mnt/data/config/.config /mnt/data 2>/dev/null 15 | rm -rf ${DIR_TMP} 16 | } 17 | 18 | SEND_TG_MSG() { 19 | SCRIPT_CONF="/mnt/data/config/script.conf" 20 | TELEGRAM_BOT_TOKEN="$(grep ^telegram-bot-token "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 21 | TELEGRAM_CHAT_ID="$(grep ^telegram-chat-id "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 22 | TELEGRAM_TITLE="$(grep ^telegram-notification-title "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 23 | TG_PROXY="$(grep ^telegram-proxy "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 24 | if [ "${TELEGRAM_CHAT_ID}" != "" ]; then 25 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 26 | msgbody="容器已启动" 27 | else 28 | msgbody="Container started" 29 | fi 30 | title="$TELEGRAM_TITLE" 31 | timestamp="$(date +"%m/%d %H:%M:%S")" 32 | msg="$title $timestamp\n$(echo "$msgbody" | sed -e 's|\\|\\\\|g' -e 's|\n|\\n|g' -e 's|\t|\\t|g' -e 's|\"|\\"|g')" 33 | entities="[{\"offset\":0,\"length\":${#title},\"type\":\"bold\"},{\"offset\":$((${#title} + 1)),\"length\":${#timestamp},\"type\":\"italic\"}]" 34 | data="{\"chat_id\":\"$TELEGRAM_CHAT_ID\",\"text\":\"$msg\",\"entities\":$entities,\"disable_notification\": true}" 35 | if [ "${TG_PROXY}" != "" ]; then 36 | PROXY_PARAM="-x ${TG_PROXY}" 37 | curl -s "${PROXY_PARAM}" -o /dev/null -H 'Content-Type: application/json' -X POST -d "$data" https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage 38 | else 39 | curl -s -o /dev/null -H 'Content-Type: application/json' -X POST -d "$data" https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage 40 | fi 41 | fi 42 | } 43 | 44 | mkdir -p /mnt/data/config /mnt/data/qbit_downloads /mnt/data/aria2_downloads /mnt/data/videos /workdir/.pyload /mnt/data/.cache 45 | WORKER_STATUS=$(curl -4 --retry 4 https://${CLOUDFLARE_WORKERS_HOST} | jq .status | sed "s|\"||g") 46 | 47 | if [ "${WORKER_STATUS}" = "Running" ]; then 48 | RESTORE_BACKUP 49 | else 50 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 51 | echo "无法连接 Cloudflare Workers" 52 | else 53 | echo "Cloudflare Workers is not working" 54 | fi 55 | touch /workdir/workers_fail.lock 56 | fi 57 | 58 | if [ ! -f "/mnt/data/config/script.conf" ]; then 59 | cp /workdir/script.conf /mnt/data/config/script.conf 60 | fi 61 | 62 | SEND_TG_MSG 63 | 64 | exec runsvdir /etc/service 65 | -------------------------------------------------------------------------------- /content/gallery-dl.conf: -------------------------------------------------------------------------------- 1 | { 2 | "base-directory": "/mnt/data/gallery_dl_downloads", 3 | "output": { 4 | "log": { 5 | "level": "info", 6 | "format": "{asctime} [{levelname}][{name}]: {message}", 7 | "format-date": "%H:%M:%S" 8 | }, 9 | "logfile": { 10 | "level": "info", 11 | "format": "{asctime} [{levelname}][{name}]: {message}", 12 | "format-date": "%H:%M:%S", 13 | "path": "/mnt/data/log/gallery_dl.log", 14 | "mode": "a" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /content/gdltorclone.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Created by wy580477 for customized container 4 | # 5 | 6 | LOCAL_PATH="$1" 7 | source /workdir/script_core.sh 8 | 9 | DEFINITION_PATH() { 10 | UPLOAD_MODE="$(grep ^gallery-dl-upload-mode /mnt/data/config/script.conf | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 11 | DOWNLOAD_DIR="$(jq '."base-directory"' /mnt/data/config/gallery-dl.conf | sed 's/\"//g;s/\r$//')" 12 | GDL_DRIVE_DIR="$(grep ^gdl-drive-dir /mnt/data/config/script.conf | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 13 | BASE_PATH="${LOCAL_PATH#"${DOWNLOAD_DIR%/}"}" 14 | MSG_PATH="${LOCAL_PATH}" 15 | FOLDER_NAME="${BASE_PATH}" 16 | if [[ "${GDL_DRIVE_DIR}" =~ :/ ]]; then 17 | REMOTE_PATH="${GDL_DRIVE_DIR}${BASE_PATH}" 18 | else 19 | if [ "${GDL_DRIVE_DIR}" = "" ]; then 20 | DRIVE_DIR=${GLOBAL_DRIVE_DIR}/gallery-dl 21 | else 22 | DRIVE_DIR=${GDL_DRIVE_DIR} 23 | fi 24 | REMOTE_PATH="${DRIVENAME}:${DRIVE_DIR}${BASE_PATH}" 25 | fi 26 | } 27 | 28 | UPLOAD_TASK() { 29 | if [ "${UPLOAD_MODE}" = "disable" ]; then 30 | SEND_TG_FINISHED 31 | echo "$(DATE_TIME) [INFO] Auto-upload to Rclone remote disabled" 32 | else 33 | SEND_TG_FINISHED_TO_RCLONE 34 | UPLOAD_FOLDER 35 | fi 36 | if [ "${JOB_ID}" = "" ]; then 37 | exit 1 38 | fi 39 | } 40 | 41 | GET_PATH 42 | DEFINITION_PATH 43 | SEND_TG_FINISHED 44 | UPLOAD_TASK 45 | CLEAN_EMPTY_DIR 46 | -------------------------------------------------------------------------------- /content/homer_conf/AriaNg.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/content/homer_conf/AriaNg.ico -------------------------------------------------------------------------------- /content/homer_conf/OliveTin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/content/homer_conf/OliveTin.png -------------------------------------------------------------------------------- /content/homer_conf/filebrowser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/content/homer_conf/filebrowser.png -------------------------------------------------------------------------------- /content/homer_conf/homer_chs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Homepage configuration 3 | # See https://fontawesome.com/icons for icons options 4 | # Modified by wy580477 for customized container 5 | 6 | title: "TELEGRAM_TITLE Dashboard" 7 | subtitle: "Homer" 8 | logo: "logo.png" 9 | # icon: "fas fa-skull-crossbones" # Optional icon 10 | 11 | header: false 12 | footer: '

Created with ❤️ with bulma, vuejs & font awesome // Fork me on

' # set false if you want to hide it. 13 | connectivityCheck: false 14 | 15 | # Optional theme customization 16 | theme: default 17 | colors: 18 | light: 19 | highlight-primary: "#3367d6" 20 | highlight-secondary: "#4285f4" 21 | highlight-hover: "#5a95f5" 22 | background: "#f5f5f5" 23 | card-background: "#ffffff" 24 | text: "#363636" 25 | text-header: "#ffffff" 26 | text-title: "#303030" 27 | text-subtitle: "#424242" 28 | card-shadow: rgba(0, 0, 0, 0.1) 29 | link: "#3273dc" 30 | link-hover: "#363636" 31 | dark: 32 | highlight-primary: "#3367d6" 33 | highlight-secondary: "#4285f4" 34 | highlight-hover: "#5a95f5" 35 | background: "#131313" 36 | card-background: "#2b2b2b" 37 | text: "#eaeaea" 38 | text-header: "#ffffff" 39 | text-title: "#fafafa" 40 | text-subtitle: "#f5f5f5" 41 | card-shadow: rgba(0, 0, 0, 0.4) 42 | link: "#3273dc" 43 | link-hover: "#ffdd57" 44 | 45 | # Optional message 46 | message: 47 | #url: https://b4bz.io 48 | style: "is-dark" # See https://bulma.io/documentation/components/message/#colors for styling options. 49 | #title: "Demo !" 50 | # icon: "fa fa-grin" 51 | content: "容器运行时间:
Rclone Webdav Path: GLOBAL_PORTAL_PATH/rclonedav
" 52 | 53 | # Optional navbar 54 | # links: [] # Allows for navbar (dark mode, layout, and search) without any links 55 | links: 56 | - name: "Google" 57 | url: "https://www.google.com/" 58 | - name: "Youtube" 59 | url: "https://www.youtube.com/" 60 | - name: "Twitter" 61 | url: "https://twitter.com/" 62 | - name: "Reddit" 63 | url: "www.reddit.com/" 64 | - name: "Wikipedia" 65 | url: "https://www.wikipedia.org/" 66 | 67 | # this will link to a second homer page that will load config from additionnal-page.yml and keep default config values as in config.yml file 68 | # see url field and assets/additionnal-page.yml.dist used in this example: 69 | # - name: "another page!" 70 | # icon: "fas fa-file-alt" 71 | # url: "#additionnal-page" 72 | 73 | # Services 74 | # First level array represent a group. 75 | # Leave only a "items" key if not using group (group name, icon & tagstyle are optional, section separation will not be displayed). 76 | services: 77 | - name: "Web 应用" 78 | icon: "fas fa-cloud" 79 | items: 80 | - name: "OliveTin" 81 | logo: "./assets/tools/OliveTin.png" 82 | subtitle: "在网页上执行预定义 shell 指令" 83 | tag: "app" 84 | url: "GLOBAL_PORTAL_PATH/olivetin" 85 | target: "_blank" # optional html a tag target attribute 86 | - name: "AriaNg" 87 | logo: "./assets/tools/AriaNg.ico" 88 | subtitle: "Aria2 Web 前端" 89 | tag: "app" 90 | url: "GLOBAL_PORTAL_PATH/ariang" 91 | target: "_blank" # optional html a tag target attribute 92 | - name: "pyLoad" 93 | logo: "./assets/tools/pyload.png" 94 | subtitle: "开源下载管理器" 95 | tag: "app" 96 | url: "GLOBAL_PORTAL_PATH/pyload" 97 | target: "_blank" # optional html a tag target attribute 98 | - name: "qBittorrent" 99 | logo: "./assets/tools/qbit.ico" 100 | subtitle: "BitTorrent 客户端" 101 | tag: "app" 102 | url: "GLOBAL_PORTAL_PATH/qbit" 103 | target: "_blank" # optional html a tag target attribute 104 | - name: "VueTorrent" 105 | logo: "./assets/tools/vue.png" 106 | subtitle: "qBittorrent Web 前端" 107 | tag: "app" 108 | url: "GLOBAL_PORTAL_PATH/vue" 109 | target: "_blank" # optional html a tag target attribute 110 | - name: "Filebrowser" 111 | logo: "./assets/tools/filebrowser.png" 112 | subtitle: "Filebrowser 轻量个人网盘" 113 | tag: "app" 114 | url: "GLOBAL_PORTAL_PATH/files" 115 | target: "_blank" 116 | - name: "Rclone Web UI" 117 | logo: "./assets/tools/rcloneng.png" 118 | subtitle: "Rclone Web 前端" 119 | tag: "app" 120 | url: "GLOBAL_PORTAL_PATH/rcloneweb" 121 | target: "_blank" 122 | - name: "Rclone Serve" 123 | logo: "./assets/tools/rcloneng.png" 124 | subtitle: "Rclone 远程存储文件列表" 125 | tag: "app" 126 | url: "GLOBAL_PORTAL_PATH/rclonerc/" 127 | target: "_blank" 128 | - name: "ttyd" 129 | logo: "./assets/tools/ttyd.png" 130 | subtitle: "Web 共享终端" 131 | tag: "app" 132 | url: "GLOBAL_PORTAL_PATH/ttyd" 133 | target: "_blank" 134 | -------------------------------------------------------------------------------- /content/homer_conf/homer_en.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Homepage configuration 3 | # See https://fontawesome.com/icons for icons options 4 | # Modified by wy580477 for customized container 5 | 6 | title: "TELEGRAM_TITLE Dashboard" 7 | subtitle: "Homer" 8 | logo: "logo.png" 9 | # icon: "fas fa-skull-crossbones" # Optional icon 10 | 11 | header: false 12 | footer: '

Created with ❤️ with bulma, vuejs & font awesome // Fork me on

' # set false if you want to hide it. 13 | connectivityCheck: false 14 | 15 | # Optional theme customization 16 | theme: default 17 | colors: 18 | light: 19 | highlight-primary: "#3367d6" 20 | highlight-secondary: "#4285f4" 21 | highlight-hover: "#5a95f5" 22 | background: "#f5f5f5" 23 | card-background: "#ffffff" 24 | text: "#363636" 25 | text-header: "#ffffff" 26 | text-title: "#303030" 27 | text-subtitle: "#424242" 28 | card-shadow: rgba(0, 0, 0, 0.1) 29 | link: "#3273dc" 30 | link-hover: "#363636" 31 | dark: 32 | highlight-primary: "#3367d6" 33 | highlight-secondary: "#4285f4" 34 | highlight-hover: "#5a95f5" 35 | background: "#131313" 36 | card-background: "#2b2b2b" 37 | text: "#eaeaea" 38 | text-header: "#ffffff" 39 | text-title: "#fafafa" 40 | text-subtitle: "#f5f5f5" 41 | card-shadow: rgba(0, 0, 0, 0.4) 42 | link: "#3273dc" 43 | link-hover: "#ffdd57" 44 | 45 | # Optional message 46 | message: 47 | #url: https://b4bz.io 48 | style: "is-dark" # See https://bulma.io/documentation/components/message/#colors for styling options. 49 | #title: "Demo !" 50 | # icon: "fa fa-grin" 51 | content: "Container Uptime:
Rclone Webdav Path: GLOBAL_PORTAL_PATH/rclonedav
" 52 | 53 | # Optional navbar 54 | # links: [] # Allows for navbar (dark mode, layout, and search) without any links 55 | links: 56 | - name: "Google" 57 | url: "https://www.google.com/" 58 | - name: "Youtube" 59 | url: "https://www.youtube.com/" 60 | - name: "Twitter" 61 | url: "https://twitter.com/" 62 | - name: "Reddit" 63 | url: "www.reddit.com/" 64 | - name: "Wikipedia" 65 | url: "https://www.wikipedia.org/" 66 | 67 | # this will link to a second homer page that will load config from additionnal-page.yml and keep default config values as in config.yml file 68 | # see url field and assets/additionnal-page.yml.dist used in this example: 69 | # - name: "another page!" 70 | # icon: "fas fa-file-alt" 71 | # url: "#additionnal-page" 72 | 73 | # Services 74 | # First level array represent a group. 75 | # Leave only a "items" key if not using group (group name, icon & tagstyle are optional, section separation will not be displayed). 76 | services: 77 | - name: "Applications" 78 | icon: "fas fa-cloud" 79 | items: 80 | - name: "OliveTin" 81 | logo: "./assets/tools/OliveTin.png" 82 | subtitle: "Web UI for predefined shell commands" 83 | tag: "app" 84 | url: "GLOBAL_PORTAL_PATH/olivetin" 85 | target: "_blank" # optional html a tag target attribute 86 | - name: "AriaNg" 87 | logo: "./assets/tools/AriaNg.ico" 88 | subtitle: "Web frontend for Aria2" 89 | tag: "app" 90 | url: "GLOBAL_PORTAL_PATH/ariang" 91 | target: "_blank" # optional html a tag target attribute 92 | - name: "pyLoad" 93 | logo: "./assets/tools/pyload.png" 94 | subtitle: "Download Manager for one-click hosters" 95 | tag: "app" 96 | url: "GLOBAL_PORTAL_PATH/pyload" 97 | target: "_blank" # optional html a tag target attribute 98 | - name: "qBittorrent" 99 | logo: "./assets/tools/qbit.ico" 100 | subtitle: "BitTorrent client" 101 | tag: "app" 102 | url: "GLOBAL_PORTAL_PATH/qbit" 103 | target: "_blank" # optional html a tag target attribute 104 | - name: "VueTorrent" 105 | logo: "./assets/tools/vue.png" 106 | subtitle: "qBittorrent WebUI" 107 | tag: "app" 108 | url: "GLOBAL_PORTAL_PATH/vue" 109 | target: "_blank" # optional html a tag target attribute 110 | - name: "Filebrowser" 111 | logo: "./assets/tools/filebrowser.png" 112 | subtitle: "Web File Browser" 113 | tag: "app" 114 | url: "GLOBAL_PORTAL_PATH/files" 115 | target: "_blank" 116 | - name: "Rclone Web UI" 117 | logo: "./assets/tools/rcloneng.png" 118 | subtitle: "Full fledged UI for Rclone" 119 | tag: "app" 120 | url: "GLOBAL_PORTAL_PATH/rcloneweb" 121 | target: "_blank" 122 | - name: "Rclone Serve" 123 | logo: "./assets/tools/rcloneng.png" 124 | subtitle: "Serve Rclone remote over HTTP" 125 | tag: "app" 126 | url: "GLOBAL_PORTAL_PATH/rclonerc/" 127 | target: "_blank" 128 | - name: "ttyd" 129 | logo: "./assets/tools/ttyd.png" 130 | subtitle: "Share your terminal over the web" 131 | tag: "app" 132 | url: "GLOBAL_PORTAL_PATH/ttyd" 133 | target: "_blank" 134 | -------------------------------------------------------------------------------- /content/homer_conf/pyload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/content/homer_conf/pyload.png -------------------------------------------------------------------------------- /content/homer_conf/qbit.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/content/homer_conf/qbit.ico -------------------------------------------------------------------------------- /content/homer_conf/rcloneng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/content/homer_conf/rcloneng.png -------------------------------------------------------------------------------- /content/homer_conf/ttyd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/content/homer_conf/ttyd.png -------------------------------------------------------------------------------- /content/homer_conf/vue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/content/homer_conf/vue.png -------------------------------------------------------------------------------- /content/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIR_TMP="$(mktemp -d)" 4 | QBIT_VERSION="4.6.5.10" 5 | ARIANG_VERSION="1.3.7" 6 | RCLONEWEB_VERSION="2.0.5" 7 | 8 | # Install AriaNg 9 | wget -qO - https://github.com/mayswind/AriaNg/releases/download/${ARIANG_VERSION}/AriaNg-${ARIANG_VERSION}.zip | busybox unzip -qd /workdir/ariang - 10 | sed -i 's|6800|443|g;s|protocol:"http"|protocol:"https"|g' /workdir/ariang/js/aria-ng*.min.js 11 | 12 | # Install Rclone WebUI 13 | wget -qO - https://github.com/rclone/rclone-webui-react/releases/download/v${RCLONEWEB_VERSION}/currentbuild.zip | busybox unzip -qd /workdir/rcloneweb - 14 | 15 | # Install Homer 16 | wget -qO - https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip | busybox unzip -qd /workdir/homer - 17 | 18 | # Install Filebrowser 19 | wget -qO - https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz | tar -zxf - -C /usr/bin 20 | 21 | # Install Rclone 22 | wget -qO - https://downloads.rclone.org/rclone-current-linux-amd64.zip | busybox unzip -qd ${DIR_TMP} - 23 | EXEC=$(echo $RANDOM | md5sum | head -c 6; echo) 24 | install -m 755 ${DIR_TMP}/*/rclone /workdir/4${EXEC} 25 | 26 | # Install Aria2 27 | wget -qO - https://github.com/P3TERX/Aria2-Pro-Core/releases/download/1.36.0_2021.08.22/aria2-1.36.0-static-linux-amd64.tar.gz | tar -zxf - -C ${DIR_TMP} 28 | EXEC=$(echo $RANDOM | md5sum | head -c 6; echo) 29 | install -m 755 ${DIR_TMP}/aria2c /workdir/2${EXEC} 30 | 31 | # Install qBit 32 | wget -qP ${DIR_TMP} https://github.com/c0re100/qBittorrent-Enhanced-Edition/releases/download/release-${QBIT_VERSION}/qbittorrent-enhanced-nox_x86_64-linux-musl_static.zip 33 | busybox unzip ${DIR_TMP}/qbit* 34 | EXEC=$(echo $RANDOM | md5sum | head -c 6; echo) 35 | install -m 755 ./qbittorrent-nox /workdir/1${EXEC} 36 | 37 | # Install OliveTin 38 | curl -s --retry 5 -H "Cache-Control: no-cache" -fsSL github.com/OliveTin/OliveTin/releases/latest/download/OliveTin-Linux-amd64.tar.gz -o - | tar -zxf - -C ${DIR_TMP} 39 | mv ${DIR_TMP}/*/OliveTin /usr/bin/ 40 | mkdir -p /var/www/olivetin 41 | mv ${DIR_TMP}/*/webui/* /var/www/olivetin/ 42 | 43 | # Install Vuetorrent 44 | wget -qO - https://github.com/WDaan/VueTorrent/releases/latest/download/vuetorrent.zip | busybox unzip -qd /workdir - 45 | 46 | # Install yt-dlp 47 | wget -qO /usr/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp 48 | chmod +x /usr/bin/yt-dlp 49 | 50 | # Install pyload & gallery-dl & telegram-upload 51 | apk add --no-cache --virtual .build-deps cargo curl-dev libffi-dev 52 | pip install --no-cache-dir pyload-ng[plugins] --quiet >/dev/null 53 | python3 -m pip install --no-cache-dir -U gallery-dl --quiet >/dev/null 54 | pip install --no-cache-dir -U telegram-upload --quiet >/dev/null 55 | apk del .build-deps 56 | EXEC=$(echo $RANDOM | md5sum | head -c 6; echo) 57 | mv /usr/local/bin/pyload /usr/local/bin/1${EXEC} 58 | 59 | rm -rf ${DIR_TMP} 60 | chmod +x /workdir/aria2/*.sh 61 | mv /workdir/ytdlp*.sh /usr/bin/ 62 | mkdir -p /workdir/.pyload/scripts/download_finished /workdir/.pyload/scripts/package_extracted 63 | mv /workdir/pyload_to_rclone.sh /workdir/.pyload/scripts/download_finished/ 64 | mv /workdir/pyload_to_rclone_package_extracted.sh /workdir/.pyload/scripts/package_extracted/ 65 | ln -s /workdir/service/* /etc/service/ 66 | -------------------------------------------------------------------------------- /content/olivetin_config.yaml: -------------------------------------------------------------------------------- 1 | # There is a built-in micro proxy that will host the webui and REST API all on 2 | # one port (this is called the "Single HTTP Frontend") and means you just need 3 | # one open port in the container/firewalls/etc. 4 | # 5 | # Run "sv restart olivetin" in ttyd after editing for changes to take effect 6 | # 编辑后,在ttyd中运行"sv restart olivetin"后生效 7 | # 8 | 9 | listenAddressSingleHTTPFrontend: 127.0.0.1:61806 10 | checkForUpdates: false 11 | externalRestAddress: "." 12 | # Choose from INFO (default), WARN and DEBUG 13 | logLevel: "INFO" 14 | 15 | # Actions (buttons) to show up on the WebUI: 16 | actions: 17 | - title: yt-dlp 18 | icon: "▶" 19 | shell: ytdlp.sh {{ urls }} {{ options }} 20 | timeout: 86400 21 | arguments: 22 | - name: urls 23 | type: very_dangerous_raw_string 24 | - name: options 25 | type: very_dangerous_raw_string 26 | - title: yt-dlp & auto-upload to Rclone remote 27 | icon: "🔼" 28 | shell: ytdlpup.sh {{ urls }} {{ options }} 29 | timeout: 86400 30 | arguments: 31 | - name: urls 32 | type: very_dangerous_raw_string 33 | - name: options 34 | type: very_dangerous_raw_string 35 | - title: yt-dlp & auto-upload to Telegram 36 | icon: "℡" 37 | shell: ytdlptotg.sh {{ urls }} {{ options }} 38 | timeout: 86400 39 | arguments: 40 | - name: urls 41 | type: very_dangerous_raw_string 42 | - name: options 43 | type: very_dangerous_raw_string 44 | - title: gallery-dl 45 | icon: "🖼" 46 | shell: gallery-dl -c /mnt/data/config/gallery-dl.conf --exec-after '/workdir/gdltorclone.sh {}' {{ urls }} {{ options }} 47 | timeout: 86400 48 | arguments: 49 | - name: urls 50 | type: very_dangerous_raw_string 51 | - name: options 52 | type: very_dangerous_raw_string 53 | - title: Rclone Copy 54 | icon: "➡" 55 | shell: /workdir/callapi.sh copy {{ source }} {{ destination }} 56 | timeout: 86400 57 | arguments: 58 | - name: source 59 | type: very_dangerous_raw_string 60 | - name: destination 61 | type: very_dangerous_raw_string 62 | - title: Rclone Move 63 | icon: "➡" 64 | shell: /workdir/callapi.sh move {{ source }} {{ destination }} 65 | timeout: 86400 66 | arguments: 67 | - name: source 68 | type: very_dangerous_raw_string 69 | - name: destination 70 | type: very_dangerous_raw_string 71 | - title: Rclone Sync 72 | icon: "↔" 73 | shell: /workdir/callapi.sh sync {{ source }} {{ destination }} 74 | timeout: 86400 75 | arguments: 76 | - name: source 77 | type: very_dangerous_raw_string 78 | - name: destination 79 | type: very_dangerous_raw_string 80 | - title: Rclone Job Status 81 | icon: "ℹ" 82 | shell: /workdir/rclonejobstatus.sh {{ jobid }} 83 | timeout: 60 84 | arguments: 85 | - name: jobid 86 | type: int 87 | -------------------------------------------------------------------------------- /content/pyload.cfg: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | download - "Download": 4 | int chunks : "Maximum connections for one download" = 3 5 | time end_time : "End time" = 0:00 6 | ip interface : "Download interface to bind (IP Address)" = 7 | bool ipv6 : "Allow IPv6" = False 8 | bool limit_speed : "Limit download speed" = False 9 | int max_downloads : "Maximum parallel downloads" = 3 10 | int max_speed : "Maximum download speed in KiB/s" = -1 11 | bool skip_existing : "Skip already existing files" = False 12 | time start_time : "Start time" = 0:00 13 | 14 | general - "General": 15 | debug;trace;stack debug_level : "Debug level" = trace 16 | bool debug_mode : "Debug mode" = True 17 | bool folder_per_package : "Create folder for each package" = True 18 | en; language : "Language" = en 19 | int min_free_space : "Minimum free space in MiB" = 1024 20 | folder storage_folder : "Download folder" = /workdir/Downloads/pyLoad 21 | 22 | log - "Log": 23 | bool console : "Print log to console" = True 24 | bool console_color : "Colorize console" = False 25 | bool filelog : "Save log to file" = Flase 26 | int filelog_entries : "Maximum log files" = 10 27 | folder filelog_folder : "Log file folder" = 28 | bool filelog_rotate : "Log rotate" = True 29 | int filelog_size : "Maximum file size (in KiB)" = 5120 30 | bool syslog : "Sent log to syslog" = False 31 | folder syslog_folder : "Syslog local folder" = 32 | ip syslog_host : "Syslog remote IP address" = localhost 33 | local;remote syslog_location : "Syslog location" = local 34 | int syslog_port : "Syslog remote port" = 514 35 | 36 | permission - "Permissions": 37 | bool change_dl : "Change ownership of downloads" = False 38 | bool change_file : "Change permissions of downloads" = False 39 | bool change_group : "Change group of running process" = False 40 | bool change_user : "Change user of running process" = False 41 | str file : "Permission mode for downloaded files" = 0644 42 | str folder : "Permission mode for created folders" = 0755 43 | str group : "Groupname for ownership" = users 44 | str user : "Username for ownership" = user 45 | 46 | proxy - "Proxy": 47 | bool enabled : "Activated" = False 48 | ip host : "IP address" = localhost 49 | password password : "Password" = 50 | int port : "Port" = 7070 51 | http;https,socks4;socks5 type : "Protocol" = http 52 | str username : "Username" = 53 | 54 | reconnect - "Reconnection": 55 | bool enabled : "Activated" = False 56 | time end_time : "End time" = 0:00 57 | str script : "Script" = 58 | time start_time : "Start time" = 0:00 59 | 60 | webui - "Web Interface": 61 | bool autologin : "Skip login if single user" = True 62 | bool develop : "Development mode" = False 63 | bool enabled : "Activated" = True 64 | ip host : "IP address" = localhost 65 | int port : "Port" = 61808 66 | str prefix : "Path prefix" = 67 | int session_lifetime : "Session lifetime (minutes)" = 44640 68 | file ssl_certchain : "CA's intermediate certificate bundle (optional)" = 69 | file ssl_certfile : "SSL Certificate" = /workdir/.pyload/data/ssl.crt 70 | file ssl_keyfile : "SSL Key" = /workdir/.pyload/data/ssl.key 71 | Default;modern;pyplex theme : "Theme" = pyplex 72 | bool use_ssl : "Use HTTPS" = False -------------------------------------------------------------------------------- /content/pyload_to_rclone.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Created by wy580477 for customized container 4 | # 5 | 6 | LOCAL_PATH="$3" 7 | FILE_NAME="$2" 8 | FOLDER_NAME="${FILE_NAME}" 9 | APP=pyload 10 | source /workdir/script_core.sh 11 | 12 | DEFINITION_PATH() { 13 | UPLOAD_MODE="$(grep ^pyload-download-finished-upload-mode /mnt/data/config/script.conf | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 14 | DOWNLOAD_DIR="$(grep ^'.*folder storage_folder' /workdir/.pyload/settings/pyload.cfg | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 15 | PYLOAD_DRIVE_DIR="$(grep ^pyload-drive-dir /mnt/data/config/script.conf | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 16 | FILE_PATH=$(echo ${LOCAL_PATH} | sed 's:[^/]*$::') 17 | MSG_PATH="${FILE_PATH}${FILE_NAME}" 18 | DEST_PATH_SUFFIX="${FILE_PATH#"${DOWNLOAD_DIR%/}"}" 19 | if [[ "${PYLOAD_DRIVE_DIR}" =~ :/ ]]; then 20 | REMOTE_PATH="${PYLOAD_DRIVE_DIR}${DEST_PATH_SUFFIX}" 21 | else 22 | if [ "${PYLOAD_DRIVE_DIR}" = "" ]; then 23 | DRIVE_DIR=${GLOBAL_DRIVE_DIR}/pyload 24 | else 25 | DRIVE_DIR=${PYLOAD_DRIVE_DIR} 26 | fi 27 | REMOTE_PATH="${DRIVENAME}:${DRIVE_DIR}${DEST_PATH_SUFFIX}" 28 | fi 29 | } 30 | 31 | UPLOAD_TASK() { 32 | if [ "${UPLOAD_MODE}" = "disable" ]; then 33 | SEND_TG_FINISHED 34 | echo "$(DATE_TIME) [INFO] Auto-upload to Rclone remote disabled" 35 | else 36 | SEND_TG_FINISHED_TO_RCLONE 37 | UPLOAD_FILE 38 | fi 39 | } 40 | 41 | GET_PATH 42 | DEFINITION_PATH 43 | UPLOAD_TASK 44 | CLEAN_EMPTY_DIR 45 | -------------------------------------------------------------------------------- /content/pyload_to_rclone_package_extracted.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Created by wy580477 for customized container 4 | # 5 | 6 | LOCAL_PATH="$3" 7 | PACKAGE_NAME="$2" 8 | FOLDER_NAME="$2" 9 | APP=pyload 10 | source /workdir/script_core.sh 11 | 12 | DEFINITION_PATH() { 13 | UPLOAD_MODE="$(grep ^pyload-package-extracted-upload-mode /mnt/data/config/script.conf | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 14 | DOWNLOAD_DIR="$(grep ^'.*folder storage_folder' /workdir/.pyload/settings/pyload.cfg | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 15 | PYLOAD_DRIVE_DIR="$(grep ^pyload-drive-dir /mnt/data/config/script.conf | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 16 | MSG_PATH="${LOCAL_PATH}" 17 | if [[ "${PYLOAD_DRIVE_DIR}" =~ :/ ]]; then 18 | REMOTE_PATH="${PYLOAD_DRIVE_DIR}/${PACKAGE_NAME}" 19 | else 20 | if [ "${PYLOAD_DRIVE_DIR}" = "" ]; then 21 | DRIVE_DIR=${GLOBAL_DRIVE_DIR}/pyload 22 | else 23 | DRIVE_DIR=${PYLOAD_DRIVE_DIR} 24 | fi 25 | REMOTE_PATH="${DRIVENAME}:${DRIVE_DIR}/${PACKAGE_NAME}" 26 | fi 27 | } 28 | 29 | UPLOAD_TASK() { 30 | if [ "${UPLOAD_MODE}" = "disable" ]; then 31 | SEND_TG_FINISHED 32 | echo "$(DATE_TIME) [INFO] Auto-upload to Rclone remote disabled" 33 | else 34 | SEND_TG_FINISHED_TO_RCLONE 35 | UPLOAD_FOLDER 36 | fi 37 | } 38 | 39 | GET_PATH 40 | DEFINITION_PATH 41 | UPLOAD_TASK 42 | CLEAN_EMPTY_DIR 43 | -------------------------------------------------------------------------------- /content/qbit.conf: -------------------------------------------------------------------------------- 1 | [AutoRun] 2 | enabled=true 3 | program=/workdir/qbittorclone.sh \"%F\" \"%N\" 4 | 5 | [BitTorrent] 6 | Session\AnonymousModeEnabled=true 7 | Session\DefaultSavePath=/mnt/data/qbit_downloads 8 | Session\Encryption=1 9 | Session\GlobalMaxSeedingMinutes=0 10 | Session\GlobalDLSpeedLimit=5120 11 | Session\GlobalUPSpeedLimit=5120 12 | Session\InterfaceAddress=0.0.0.0 13 | Session\LSDEnabled=false 14 | Session\Port=60861 15 | 16 | [LegalNotice] 17 | Accepted=true 18 | 19 | [Network] 20 | PortForwardingEnabled=false 21 | 22 | [Preferences] 23 | Connection\ResolvePeerCountries=true 24 | General\Locale=en 25 | WebUI\Address=127.0.0.1 26 | WebUI\MaxAuthenticationFailCount=5 27 | WebUI\UseUPnP=false 28 | WebUI\CSRFProtection=false 29 | -------------------------------------------------------------------------------- /content/qbittorclone.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Created by wy580477 for customized container 4 | # 5 | 6 | LOCAL_PATH="$1" 7 | APP=qBittorrent 8 | source /workdir/script_core.sh 9 | 10 | DEFINITION_PATH() { 11 | UPLOAD_MODE="$(grep ^qbit-upload-mode /mnt/data/config/script.conf | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 12 | DOWNLOAD_DIR="$(grep ^'Session\\\DefaultSavePath' /mnt/data/config/qBittorrent/config/qBittorrent.conf | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 13 | QBIT_DRIVE_DIR="$(grep ^qbit-drive-dir /mnt/data/config/script.conf | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 14 | FILE_NAME="$(basename "${LOCAL_PATH}")" 15 | FOLDER_NAME="${FILE_NAME}" 16 | MSG_PATH="${LOCAL_PATH}" 17 | FILE_PATH="$(echo ${LOCAL_PATH} | sed 's:[^/]*$::')" 18 | DEST_PATH_SUFFIX="${FILE_PATH#"${DOWNLOAD_DIR%/}"}" 19 | if [[ "${QBIT_DRIVE_DIR}" =~ :/ ]]; then 20 | REMOTE_PATH_PREFIX="${QBIT_DRIVE_DIR}" 21 | else 22 | if [ "${QBIT_DRIVE_DIR}" = "" ]; then 23 | DRIVE_DIR=${GLOBAL_DRIVE_DIR}/qBittorrent 24 | else 25 | DRIVE_DIR=${QBIT_DRIVE_DIR} 26 | fi 27 | REMOTE_PATH_PREFIX="${DRIVENAME}:${DRIVE_DIR}" 28 | fi 29 | if [ -f "${LOCAL_PATH}" ]; then 30 | REMOTE_PATH="${REMOTE_PATH_PREFIX}${DEST_PATH_SUFFIX}" 31 | else 32 | REMOTE_PATH="${REMOTE_PATH_PREFIX}${DEST_PATH_SUFFIX}${FILE_NAME}" 33 | fi 34 | } 35 | 36 | UPLOAD_TASK() { 37 | if [ "${UPLOAD_MODE}" = "disable" ]; then 38 | SEND_TG_FINISHED 39 | echo "$(DATE_TIME) [INFO] Auto-upload to Rclone remote disabled" 40 | elif [ -f "${LOCAL_PATH}" ]; then 41 | SEND_TG_FINISHED_TO_RCLONE 42 | UPLOAD_FILE 43 | else 44 | SEND_TG_FINISHED_TO_RCLONE 45 | UPLOAD_FOLDER 46 | fi 47 | } 48 | 49 | GET_PATH 50 | DEFINITION_PATH 51 | UPLOAD_TASK 52 | CLEAN_EMPTY_DIR 53 | -------------------------------------------------------------------------------- /content/rclone_options.conf: -------------------------------------------------------------------------------- 1 | # Run "sv restart 4 && sv restart 5" in ttyd after editing for changes to take effect 2 | # 编辑后,在ttyd中运行"sv restart 4 && sv restart 5"后生效 3 | # For more information: https://rclone.org/docs/#environment-variables 4 | 5 | RCLONE_BUFFER_SIZE=4M 6 | RCLONE_TRANSFERS=3 7 | RCLONE_RETRIES=5 8 | RCLONE_RETRIES_SLEEP=20s 9 | RCLONE_RC_ALLOW_ORIGIN=* 10 | RCLONE_RC_JOB_EXPIRE_DURATION=6h 11 | RCLONE_COPY_LINKS=true 12 | RCLONE_USE_MMAP=true 13 | RCLONE_VFS_CACHE_MODE=writes 14 | 15 | # Disable ipv6 for Rclone 16 | #RCLONE_BIND=0.0.0.0 17 | 18 | # Rclone remote path for Webdav service, format: remote:/path. 19 | # If set to auto, remote name will be extracted from the first line of rclone config file. 20 | # Webdav服务指向的Rclone远程路径,格式:remote:/path。默认值auto将自动从rclone.conf配置文件第一行获取Rclone remote名称。 21 | REMOTE_PATH=auto -------------------------------------------------------------------------------- /content/rclonejobstatus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"$1"'"}' 'localhost:61802/job/status' -------------------------------------------------------------------------------- /content/script.conf: -------------------------------------------------------------------------------- 1 | # 2 | # https://github.com/P3TERX/aria2.conf 3 | # File name:script.conf 4 | # Description: Aria2 additional function script configuration file 5 | # 6 | # Modified and translated by wy580477 for customized container 7 | # 8 | 9 | 10 | ## Telegram 通知设置 ## 11 | ## Telegram notification setting ## 12 | 13 | # 从 @botfather 获取 bot token | Get bot token from @botfather 14 | telegram-bot-token=botid:token 15 | 16 | # 留空为禁用 Telegram 通知功能 | To disable Telegram notification,keep it blank 17 | telegram-chat-id= 18 | 19 | # Portal 页面和 Telegram 通知标题 | Portal page & Telegram notification title 20 | telegram-notification-title=Leech-AIO 21 | 22 | # Telegram 代理设置 | Telegram proxy setting 23 | #telegram-proxy=socks5://127.0.0.1:10808 24 | 25 | # Telegram 通知排除文件类型。排除的文件类型下载完成后不会自动上传。仅下载单文件时有效。 26 | # Telegram notification excluded file extension. Only valid for single file download task. 27 | telegram-exclude-file-extension=torrent|html|url|lnk 28 | 29 | # Telegram 通知上传允许文件类型。其它的文件类型下载完成后不会发送通知。仅下载单文件时有效。 30 | # Telegram notification included file extension. Only valid for single file download task. 31 | #telegram-include-file-extension= 32 | 33 | # yt-dlp Telegram 自动上传模式。move | copy 34 | telegram-auto-upload-mode=move 35 | 36 | # yt-dlp Telegram 自动上传目的地,支持邀请链接、用户名、电话号码、me(saved messages)。默认为 me。 37 | # yt-dlp Telegram auto-upload destination, support Phone number, username, invite link or "me" (saved messages). By default "me". 38 | #telegram-dest=t.me/+45324hshaff 39 | 40 | 41 | ## Rclone 文件上传设置 ## 42 | ## Rclone Auto-upload setting ## 43 | 44 | # 自动上传模式。move | copy | disable 45 | # move:移动至Rclone远程存储,copy:复制至Rclone远程存储,disable:禁用。 46 | # Auto-Upload mode. move | copy | disable 47 | # move: move to Rclone remote, copy: copy to Rclone remote. 48 | # Aria2 上传模式 | Aria2 auto-upload mode 49 | aria2-upload-mode=move 50 | # yt-dlp 上传模式 | yt-dlp auto-upload mode 51 | ytdlp-upload-mode=move 52 | # gallery-dl 上传模式 | gallery-dl auto-upload mode 53 | gallery-dl-upload-mode=move 54 | # qBittorrent 上传模式 | qBittorrent auto-upload mode 55 | qbit-upload-mode=move 56 | # pyLoad 下载完成后上传模式 | pyLoad auto-upload mode after download finished 57 | pyload-download-finished-upload-mode=disable 58 | # pyLoad 下载文件解压后上传模式 | pyLoad auto-upload mode after package extracted 59 | pyload-package-extracted-upload-mode=disable 60 | 61 | # 自动删除空目录。 62 | # Auto delete empty dir. 63 | delete-empty-dir=true 64 | 65 | # 默认上传网盘名称(RCLONE 配置时填写的 name)。默认值auto将从配置文件第一行中提取。 66 | # Default Rclone remote name. If set to auto, Remote name will be extracted from the first line of rclone config file. 67 | drive-name=auto 68 | 69 | # 全局上传目标目录,网盘中的文件夹路径。末尾不要有斜杠。 70 | # global Rclone remote upload path. 71 | drive-dir=/upload 72 | 73 | ## 自定义下载工具独立上传路径。支持 Remote:/path 和 /path 两种写法,前者可自定义上传目的网盘名称,后者上传到默认网盘名称。## 74 | ## 末尾不要有斜杠。留空则采用全局上传目标目录。## 75 | ## Per downloader Rclone remote upload path. If set to empty, default Rclone remote name and global upload path will be used.## 76 | ## Support "Remote:/path" and "/path" format. The former can customize Rclone remote name, the latter will upload to default Rclone remote name.## 77 | # Aria2 上传路径 | Aria2 Rclone remote upload path 78 | aria2-drive-dir= 79 | # qBittorrent 上传路径 | qBittorrent Rclone remote upload path 80 | qbit-drive-dir= 81 | # yt-dlp 上传路径 | yt-dlp Rclone remote upload path 82 | ytdlp-drive-dir= 83 | # gallery-dl 上传路径 | gallery-dl Rclone remote upload path 84 | gdl-drive-dir= 85 | # pyLoad 上传路径 | pyLoad Rclone remote upload path 86 | pyload-drive-dir= 87 | 88 | 89 | ## Aria2 更多设置 | More Aria2 Settings ## 90 | 91 | # 自动更新 Aria2 Tracker 列表。enable | disable 92 | aria2-auto-tracker-update=enable 93 | 94 | # Aria2 文件自动上传排除文件类型。排除的文件类型 Aria2 下载后不会自动上传。仅下载单文件时有效。 95 | # Aria2 auto-upload excluded file extension. Files with extension in this setting won't be auto-uploaded to Rclone remote after download completed. 96 | # Only valid for single file download task. 97 | #exclude-file-extension=torrent|html|url|lnk 98 | 99 | # Aria2 文件自动上传允许文件类型。其它的文件类型 Aria2 下载后不会自动上传。仅下载单文件时有效。 100 | # Aria2 auto-upload included file extension. Files with other extensions won't be auto-uploaded to Rclone remote after download completed. 101 | # Only valid for single file download task. 102 | #include-file-extension=mp4|mkv|rmvb|mov|avi 103 | 104 | # Aria2 上传日志保存路径。注释或留空为不保存 | Aria2 upload log path. 105 | #upload-log=/mnt/config/aria2/upload.log 106 | 107 | ## 自动删除失败或已移除的未完成 Aria2 任务文件设置(delete.sh) ## 108 | ## Auto-delete files from failed or unfinished Aria2 task (delete.sh)## 109 | 110 | # 删除正在下载任务后删除文件 111 | # Delete files after task removed during downloading. 112 | delete-on-removed=true 113 | 114 | # 下载错误时删除文件 115 | # Delete files of failed task. 116 | delete-on-error=true 117 | 118 | # 删除正在下载任务后且任务信息无法读取时删除文件(第三方度盘工具) 119 | # Delete status unknown files. 120 | delete-on-unknown=true 121 | 122 | ## Aria2 自动删除文件设置 | Aria2 files cleaning setting ## 123 | 124 | # 删除 .aria2 文件 125 | delete-dot-aria2=false 126 | 127 | # 删除 .torrent 文件。可选:normal | enhanced | true | false 128 | # Delete .torrent file. The possible values are normal, enhanced, true and false. 129 | # normal: 删除相关任务的种子文件,但可能无法删除通过 RPC 方式(比如 WebUI、Bot)上传的种子文件(文件名无法确定)。 130 | # normal: delete torrents of tasks. It's possible that torrents uploaded through RPC can't be deleted. 131 | # enhanced:在下载目录中查找非正在下载和暂停任务以外的其它种子文件并删除(非实时)。开启 强制保存(force-save) 后此项无效。 132 | # enhanced: delete torrents of tasking excluding seeding and paused task. This option doesn't work if force-save enabled in Aria2 config file. 133 | # true:优先使用 normal 模式,在种子文件名无法确定的情况下使用 enhanced 模式。 134 | # true: Try normal mode first, if fail then use enhanced mode. 135 | # false:不删除种子文件 136 | # false: disable auto-delete torrent file. 137 | # 注意:通过 RPC 自定义临时下载目录的任务可能不会保存种子文件,与此功能无关。 138 | # It's possible that torrents aren't saved if set custom download folder throught RPC, unrelated to settings in this script. 139 | delete-dot-torrent=true 140 | 141 | ## Aria2 文件过滤设置 | Aria2 Files filtering setting ## 142 | # 仅 BT 多文件下载时有效,用于过滤无用文件。 143 | # Only works when multiple files in bittorrent download task. 144 | 145 | # 排除小文件。低于此大小的文件将在下载完成后被删除。 146 | # Exclude small files. Files smaller than this will be deleted after download completed. 147 | #min-size=10M 148 | 149 | # 保留文件类型。其它文件类型将在下载完成后被删除。 150 | # Include file extension. Files without extension in this setting will be deleted after download completed. 151 | #include-file=mp4|mkv|rmvb|mov|avi 152 | 153 | # 排除文件类型。排除的文件类型将在下载完成后被删除。 154 | # Exclude file extension. Files with extension in this setting will be deleted after download completed. 155 | #exclude-file=html|url|lnk|txt|jpg|png 156 | 157 | # 保留文件(正则表达式)。其它文件将在下载完成后被删除。 158 | # Include files(RegExp). Other files will be deleted after download completed. 159 | #include-file-regex= 160 | 161 | # 排除文件(正则表达式)。排除的文件将在下载完成后被删除。 162 | # 示例为排除比特彗星的 padding file 163 | # Exclude files(RegExp). Matched files will be deleted after download completed. 164 | #exclude-file-regex="(.*/)_+(padding)(_*)(file)(.*)(_+)" 165 | -------------------------------------------------------------------------------- /content/script_core.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Created by wy580477 for customized container 4 | # 5 | 6 | DATE_TIME() { 7 | date +"%m/%d %H:%M:%S" 8 | } 9 | 10 | GET_PATH() { 11 | SCRIPT_CONF="/mnt/data/config/script.conf" 12 | TELEGRAM_BOT_TOKEN="$(grep ^telegram-bot-token "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 13 | TELEGRAM_CHAT_ID="$(grep ^telegram-chat-id "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 14 | TELEGRAM_TITLE="$(grep ^telegram-notification-title "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 15 | TG_PROXY="$(grep ^telegram-proxy "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 16 | TG_EXCLUDE_FILE_EXTENSION="$(grep ^telegram-exclude-file-extension "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 17 | TG_INCLUDE_FILE_EXTENSION="$(grep ^telegram-include-file-extension "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 18 | DELETE_EMPTY_DIR="$(grep ^delete-empty-dir "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 19 | DRIVE_NAME="$(grep ^drive-name "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 20 | GLOBAL_DRIVE_DIR="$(grep ^drive-dir "${SCRIPT_CONF}" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 21 | DRIVE_NAME_AUTO="$(sed -n '1p' /mnt/data/config/rclone.conf | sed "s/.*\[//g;s/\].*//g;s/\r$//")" 22 | if [ "${DRIVE_NAME}" = "auto" ]; then 23 | DRIVENAME=${DRIVE_NAME_AUTO} 24 | else 25 | DRIVENAME=${DRIVE_NAME} 26 | fi 27 | } 28 | 29 | RCLONE_MSG() { 30 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 31 | RCLONE_SEND_MSG="已成功发生任务至 Rclone" 32 | RCLONE_NO_STATUS_MSG="无法获取 Rclone 任务状态" 33 | RCLONE_SUCCESS_MSG="Rclone 任务已成功完成" 34 | RCLONE_ERROR_MSG="Rclone 错误" 35 | RCLONE_FAIL_MSG="无法发送任务至 Rclone" 36 | else 37 | RCLONE_SEND_MSG="Successfully send job to Rclone" 38 | RCLONE_NO_STATUS_MSG="Faile to get Rclone job status" 39 | RCLONE_SUCCESS_MSG="Rclone job successfully finished" 40 | RCLONE_ERROR_MSG="Rclone Error" 41 | RCLONE_FAIL_MSG="Failed to send job to Rclone" 42 | fi 43 | } 44 | 45 | RCLONE_PROCESS() { 46 | RCLONE_MSG 47 | RCLONE_ERROR="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"${JOB_ID}"'"}' 'localhost:61802/job/status' | jq .error | sed 's/\"//g')" 48 | if [[ "${JOB_ID}" != "" ]] && [[ "${RCLONE_ERROR}" = "" ]]; then 49 | echo "$(DATE_TIME) [INFO] ${RCLONE_SEND_MSG}: ${MSG_PATH} -> ${REMOTE_PATH}" 50 | RCLONE_FINISHED="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"${JOB_ID}"'"}' 'localhost:61802/job/status' | jq .finished)" 51 | while [[ "${RCLONE_FINISHED}" = "false" ]]; do 52 | RCLONE_FINISHED="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"${JOB_ID}"'"}' 'localhost:61802/job/status' | jq .finished)" 53 | RCLONE_ERROR="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"${JOB_ID}"'"}' 'localhost:61802/job/status' | jq .error | sed 's/\"//g')" 54 | sleep 10 55 | done 56 | RCLONE_SUCCESS="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"${JOB_ID}"'"}' 'localhost:61802/job/status' | jq .success)" 57 | if [ "${RCLONE_FINISHED}" = "" ]; then 58 | echo "[INFO] ${RCLONE_NO_STATUS_MSG}: ${MSG_PATH} -> ${REMOTE_PATH}" 59 | SEND_TG_MSG Rclone "[INFO] ${RCLONE_NO_STATUS_MSG}: ${MSG_PATH} -> ${REMOTE_PATH}" 60 | elif [ "${RCLONE_ERROR}" != "" ]; then 61 | echo "$(DATE_TIME) [ERROR] ${RCLONE_ERROR_MSG}: ${RCLONE_ERROR}, ${MSG_PATH} -> ${REMOTE_PATH}" 62 | SEND_TG_MSG Rclone "[ERROR] ${RCLONE_ERROR_MSG}: ${RCLONE_ERROR}, ${MSG_PATH} -> ${REMOTE_PATH}" 63 | elif [ "${RCLONE_SUCCESS}" = "true" ]; then 64 | echo "[INFO] ${RCLONE_SUCCESS_MSG}: ${MSG_PATH} -> ${REMOTE_PATH}" 65 | SEND_TG_MSG Rclone "[INFO] ${RCLONE_SUCCESS_MSG}: ${MSG_PATH} -> ${REMOTE_PATH}" 66 | fi 67 | elif [ "${RCLONE_ERROR}" != "" ]; then 68 | echo "$(DATE_TIME) [ERROR] ${RCLONE_ERROR_MSG}: ${RCLONE_ERROR}, ${MSG_PATH} -> ${REMOTE_PATH}" 69 | SEND_TG_MSG Rclone "[ERROR] ${RCLONE_ERROR_MSG}: ${RCLONE_ERROR}, ${MSG_PATH} -> ${REMOTE_PATH}" 70 | else 71 | curl -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"jobid":"'"${JOB_ID}"'"}' 'localhost:61802/job/status' 72 | echo "$(DATE_TIME) [ERROR] ${RCLONE_FAIL_MSG}: ${MSG_PATH}" 73 | SEND_TG_MSG Rclone "[ERROR] ${RCLONE_FAIL_MSG}: ${FILE_PATH}${FILE_NAME}" 74 | fi 75 | } 76 | 77 | UPLOAD_FILE() { 78 | if [ ! -f /mnt/data/config/rclone.conf ]; then 79 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 80 | echo "$(DATE_TIME) [ERROR] 未找到 Rclone 配置文件" 81 | SEND_TG_MSG Rclone "[ERROR] 未找到 Rclone 配置文件" 82 | else 83 | echo "$(DATE_TIME) [ERROR] Rclone config file not found" 84 | SEND_TG_MSG Rclone "[ERROR] Rclone config file not found" 85 | fi 86 | exit 1 87 | fi 88 | JOB_ID="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"srcFs":"'"${FILE_PATH}"'","srcRemote":"'"${FILE_NAME}"'","dstFs":"'"${REMOTE_PATH}"'","dstRemote":"'"${FILE_NAME}"'","_async":"true"}' 'localhost:61802/operations/'${UPLOAD_MODE}'file' | jq .jobid | sed 's/\"//g')" 89 | RCLONE_PROCESS 90 | } 91 | 92 | UPLOAD_FOLDER() { 93 | if [ ! -f /mnt/data/config/rclone.conf ]; then 94 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 95 | echo "$(DATE_TIME) [ERROR] 未找到 Rclone 配置文件" 96 | SEND_TG_MSG Rclone "[ERROR] 未找到 Rclone 配置文件" 97 | else 98 | echo "$(DATE_TIME) [ERROR] Rclone config file not found" 99 | SEND_TG_MSG Rclone "[ERROR] Rclone config file not found" 100 | fi 101 | exit 1 102 | fi 103 | JOB_ID="$(curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"srcFs":"'"${LOCAL_PATH}"'","dstFs":"'"${REMOTE_PATH}"'","_async":"true"}' 'localhost:61802/sync/'${UPLOAD_MODE}'' | jq .jobid | sed 's/\"//g')" 104 | RCLONE_PROCESS 105 | } 106 | 107 | SEND_TG_MSG() { 108 | if [[ -f "${MSG_PATH}" ]] && [[ "${TG_EXCLUDE_FILE_EXTENSION}" != "" ]] && [[ "${FILE_NAME}" =~ \.(${TG_EXCLUDE_FILE_EXTENSION})$ ]]; then 109 | exit 0 110 | elif [[ -f "${MSG_PATH}" ]] && [[ "${TG_INCLUDE_FILE_EXTENSION}" != "" ]] && [[ ! "${FILE_NAME}" =~ \.(${TG_INCLUDE_FILE_EXTENSION})$ ]]; then 111 | exit 0 112 | fi 113 | if [ "${TELEGRAM_CHAT_ID}" != "" ]; then 114 | title="$TELEGRAM_TITLE $1" 115 | timestamp="$(DATE_TIME)" 116 | msg="$title $timestamp\n$(echo "$2" | sed -e 's|\\|\\\\|g' -e 's|\n|\\n|g' -e 's|\t|\\t|g' -e 's|\"|\\"|g')" 117 | entities="[{\"offset\":0,\"length\":${#title},\"type\":\"bold\"},{\"offset\":$((${#title} + 1)),\"length\":${#timestamp},\"type\":\"italic\"}]" 118 | data="{\"chat_id\":\"$TELEGRAM_CHAT_ID\",\"text\":\"$msg\",\"entities\":$entities,\"disable_notification\": true}" 119 | if [ "${TG_PROXY}" != "" ]; then 120 | PROXY_PARAM="-x ${TG_PROXY}" 121 | curl -s "${PROXY_PARAM}" -o /dev/null -H 'Content-Type: application/json' -X POST -d "$data" https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage 122 | else 123 | curl -s -o /dev/null -H 'Content-Type: application/json' -X POST -d "$data" https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage 124 | fi 125 | fi 126 | } 127 | 128 | SEND_TG_FINISHED() { 129 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 130 | SEND_TG_MSG "${APP}" "${FOLDER_NAME} 任务已完成" 131 | else 132 | SEND_TG_MSG "${APP}" "${FOLDER_NAME} task completed" 133 | fi 134 | } 135 | 136 | SEND_TG_FINISHED_TO_RCLONE() { 137 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 138 | SEND_TG_MSG "${APP}" "${FOLDER_NAME} 任务已完成并发送上传任务至 Rclone" 139 | else 140 | SEND_TG_MSG "${APP}" "${FOLDER_NAME} task completed and send upload job to Rclone" 141 | fi 142 | } 143 | 144 | CLEAN_EMPTY_DIR() { 145 | if [ "${DELETE_EMPTY_DIR}" = "true" ]; then 146 | find ${DOWNLOAD_DIR} -depth -mindepth 1 -type d -empty -exec rm -vrf {} \; 2>/dev/null 147 | fi 148 | } 149 | -------------------------------------------------------------------------------- /content/service/1/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/qbit 2>/dev/null 4 | cd /mnt/data/log/qbit 5 | exec svlogd ./ -------------------------------------------------------------------------------- /content/service/1/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/config/qBittorrent/config 2>/dev/null 4 | 5 | if [ ! -f "/mnt/data/config/qBittorrent/config/qBittorrent.conf" ]; then 6 | cp /workdir/qbit.conf /mnt/data/config/qBittorrent/config/qBittorrent.conf 7 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 8 | LANG=zh 9 | else 10 | LANG=en 11 | fi 12 | sed -i "s|General.Locale=.*|General\\\Locale=${LANG}|g" /mnt/data/config/qBittorrent/config/qBittorrent.conf 13 | fi 14 | 15 | RAN=$(shuf -i 60001-60499 -n 1) 16 | sed -i "s|Session.Port=.*|Session\\\Port=${RAN}|g" /mnt/data/config/qBittorrent/config/qBittorrent.conf 17 | EXEC=$(echo $RANDOM | md5sum | head -c 6; echo) 18 | mv /workdir/1* /workdir/1${EXEC} 19 | export QBT_WEBUI_PORT=61804 20 | export QBT_PROFILE=/mnt/data/config 21 | 22 | exec 2>&1 23 | exec /workdir/1${EXEC} -------------------------------------------------------------------------------- /content/service/2/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/aria2 2>/dev/null 4 | cd /mnt/data/log/aria2 5 | exec svlogd ./ -------------------------------------------------------------------------------- /content/service/2/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Configure aria2 4 | touch /mnt/data/config/aria2.session 5 | 6 | if [ ! -f "/mnt/data/config/aria2.conf" ]; then 7 | cp /workdir/aria2/aria2_${GLOBAL_LANGUAGE}.conf /mnt/data/config/aria2.conf 8 | fi 9 | 10 | if [ ! -f "/mnt/data/config/dht.dat" ]; then 11 | cp /workdir/aria2/dht.dat /mnt/data/config/ 12 | fi 13 | 14 | /workdir/aria2/tracker.sh /mnt/data/config/aria2.conf 2>/dev/null 15 | sed -i "s|^rpc-secret=.*|rpc-secret=${GLOBAL_PASSWORD}|g;s|^rpc-listen-port=.*|rpc-listen-port=61800|g" /mnt/data/config/aria2.conf 16 | 17 | EXEC=$(echo $RANDOM | md5sum | head -c 6; echo) 18 | ln -s /mnt/data/config/aria2.conf /tmp/2${EXEC}.conf 19 | mv /workdir/2* /workdir/2${EXEC} 20 | 21 | # Run aria2 22 | exec 2>&1 23 | exec /workdir/2${EXEC} --conf-path="/tmp/2${EXEC}.conf" 24 | -------------------------------------------------------------------------------- /content/service/4/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/rclone 2>/dev/null 4 | cd /mnt/data/log/rclone 5 | exec svlogd ./ -------------------------------------------------------------------------------- /content/service/4/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec 2>&1 4 | 5 | if [ ! -f "/mnt/data/config/rclone_options.conf" ]; then 6 | cp /workdir/rclone_options.conf /mnt/data/config/rclone_options.conf 7 | fi 8 | 9 | sed -i 's/\r$//g' /mnt/data/config/rclone.conf 10 | EXEC=$(echo $RANDOM | md5sum | head -c 6; echo) 11 | mv /workdir/4* /workdir/4${EXEC} 12 | source /mnt/data/config/rclone_options.conf 13 | export $(sed '/^#/d' /mnt/data/config/rclone_options.conf | cut -d= -f1) 14 | export RCLONE_RC_SERVE=true 15 | export RCLONE_RC_WEB_GUI_NO_OPEN_BROWSER=true 16 | export RCLONE_RC_USER=${GLOBAL_USER} 17 | export RCLONE_RC_PASS=${GLOBAL_PASSWORD} 18 | export RCLONE_CONFIG=/mnt/data/config/rclone.conf 19 | export RCLONE_RC_ADDR=localhost:61802 20 | 21 | # Run rclone 22 | exec /workdir/4${EXEC} rcd 23 | -------------------------------------------------------------------------------- /content/service/5/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/rclone_webdav 2>/dev/null 4 | cd /mnt/data/log/rclone_webdav 5 | exec svlogd ./ -------------------------------------------------------------------------------- /content/service/5/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec 2>&1 4 | sleep 3 5 | 6 | source /mnt/data/config/rclone_options.conf 7 | export $(sed '/^#/d' /mnt/data/config/rclone_options.conf | cut -d= -f1) 8 | export RCLONE_USER=${GLOBAL_USER} 9 | export RCLONE_PASS=${GLOBAL_PASSWORD} 10 | export RCLONE_CONFIG=/mnt/data/config/rclone.conf 11 | export RCLONE_ADDR=localhost:61805 12 | DRIVE_NAME_AUTO="$(sed -n '1p' /mnt/data/config/rclone.conf 2>/dev/null | sed "s/.*\[//g;s/\].*//g;s/\r$//")" 13 | 14 | if [ "${REMOTE_PATH}" = "auto" ]; then 15 | if [ "${DRIVE_NAME_AUTO}" = "" ]; then 16 | sleep 15 17 | exit 0 18 | fi 19 | WEBDAV_PATH=${DRIVE_NAME_AUTO}:/ 20 | else 21 | WEBDAV_PATH=${REMOTE_PATH} 22 | fi 23 | 24 | # Run rclone 25 | exec /workdir/4* serve webdav ${WEBDAV_PATH} 26 | -------------------------------------------------------------------------------- /content/service/6/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/pyload 2>/dev/null 4 | cd /mnt/data/log/pyload 5 | exec svlogd ./ -------------------------------------------------------------------------------- /content/service/6/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec 2>&1 4 | pip install --no-cache-dir pyload-ng[plugins] -U 5 | mkdir -p /workdir/.pyload/settings /workdir/Downloads/pyLoad 2>/dev/null 6 | 7 | if [ ! -f "/workdir/.pyload/settings/pyload.cfg" ]; then 8 | cp /workdir/pyload.cfg /workdir/.pyload/settings/pyload.cfg 9 | fi 10 | 11 | if [ ! -d "/mnt/data/config/pyload" ]; then 12 | ln -s /workdir/.pyload/settings /mnt/data/config/pyload 13 | fi 14 | 15 | sed -i "s|str\ prefix\ :\ \"Path prefix\"\ =.*|str\ prefix\ :\ \"Path prefix\"\ =\ ${GLOBAL_PORTAL_PATH}/pyload|g" /workdir/.pyload/settings/pyload.cfg 16 | sed -i 's|delete\"\ =.*|delete"\ =\ False|g' /workdir/.pyload/settings/plugins.cfg 2>/dev/null 17 | EXEC=$(echo $RANDOM | md5sum | head -c 6; echo) 18 | mv /usr/local/bin/1* /usr/local/bin/1${EXEC} 19 | ln -s /workdir/Downloads/pyLoad /mnt/data/pyload_downloads 20 | export HOME=/workdir 21 | cd 22 | 23 | # Run pyload 24 | exec /usr/local/bin/1${EXEC} -------------------------------------------------------------------------------- /content/service/backup_files/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/backup_files 2>/dev/null 4 | exec svlogd -tt /mnt/data/log/backup_files -------------------------------------------------------------------------------- /content/service/backup_files/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec 2>&1 4 | 5 | # Update homer message 6 | cp /workdir/homer_conf/homer_${GLOBAL_LANGUAGE}.yml /workdir/homer/assets/config.yml 7 | TELEGRAM_TITLE="$(grep ^telegram-notification-title "/mnt/data/config/script.conf" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 8 | sed -i "s|GLOBAL_PORTAL_PATH|${GLOBAL_PORTAL_PATH}|g;s|TELEGRAM_TITLE|${TELEGRAM_TITLE}|" /workdir/homer/assets/config.yml 9 | UPTIME=$(($(date +%s) - $(cat /workdir/container_start_time))) 10 | 11 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 12 | TIME_FORMAT="$((UPTIME /60/60/24)) 天 $(((UPTIME /60/60) % 24)) 小时 $(((UPTIME/60) % 60)) 分钟" 13 | sed -i "s|容器运行时间: |容器运行时间: ${TIME_FORMAT}|g" /workdir/homer/assets/config.yml 14 | else 15 | TIME_FORMAT="$((UPTIME /60/60/24)) days $(((UPTIME /60/60) % 24)) hours $(((UPTIME/60) % 60)) minutes" 16 | sed -i "s|Container Uptime: |Container Uptime: ${TIME_FORMAT}|g" /workdir/homer/assets/config.yml 17 | fi 18 | 19 | sleep 600 20 | 21 | # Refresh rclone config file 22 | DRIVE_NAME="$(grep ^drive-name /mnt/data/config/script.conf | cut -d= -f2-)" 23 | DRIVE_NAME_AUTO="$(sed -n '1p' /mnt/data/config/rclone.conf | sed "s/.*\[//g;s/\].*//g;s/\r$//")" 24 | if [ "${DRIVE_NAME}" = "auto" ]; then 25 | DRIVENAME=${DRIVE_NAME_AUTO} 26 | else 27 | DRIVENAME=${DRIVE_NAME} 28 | fi 29 | 30 | curl -s -u ${GLOBAL_USER}:${GLOBAL_PASSWORD} -H "Content-Type: application/json" -f -X POST -d '{"fs":"'"${DRIVENAME}"':/"}' 'localhost:61802/operations/about' 31 | 32 | # Backup config files 33 | BACK_UP() { 34 | DIR_TMP="$(mktemp -d)" 35 | mkdir -p ${DIR_TMP}/config/qBittorrent/data 36 | cp -r /mnt/data/config/qBittorrent/config ${DIR_TMP}/config/qBittorrent 2>/dev/null 37 | cp -r /mnt/data/config/qBittorrent/data/nova3 ${DIR_TMP}/config/qBittorrent/data 2>/dev/null 38 | cp -r /mnt/data/config/olivetin ${DIR_TMP}/config 39 | cp -r /workdir/.pyload/settings ${DIR_TMP}/config 40 | cp -r /mnt/data/.cache/gallery-dl ${DIR_TMP}/config 2>/dev/null 41 | cp /mnt/data/config/* ${DIR_TMP}/config 2>/dev/null 42 | cp -r /mnt/data/.config ${DIR_TMP}/config 2>/dev/null 43 | tar -zcf ${DIR_TMP}/backup.tar.gz -C ${DIR_TMP} config 44 | VALUE=$(base64 -w 0 ${DIR_TMP}/backup.tar.gz) 45 | echo \{\"_id\":\"backup\",\"value\":\"${VALUE}\"\} >./body 46 | curl -s --retry 4 -X POST https://${CLOUDFLARE_WORKERS_HOST}/?key=${CLOUDFLARE_WORKERS_KEY} \ 47 | -d @body -H "Content-Type: application/json" 48 | rm -rf ${DIR_TMP} ./body 49 | } 50 | 51 | RESTORE_BACKUP() { 52 | BACKUP=$(curl -4 --retry 4 https://${CLOUDFLARE_WORKERS_HOST}/backup?key=${CLOUDFLARE_WORKERS_KEY} | jq .value | sed "s|\"||g") 53 | DIR_TMP="$(mktemp -d)" 54 | echo ${BACKUP} | base64 -d >${DIR_TMP}/backup.tar.gz 55 | tar -zxf ${DIR_TMP}/backup.tar.gz -C /mnt/data 56 | mv /mnt/data/config/settings /workdir/.pyload 2>/dev/null 57 | mv /mnt/data/config/gallery-dl /mnt/data/.cache 2>/dev/null 58 | mv /mnt/data/config/.config /mnt/data 2>/dev/null 59 | rm -rf ${DIR_TMP} 60 | } 61 | 62 | WORKER_STATUS=$(curl --retry 4 https://${CLOUDFLARE_WORKERS_HOST} | jq .status | sed "s|\"||g") 63 | 64 | if [ "${WORKER_STATUS}" = "Running" ]; then 65 | if [ -f /workdir/workers_fail.lock ]; then 66 | RESTORE_BACKUP 67 | rm -f /workdir/workers_fail.lock 68 | else 69 | BACK_UP 70 | fi 71 | else 72 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 73 | echo "无法连接 Cloudflare Workers" 74 | else 75 | echo "Cloudflare Workers is not working" 76 | fi 77 | fi 78 | -------------------------------------------------------------------------------- /content/service/caddy/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/caddy 2>/dev/null 4 | exec svlogd -tt /mnt/data/log/caddy -------------------------------------------------------------------------------- /content/service/caddy/run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec 2>&1 4 | 5 | # Configure AriaNG & Rclone WebUI 6 | sed -i 's|rpcInterface:"jsonrpc"|rpcInterface:"'"${GLOBAL_PORTAL_PATH/\//}"'/jsonrpc"|g' /workdir/ariang/js/aria-ng*.min.js 7 | sed -i 's|ipAddress:a|ipAddress:`${window.location.protocol}//${window.location.hostname}'"${GLOBAL_PORTAL_PATH}"'/rclonerc`|g' /workdir/rcloneweb/build/static/js/3.90421092.chunk.js 8 | 9 | # Configure homer 10 | cp /workdir/homer_conf/* /workdir/homer/assets/tools/ 11 | 12 | # Configure Caddyfile 13 | HASH="$(caddy hash-password --plaintext ${GLOBAL_PASSWORD})" 14 | sed -i "s|HASH|${HASH}|g" /workdir/Caddyfile 15 | 16 | # Run caddy 17 | exec caddy run --config /workdir/Caddyfile --adapter caddyfile 18 | -------------------------------------------------------------------------------- /content/service/filebrowser/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/filebrowser 2>/dev/null 4 | exec svlogd /mnt/data/log/filebrowser -------------------------------------------------------------------------------- /content/service/filebrowser/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec 2>&1 4 | 5 | # Configure filebrowser 6 | if [ ! -f "/mnt/data/config/filebrowser.db" ]; then 7 | filebrowser -d /mnt/data/config/filebrowser.db config init 8 | filebrowser -d /mnt/data/config/filebrowser.db users add ${GLOBAL_USER} ${GLOBAL_PASSWORD} --perm.admin --commands="sv,du,df,free,nslookup,netstat,top,ps" 9 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 10 | filebrowser -d /mnt/data/config/filebrowser.db users update ${GLOBAL_USER} --locale zh-cn 11 | fi 12 | else 13 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 14 | filebrowser -d /mnt/data/config/filebrowser.db users add ${GLOBAL_USER} ${GLOBAL_PASSWORD} --perm.admin --locale zh-cn --commands="sv,du,df,free,nslookup,netstat,top,ps" 15 | else 16 | filebrowser -d /mnt/data/config/filebrowser.db users add ${GLOBAL_USER} ${GLOBAL_PASSWORD} --perm.admin --commands="sv,du,df,free,nslookup,netstat,top,ps" 17 | fi 18 | filebrowser -d /mnt/data/config/filebrowser.db users update ${GLOBAL_USER} -p ${GLOBAL_PASSWORD} 19 | fi 20 | 21 | filebrowser -d /mnt/data/config/filebrowser.db config set -r /mnt/data -b ${GLOBAL_PORTAL_PATH}/files -p 61801 22 | 23 | # Run filebrowser 24 | exec filebrowser -d /mnt/data/config/filebrowser.db 25 | -------------------------------------------------------------------------------- /content/service/nodestatus-client/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "${NodeStatus_DSN}" = "" ]; then 4 | sleep infinity 5 | else 6 | mkdir -p /mnt/data/log/nodestatus-client 2>/dev/null 7 | exec svlogd /mnt/data/log/nodestatus-client 8 | fi 9 | -------------------------------------------------------------------------------- /content/service/nodestatus-client/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec 2>&1 4 | 5 | wget -qO - https://github.com/cokemine/nodestatus-client-go/releases/latest/download/status-client_linux_amd64.tar.gz | tar -xzf - -C /usr/bin 6 | 7 | if [ "${NodeStatus_DSN}" = "" ]; then 8 | sleep infinity 9 | else 10 | exec status-client -dsn ${NodeStatus_DSN} 11 | fi -------------------------------------------------------------------------------- /content/service/olivetin/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/olivetin 2>/dev/null 4 | exec svlogd -tt /mnt/data/log/olivetin -------------------------------------------------------------------------------- /content/service/olivetin/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec 2>&1 4 | 5 | mkdir -p /mnt/data/config/olivetin 2>/dev/null 6 | export HOME=/mnt/data 7 | 8 | if [ ! -f "/mnt/data/config/olivetin/config.yaml" ]; then 9 | mv /workdir/olivetin_config.yaml /mnt/data/config/olivetin/config.yaml 10 | fi 11 | 12 | if [ ! -f "/mnt/data/config/gallery-dl.conf" ]; then 13 | cp /workdir/gallery-dl.conf /mnt/data/config/gallery-dl.conf 14 | fi 15 | 16 | yt-dlp -U & 17 | python3 -m pip install --no-cache-dir -U gallery-dl & 18 | 19 | exec OliveTin --configdir /mnt/data/config/olivetin -------------------------------------------------------------------------------- /content/service/ttyd/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/ttyd 2>/dev/null 4 | exec svlogd /mnt/data/log/ttyd -------------------------------------------------------------------------------- /content/service/ttyd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec 2>&1 4 | 5 | if [ ! -f "/mnt/data/config/bashrc" ]; then 6 | cp /workdir/bashrc /mnt/data/config/ 7 | fi 8 | 9 | TELEGRAM_TITLE="$(grep ^telegram-notification-title "/mnt/data/config/script.conf" | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 10 | 11 | exec ttyd -i 127.0.0.1 -p 61803 -P 3 -t fontSize=17 -t titleFixed=${TELEGRAM_TITLE}_ttyd -t 'theme={"background": "black"}' bash --rcfile /mnt/data/config/bashrc 12 | -------------------------------------------------------------------------------- /content/ytdlp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | touch /mnt/data/log/ytdlp.log 4 | 5 | exec &> >(tee -a /mnt/data/log/ytdlp.log) 6 | 7 | yt-dlp -P /mnt/data/videos --no-progress "$@" -------------------------------------------------------------------------------- /content/ytdlptorclone.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Created by wy580477 for customized container 4 | # 5 | 6 | LOCAL_PATH="$1" 7 | APP=yt-dlp 8 | source /workdir/script_core.sh 9 | 10 | DEFINITION_PATH() { 11 | UPLOAD_MODE="$(grep ^ytdlp-upload-mode /mnt/data/config/script.conf | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 12 | YTDLP_DRIVE_DIR="$(grep ^ytdlp-drive-dir /mnt/data/config/script.conf | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 13 | DOWNLOAD_DIR=/mnt/data/videos 14 | FILE_PATH=$(echo ${LOCAL_PATH} | sed 's:[^/]*$::') 15 | FILE_NAME=$(basename "${LOCAL_PATH}") 16 | MSG_PATH="${LOCAL_PATH}" 17 | FOLDER_NAME="${FILE_NAME}" 18 | DEST_PATH_SUFFIX="${FILE_PATH#"${DOWNLOAD_DIR%/}"}" 19 | mv "${LOCAL_PATH}" "${FILE_PATH}""${FILE_NAME}" 20 | if [[ "${YTDLP_DRIVE_DIR}" =~ :/ ]]; then 21 | REMOTE_PATH_PREFIX="${YTDLP_DRIVE_DIR}" 22 | else 23 | if [ "${YTDLP_DRIVE_DIR}" = "" ]; then 24 | DRIVE_DIR=${GLOBAL_DRIVE_DIR}/yt-dlp 25 | else 26 | DRIVE_DIR=${YTDLP_DRIVE_DIR} 27 | fi 28 | REMOTE_PATH_PREFIX="${DRIVENAME}:${DRIVE_DIR}" 29 | fi 30 | REMOTE_PATH="${REMOTE_PATH_PREFIX}${DEST_PATH_SUFFIX}" 31 | } 32 | 33 | UPLOAD_TASK() { 34 | if [ "${UPLOAD_MODE}" = "disable" ]; then 35 | echo "$(DATE_TIME) [INFO] Auto-upload to Rclone remote disabled" 36 | SEND_TG_FINISHED 37 | else 38 | SEND_TG_FINISHED_TO_RCLONE 39 | UPLOAD_FILE 40 | fi 41 | if [ "${JOB_ID}" = "" ]; then 42 | exit 1 43 | fi 44 | } 45 | 46 | GET_PATH 47 | DEFINITION_PATH 48 | UPLOAD_TASK 49 | -------------------------------------------------------------------------------- /content/ytdlptotg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | touch /mnt/data/log/ytdlp.log 4 | 5 | exec &> >(tee -a /mnt/data/log/ytdlp.log) 6 | 7 | yt-dlp --exec ytdlpuptg.sh -P /mnt/data/videos --no-progress "$@" -------------------------------------------------------------------------------- /content/ytdlpup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | touch /mnt/data/log/ytdlp.log 4 | 5 | exec &> >(tee -a /mnt/data/log/ytdlp.log) 6 | 7 | yt-dlp --exec ytdlptorclone.sh -P /mnt/data/videos --no-progress "$@" -------------------------------------------------------------------------------- /content/ytdlpuptg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /workdir/script_core.sh 4 | FILE_NAME="$(basename "$1")" 5 | 6 | SEND_TO_TG() { 7 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 8 | SEND_TG_MSG yt-dlp "${FILE_NAME} 下载已完成并发送上传任务至 Telegram" 9 | else 10 | SEND_TG_MSG yt-dlp "${FILE_NAME} download completed and send upload job to Telegram" 11 | fi 12 | } 13 | 14 | GET_PATH 15 | if [ "${TG_PROXY}" != "" ]; then 16 | PROXY_PARAM="-p ${TG_PROXY}" 17 | fi 18 | TELEGRAM_DEST="$(grep ^telegram-dest ${SCRIPT_CONF} | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 19 | TELEGRAM_MODE="$(grep ^telegram-auto-upload-mode ${SCRIPT_CONF} | cut -d= -f2- | sed "s|^[ \t]*||g;s|\r$||")" 20 | if [ "${TELEGRAM_DEST}" != "" ]; then 21 | DEST_PARAM="--to ${TELEGRAM_DEST}" 22 | fi 23 | if [ "${TELEGRAM_MODE}" = "move" ]; then 24 | UP_MODE_PARAM="-d" 25 | fi 26 | SEND_TO_TG 27 | RETRY=0 28 | RETRY_NUM=10 29 | while [ ${RETRY} -le ${RETRY_NUM} ]; do 30 | [ ${RETRY} != 0 ] && ( 31 | echo -e "$(DATE_TIME) ${ERROR} Telegram Upload failed! Retry ${RETRY}/${RETRY_NUM} ..." 32 | ) 33 | telegram-upload ${DEST_PARAM} ${PROXY_PARAM} ${UP_MODE_PARAM} "$1" 34 | EXIT_CODE=$? 35 | if [ ${EXIT_CODE} -eq 0 ]; then 36 | echo "$(DATE_TIME) [INFO] Successfully upload file to Telegram: $1" 37 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 38 | SEND_TG_MSG Telegram "[INFO] Telegram 上传任务已成功: $1" 39 | else 40 | SEND_TG_MSG Telegram "[INFO] File successfully uploaded to Telegram : $1" 41 | fi 42 | break 43 | else 44 | RETRY=$((${RETRY} + 1)) 45 | sleep 10 46 | fi 47 | done 48 | if [[ "${RETRY}" -eq 2 ]] && [[ ! "${EXIT_CODE}" -eq 0 ]]; then 49 | echo "$(DATE_TIME) [ERROR] Failed to upload file to Telegram: $1" 50 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 51 | SEND_TG_MSG Telegram "[ERROR] Telegram 上传任务失败: $1" 52 | else 53 | SEND_TG_MSG Telegram "[ERROR] Failed to upload file to Telegram: $1" 54 | fi 55 | fi 56 | -------------------------------------------------------------------------------- /docs/README_colab.md: -------------------------------------------------------------------------------- 1 | ## Colab has banned this project, deployment will cause your google account unable to use Colab. 2 | 3 | ## Attention 4 | 5 | 1. **Do not abuse service from Colab or your account could get banned. Deploy at your own risk.** 6 | 2. Aria2 & qBittorrent download speed is limited to 5MB/s on default. 7 | 3. It is not possible to configure a Rclone remote which requires web authentication through Rclone web UI in this app. You need to prepare rclone.conf file on other devices. 8 | 9 | [Overview](#Overview) 10 | 11 | [Deployment](#Deployment) 12 | 13 | [First run](#first) 14 | 15 | [More usages and precautions](#more) 16 | 17 | ## Overview 18 | 19 | This project integrates yt-dlp, gallery-dl, Aria2 + WebUI, qBittorrent + VueTorrent WebUI, pyLoad Download Manager, Rclone + WebUI with auto-upload function, Rclone Serve HTTP, OliveTin WebUI for shell commands, Filebrowser, ttyd web terminal. 20 | 21 | 1. Rclone auto-upload function only needs to prepare rclone.conf file, and all other configurations are set to go. 22 | 2. Rclone runs on daemon mode, easy to manually transfer files and monitor transfers in real time on WebUI. 23 | 3. Auto-backup configuration files to Google Drive, and try to restore when dyno restarts. 24 | 4. Execute predefined yt-dlp, gallery-dl & Rclone commands from OliveTin WebUI. 25 | 5. ttyd web terminal, which can execute yt-dlp and other commands on the command line. 26 | 6. There are independent logs for each service in the log directory. 27 | 28 | ## Deployment 29 | 30 | 1. Make a folder named AIO_FILES in your Google Drive root folder. 31 | 2. Upload [main.zip](https://github.com/wy580477/Leech-AIO-APP-EX/archive/refs/heads/Colab.zip) to AIO_FILES folder. 32 | 3. Upload [AIO.ipynb](https://github.com/wy580477/Heroku-AIO-APP-EX/raw/Colab/AIO.ipynb) to Google Drive. 33 | 4. Run AIO.ipynb. 34 | 5. If you can't find function settings added in new version in script.conf after upgrading, refer to the latest [script.conf](https://github.com/wy580477/Leech-AIO-APP-EX/blob/Colab/content/script.conf) file,and add missing setting options by yourself. 35 | 36 | ## First run 37 | 38 | - Upload rclone.conf file to config folder via Filebrowser, you can edit script.conf file to change Rclone auto-upload settings. 39 | - Add following content to rclone.conf file in order to use your mounted Google Drive as a Rclone remote. 40 | 41 | [local] 42 | type = alias 43 | remote = /content/drive/MyDrive 44 | 45 | - yt-dlp, gallery-dl & other commands can be executed through ttyd web terminal. 46 | Built-in alias: 47 | dlpr: Use yt-dlp to download videos to videos folder, then send task to Rclone after downloads completed. 48 | gdlr: Use gallery-dl to download files to gallery_dl_downloads folder, then send task to Rclone after downloads completed. 49 | 50 | ## More usages and precautions 51 | 52 | 1. To enable Telegram notification function, you need to talk to @BotFather in Telegram to register a bot. Get ChatID of your Telegram account or ChatID of the channel which bot joined. Please Google for detailed steps. 53 | 54 | Edit the config/script.conf file. Fill in the corresponding options for botid:token and ChatID, then the notification function will take effect. 55 | 56 | 2. Known pyLoad bugs: 57 | - Fail to delete archives after extraction, solution: Settings--Plugins--ExtractArchive, set "Move to trash instead delete" to off. 58 | -------------------------------------------------------------------------------- /docs/README_colab_chs.md: -------------------------------------------------------------------------------- 1 | ## Colab 已经封禁此项目,部署会导致 google 账户无法使用 Colab,暂停维护。 2 | 3 | 4 | ## 注意 5 | 6 | 1. **请勿滥用,Colab账号封禁风险自负。** 7 | 2. Aria2和qBittorrent配置文件默认限速5MB/s。 8 | 3. 无法通过Rclone Web前端建立需要网页认证的存储配置。需要自行在其他设备上准备好rclone.conf文件。 9 | 10 | [概述](#概述) 11 | 12 | [部署方式](#部署方式) 13 | 14 | [初次使用](#初次使用) 15 | 16 | [更多用法和注意事项](#更多用法和注意事项) 17 | 18 | ## 概述 19 | 20 | 本项目集成了yt-dlp、gallery-dl、Aria2+Rclone+qBittorrent+WebUI、pyLoad下载管理器、Rclone联动自动上传功能、Rclone远程存储文件列表、Filebrowser轻量网盘、OliveTin网页执行shell命令、ttyd Web终端。 21 | 22 | 1. 联动上传功能只需要准备rclone.conf配置文件, 其他一切配置都预备齐全。 23 | 2. Rclone以daemon方式运行,可在WebUI上手动传输文件和实时监测传输情况。 24 | 3. 自动备份相关配置文件到Google Drive,实现了配置文件持久化。 25 | 4. 可以从OliveTin网页端执行预定义yt-dlp、gallery-dl和Rclone指令。 26 | 5. ttyd网页终端,可从命令行执行yt-dlp下载工具和其它命令。 27 | 6. log目录下有每个服务独立日志。 28 | 29 | ## 部署方式 30 | 31 | 1. 在Google Drive根目录下建立一个名为 AIO_FILES 的文件夹. 32 | 2. 将 [main.zip](https://github.com/wy580477/Leech-AIO-APP-EX/archive/refs/heads/Colab.zip) 上传到 AIO_FILES 文件夹. 33 | 3. 将 [AIO.ipynb](https://github.com/wy580477/Leech-AIO-APP-EX/raw/Colab/AIO.ipynb) 上传到Google Drive. 34 | 4. 运行 AIO.ipynb. 35 | 36 | ### 初次使用 37 | 38 | - 通过Filebrowse将rclone.conf文件上传到config目录,可以通过编辑script.conf文件更改Rclone自动上传设置。 39 | - 将下列内容作为rclone.conf文件,可将Colab中挂载的Google Drive作为Rclone的远程存储。 40 | 41 | [local] 42 | type = alias 43 | remote = /content/drive/MyDrive 44 | 45 | - yt-dlp和gallery-dl下载工具可以通过ttyd在网页终端执行。 46 | 内置快捷指令: 47 | dlpr:使用yt-dlp下载视频到videos文件夹下,下载完成后发送任务到rclone。 48 | gdlr:使用gallery-dl下载文件到gallery_dl_downloads文件夹下,下载完成后发送任务到rclone。 49 | 50 | - 如果升级版本后在script.conf文件中没有找到相关新增功能设置,参考最新版 [script.conf](https://github.com/wy580477/Leech-AIO-APP-EX/blob/Colab/content/script.conf) 文件,自行添加缺失的设置选项。 51 | 52 | ### 更多用法和注意事项 53 | 54 | 1. Telegram通知功能,需要在Telegram内与@BotFather对话注册bot。然后获取自己账户的ChatID或者bot加入的频道ChatID。具体详细步骤请Google。 55 | 56 | 然后编辑config/script.conf文件,将botid:token和ChatID填入对应选项,通知功能即生效。 57 | 58 | 2. pyLoad已知Bug: 59 | - 解压后不能删除原文件,解决方法:Settings--Plugins--ExtractArchive,将"Move to trash instead delete"项设置为off。 60 | -------------------------------------------------------------------------------- /docs/README_docker.md: -------------------------------------------------------------------------------- 1 | [Overview](#Overview) 2 | 3 | [Deployment](#Deployment) 4 | 5 | [First run](#first) 6 | 7 | [More usages and precautions](#more) 8 | 9 | ## Overview 10 | 11 | This project integrates yt-dlp & its Web frontend metube, gallery-dl, Aria2 + WebUI, qBittorrent + VueTorrent WebUI, pyLoad Download Manager, Rclone + WebUI with auto-upload function, Rclone Serve HTTP & Webdav, Filebrowser, Telegram notification. 12 | 13 | 1. Rclone auto-upload function only needs to prepare rclone.conf file, and all other configurations are set to go. 14 | 2. AMD64/Arm64 multi-architecture support. 15 | 3. Execute predefined yt-dlp, gallery-dl & Rclone commands from OliveTin WebUI. 16 | 4. Rclone runs on daemon mode, easy to manually transfer files and monitor transfers in real time on WebUI. 17 | 5. You can connect to Aria2, qBittorrent from other frontends/services,including Telegram bot/flexget/Radarr/Sonarr. 18 | 6. [runit](http://smarden.org/runit/index.html)-based process management, each service can be started and stopped independently. 19 | 7. There are independent logs for each service in the log directory. 20 | 21 | ## Deployment 22 | 23 | 1. Download [docker-compose file](https://github.com/wy580477/Leech-AIO-APP-EX/blob/docker/docker-compose_en.yml). Lite version without pyLoad has smaller image size. 24 | 2. Set envs and run container with following command: 25 | 26 | docker-compose -f docker-compose_en.yml up -d 27 | 28 | ## First run 29 | 30 | 1. visit your_domain/ip_address + ${GLOBAL_PORTAL_PATH} to reach portal page. 31 | 2. Click AriaNg, then authentication failure warning will pop up, fill in Aria2 secret RPC token with password set during deployment and check whether protocol and port settings match what is displayed in the browser address bar. 32 | 33 | 34 | 35 | 3. Open log/qBittorrent/current file under docker volume diretory to get qBit temporary password. Click qBittorrent or VueTorrent, type default username admin and temporary password to login. Change default user/password to your own. Recommend strong password. 36 | 37 | If you can't log in qBittorrent with the default account/password. Delete config/qBittorrent/config/qBittorrent.conf file via Filebrowser, then run the following command in host terminal: 38 | ``` 39 | docker exec allinone sv restart qBittorrent 40 | ``` 41 | 4. It's not possible to configure a Rclone remote which requires web authentication through Rclone web UI in this app. You need to upload rclone.conf file to config folder via Filebrowser, you can edit script.conf file to change Rclone auto-upload settings. 42 | 5. If you can't find function settings added in new version in script.conf after upgrading, refer to the latest [script.conf](https://github.com/wy580477/Leech-AIO-APP-EX/blob/docker/content/script.conf) file,and add missing setting options by yourself. 43 | 44 | ## More usages and precautions 45 | 46 | 1. To enable Telegram notification function, you need to talk to @BotFather in Telegram to register a bot. Get ChatID of your Telegram account or ChatID of the channel which bot joined. Please Google for detailed steps. 47 | 48 | Edit the config/script.conf file. Fill in the corresponding options for botid:token and ChatID, then the notification function will take effect. 49 | 2. You can set up proxy for metube in config/metube.conf: 50 | ``` 51 | YTDL_OPTIONS="{\"postprocessors\":[{\"key\":\"Exec\",\"exec_cmd\":\"ytdlptorclone.sh\"}],\"proxy\":\"socks5://127.0.0.1:10808\",\"noprogress\":true}" 52 | ``` 53 | 3. How to use yt-dlp & gallery-dl via command line: 54 | 55 | 56 | docker exec allinone yt-dlp 57 | # Built-in script:dlpr 58 | # Download videos to videos folder, then send job to Rclone. 59 | docker exec allinone dlpr https://www.youtube.com/watch?v=rbDzVzBsbGM 60 | 61 | docker exec allinone gallery-dl 62 | # Built-in script:gdlr 63 | # Download files to gallery_dl_downloads folder, then send job to Rclone. 64 | docker exec allinone gdlr https://www.reddit.com/r/aww/comments/vb14vy/urgent_baby_flamingo_doing_flamingo_leg/ 65 | 66 | 4. For apps which don't support custom path for qBittorrent, uncomment followings line in Caddyfile under config/caddy folder: 67 | 68 | 69 | handle /api* { 70 | reverse_proxy * localhost:61804 71 | } 72 | 73 | Then run following command for change to take effect: 74 | 75 | 76 | docker exec allinone sv restart caddy 77 | 78 | 5. Aria2 JSON-RPC path: \${GLOBAL_PORTAL_PATH}/jsonrpc 79 | Aria2 XML-RPC path: \${GLOBAL_PORTAL_PATH}/rpc 80 | 6. Considering security reasons, the initial user of Filebrowser doesn't have administrator privileges. If administrator privileges are wanted, run following commands: 81 | 82 | 83 | docker exec -it allinone sh 84 | # enter container shell 85 | sv stop filebrowser 86 | # stop filebrowser service 87 | filebrowser -d /mnt/data/config/filebrowser.db users add username password --perm.admin 88 | # add new account with admin privileges 89 | sv start filebrowser 90 | # start filebrowser service 91 | 92 | 7. Known pyLoad bugs: 93 | - Redirect to http after login,solution: close the pyLoad page and reopen it. 94 | - Fail to delete archives after extraction, solution: Settings--Plugins--ExtractArchive, set "Move to trash instead delete" to off. 95 | 8. After adding following content to rclone.conf file, you can use local storage as a Rclone remote for manually uploading via Rclone Web UI. 96 | 97 | 98 | [local] 99 | type = alias 100 | remote = /mnt/data 101 | 102 | -------------------------------------------------------------------------------- /docs/README_docker_chs.md: -------------------------------------------------------------------------------- 1 | [概述](#概述) 2 | 3 | [部署方式](#部署方式) 4 | 5 | [初次使用](#初次使用) 6 | 7 | [更多用法和注意事项](#更多用法和注意事项) 8 | 9 | ## 概述 10 | 11 | 本项目集成了yt-dlp和其Web前端metube、gallery-dl、Aria2+Rclone+qBittorrent+WebUI、pyLoad下载管理器、Rclone联动自动上传功能、Rclone远程存储文件列表和Webdav服务、Filebrowser轻量网盘。支持 Telegram 任务完成通知。 12 | 13 | 1. 联动上传功能只需要准备rclone.conf配置文件, 其他一切配置都预备齐全。 14 | 2. AMD64/Arm64架构支持。 15 | 3. 可以从OliveTin网页端执行预定义yt-dlp、gallery-dl和Rclone指令。 16 | 4. Rclone以daemon方式运行,可在WebUI上手动传输文件和实时监测传输情况。 17 | 5. Aria2、qBittorrent和Rclone可以接入AriaNg/RcloneNg等前端面板、Aria2/qBit 电报机器人以及flexget/Radarr/Sonarr等应用。 18 | 6. 基于 [runit](http://smarden.org/runit/index.html) 的进程管理,每个服务可以独立启停。 19 | 7. log目录下有每个服务独立日志。 20 | 21 | ## 部署方式 22 | 23 | 1. 下载[docker-compose文件](https://github.com/wy580477/Leech-AIO-APP-EX/blob/docker/docker-compose.yml). Lite版本无pyLoad,容器体积更小。 24 | 2. 按说明设置好变量,用如下命令运行容器。 25 | 26 | docker-compose up -d 27 | 28 | ### 初次使用 29 | 30 | 1. 访问ip地址或域名+基础URL即可打开导航页。 31 | 2. 点击AriaNg,这时会弹出认证失败警告,按下图把之前部署时设置的密码填入RPC密钥,并检查协议和端口是否与浏览器地址栏显示的相符。 32 | 33 | 3. 查看数据存放目录下 log/qBittorrent/current 文件,获得 qBit 临时密码。点击qBittorrent或者VueTorrent,输入默认用户名 admin 和临时密码登陆。然后更改用户名和密码,务必设置为强密码。 34 | 35 | 如果qBittorrent无法使用默认账户密码登陆,通过Filebrowser删除config/qBittorrent/config/qBittorrent.conf文件,然后在宿主机终端下执行下面命令: 36 | ``` 37 | docker exec allinone sv restart qBittorrent 38 | ``` 39 | 4. 注意,无法通过Rclone Web前端建立需要网页认证的存储配置。需要通过Filebrowse将rclone.conf文件上传到config目录,可以通过编辑script.conf文件更改Rclone自动上传设置。 40 | 5. 如果升级版本后在script.conf文件中没有找到相关新增功能设置,参考最新版 [script.conf](https://github.com/wy580477/Leech-AIO-APP-EX/blob/docker/content/script.conf) 文件,自行添加缺失的设置选项。 41 | 42 | ### 更多用法和注意事项 43 | 44 | 1. Telegram通知功能,需要在Telegram内与@BotFather对话注册bot。然后获取自己账户的ChatID或者bot加入的频道ChatID。具体详细步骤请Google。 45 | 46 | 然后编辑config/script.conf文件,将botid:token和ChatID填入对应选项,通知功能即生效。 47 | 48 | 2. metube可以在config/metube.conf配置文件中设置代理,示例: 49 | ``` 50 | YTDL_OPTIONS="{\"postprocessors\":[{\"key\":\"Exec\",\"exec_cmd\":\"ytdlptorclone.sh\"}],\"proxy\":\"socks5://127.0.0.1:10808\",\"noprogress\":true}" 51 | ``` 52 | 3. 命令行调用yt-dlp和gallery-dl方法: 53 | 54 | docker exec allinone yt-dlp 55 | # 内置快捷脚本:dlpr 56 | docker exec allinone dlpr https://www.youtube.com/watch?v=rbDzVzBsbGM 57 | # 下载到videos目录并与rclone联动 58 | 59 | docker exec allinone gallery-dl 60 | # 内置快捷脚本:gdlr 61 | docker exec allinone gdlr https://www.reddit.com/r/aww/comments/vb14vy/urgent_baby_flamingo_doing_flamingo_leg/ 62 | # 下载到gallery_dl_downloads目录并与rclone联动 63 | 64 | 4. 对于不支持qBittorrent自定义路径的应用, 在config/caddy目录下的Caddyfile文件中找到下列内容,去除每行开头的注释符号“#”: 65 | 66 | 67 | handle /api* { 68 | reverse_proxy * localhost:61804 69 | } 70 | 71 | 然后在宿主机终端执行如下命令即可生效: 72 | 73 | docker exec allinone sv restart caddy 74 | 75 | 5. Aria2 JSON-RPC 路径为: \${GLOBAL_PORTAL_PATH}/jsonrpc 76 | Aria2 XML-RPC 路径为: \${GLOBAL_PORTAL_PATH}/rpc 77 | 6. 考虑安全原因Filebrowser初始用户无管理员权限,如需要管理员权限,执行下列命令: 78 | 79 | 80 | docker exec -it allinone sh 81 | # 进入容器shell 82 | sv stop filebrowser 83 | # 停止filebrowser服务 84 | filebrowser -d /mnt/data/config/filebrowser.db users add 用户名 密码 --perm.admin 85 | # 新建管理员用户。也可以使用users update 用户名 --perm.admin命令赋予现有用户管理员权限。 86 | sv start filebrowser 87 | # 启动filebrowser服务 88 | 89 | 7. pyLoad已知Bug: 90 | - 登陆后重定向到http,解决方法:关闭当前pyLoad页面,重新打开。 91 | - 解压后不能删除原文件,解决方法:Settings--Plugins--ExtractArchive,将"Move to trash instead delete"项设置为off。 92 | 8. 将下列内容添加到rclone.conf文件,可以将本地存储作为Rclone的远程存储,便于在Rclone WebUI上手动上传。 93 | 94 | [local] 95 | type = alias 96 | remote = /mnt/data 97 | -------------------------------------------------------------------------------- /docs/README_doprax.md: -------------------------------------------------------------------------------- 1 | ## Attention 2 | 3 | ### Doprax has stopped offering free plan. 4 | 5 | 1. **Do not abuse service from Doprax or your account could get banned. Deploy at your own risk.** 6 | 2. **High disk usage will likely get your account banned.** 7 | 3. Aria2 & qBittorrent download speed is limited to 5MB/s on default. 8 | 4. Container filesystem is ephemeral - that means that any changes to the filesystem except volume mounted on /mnt/data/config whilst the dyno is running only last until that container is shut down or restarted. 9 | 5. It is not possible to configure a Rclone remote which requires web authentication through Rclone Web UI in this app. You need to prepare rclone.conf file on other devices. 10 | 6. No Rclone mount support. 11 | 12 | 13 | [Overview](#Overview) 14 | 15 | [Deployment](#Deployment) 16 | 17 | [Envionment Variables](#Envionment_Variables) 18 | 19 | [First run](#first) 20 | 21 | [More usages and precautions](#more) 22 | 23 | ## Overview 24 | 25 | This project integrates yt-dlp, gallery-dl, Aria2 + WebUI, qBittorrent + VueTorrent WebUI, pyLoad Download Manager, Rclone + WebUI with auto-upload function, Rclone Serve HTTP & Webdav, customizable portal page, OliveTin WebUI for shell commands, Filebrowser, ttyd web terminal, Telegram notification. 26 | 27 | 1. Rclone auto-upload function only needs to prepare rclone.conf file, and all other configurations are set to go. 28 | 2. Rclone runs on daemon mode, easy to manually transfer files and monitor transfers in real time on WebUI. 29 | 3. You can connect Aria2, qBittorrent and Rclone from frontends/services running on other hosts, including flexget/Radarr/Sonarr. 30 | 4. Execute predefined yt-dlp, gallery-dl & Rclone commands from OliveTin WebUI. 31 | 5. ttyd web terminal, which can execute yt-dlp and other commands on the command line. 32 | 6. [runit](http://smarden.org/runit/index.html)-based process management, each service can be started and stopped independently. 33 | 7. There are independent logs for each service in the log directory. 34 | 8. [NodeStatus](https://github.com/cokemine/nodestatus) server monitor client. 35 | 36 | ## Deployment 37 | 38 | **Do not deploy directly from this repository** 39 | 40 | 1. Fork this this repository (uncheck "Copy the main branch only"), then click Setting on fork repository page and check Template repository. 41 | 2. Go back to "Code" tab. Then Click new button: Use this template,create a new repository. 42 | 3. Go to Setting tab on your new repo,Click "Branches",set default branch to "doprax". 43 | 44 |
45 | Screenshot 46 | 47 | ![avatar](/screenshots/branch.png) 48 | 49 |
50 | 51 | 3. Go to Doprax Dashboard page, click "Account", then connect your github account. 52 | 4. Click "Dashboard", creat a new app and click it. 53 | 5. Click your newly created app, click "Import from my Github account" button, then import your new github repository. 54 | 6. Click "Add environment variable", add environment variables according to the following table. 55 | 7. Click "Volume", create a new volume and mount it to /mnt/data/config. 56 | 57 |
58 | Screenshot 59 | 60 | ![avatar](/screenshots/volume.png) 61 | 62 |
63 | 64 | 7. Click "Deploy", then click "Resources". Set RAM to 512MB, click "Submit". Click the Start button and wait for the deployment to complete. 65 | 66 |
67 | Screenshot 68 | 69 | ![avatar](/screenshots/deploy.png) 70 | 71 |
72 | 73 | ## Envionment Variables 74 | 75 | | Variable | Default | Description | 76 | | :--- | :--- | :--- | 77 | | `GLOBAL_USER` | admin | Username for all web services except qbit | 78 | | `GLOBAL_PASSWORD` | password | Password for all web services except qbit, double as Aria2 RPC token. Recommend strong password. | 79 | | `GLOBAL_LANGUAGE` | en | Set language of portal page, qbit & filebrowser.(en or chs) | 80 | | `GLOBAL_PORTAL_PATH` | /mypath | Portal page & base URL for all web services. Set this to an uncommon path. Do not set to blank or '/' | 81 | | `NodeStatus_DSN` | | Optional. NodeStatus server connection info, default blank value will disable NodeStatus. Example: wss://username:password@status.mydomain.com | 82 | 83 | 84 | ## First run 85 | 86 | 1. Visit your "App URL" + ${GLOBAL_PORTAL_PATH} to reach portal page. 87 | 88 | If your doprax domain gives you 503 or timeout error, here's a [workaround](https://github.com/wy580477/Leech-AIO-APP-EX/issues/67#issuecomment-1425437513) by using cloudflared tunnel. 89 | 2. Click AriaNg, then authentication failure warning will pop up, fill in Aria2 secret RPC token with password set during deployment. 90 | 91 | 92 | 93 | 3. Click qBittorrent or VueTorrent, then login in with default user admin and default password adminadmin. Change default user/password to your own. Recommend strong password. 94 | 95 | If you can't log in qBittorrent with the default account/password. Delete config/qBittorrent/config/qBittorrent.conf file via Filebrowser, then run the following command via ttyd: 96 | 97 | ``` 98 | sv restart 1 99 | ``` 100 | 4. Upload rclone.conf file to config folder via Filebrowser, you can edit script.conf file to change Rclone auto-upload settings. 101 | 5. yt-dlp, gallery-dl & other commands can be executed through ttyd web terminal. 102 | Built-in alias: 103 | dlpr:Use yt-dlp to download videos to videos folder, then send task to Rclone after downloads completed. 104 | gdlr: Use gallery-dl to download files to gallery_dl_downloads folder, then send task to Rclone after downloads completed. 105 | 6. If you can't find function settings added in new version in script.conf after upgrading, refer to the latest [script.conf](https://github.com/wy580477/Leech-AIO-APP-EX/blob/doprax/content/script.conf) file,and add missing setting options by yourself. 106 | 107 | ## More usages and precautions 108 | 109 | 1. To enable Telegram notification function, you need to talk to @BotFather in Telegram to register a bot. Get ChatID of your Telegram account or ChatID of the channel which bot joined. Please Google for detailed steps. 110 | 111 | Edit the config/script.conf file. Fill in the corresponding options for botid:token and ChatID, then the notification function will take effect. 112 | 2. Known pyLoad bugs: 113 | - Fail to delete archives after extraction, solution: Settings--Plugins--ExtractArchive, set "Move to trash instead delete" to off. 114 | 3. After adding following content to rclone.conf file, you can use local container storage as a Rclone remote for manually uploading via Rclone Web UI. 115 | 116 | ``` 117 | [local] 118 | type = alias 119 | remote = /mnt/data 120 | ``` 121 | 122 | 4. For apps which don't support custom path for qBittorrent, uncomment followings line in Caddyfile under config/caddy folder before deployment: 123 | 124 | handle /api* { 125 | reverse_proxy * localhost:61804 126 | } 127 | 128 | 5. Aria2 JSON-RPC path: \${GLOBAL_PORTAL_PATH}/jsonrpc 129 | Aria2 XML-RPC path: \${GLOBAL_PORTAL_PATH}/rpc 130 | -------------------------------------------------------------------------------- /docs/README_doprax_chs.md: -------------------------------------------------------------------------------- 1 | ## 注意 2 | 3 | ### Doprax 已停止提供免费服务 4 | 5 | 1. **请勿滥用,Doprax 账号封禁风险自负。** 6 | 2. **占用大量硬盘空间可能导致账户被封禁。** 7 | 3. 容器的文件系统是临时性的,除挂载到数据卷的 /mnt/data/config 目录,重启后会恢复到部署时状态。 8 | 4. Aria2和qBittorrent配置文件默认限速5MB/s。 9 | 5. 无法通过Rclone Web前端建立需要网页认证的存储配置。需要自行在其他设备上准备好rclone.conf文件。 10 | 6. 不支持 Rclone mount。 11 | 12 | [概述](#概述) 13 | 14 | [部署方式](#部署方式) 15 | 16 | [变量设置](#变量设置) 17 | 18 | [初次使用](#初次使用) 19 | 20 | [更多用法和注意事项](#更多用法和注意事项) 21 | 22 | ## 概述 23 | 24 | 本项目集成了yt-dlp、gallery-dl、Aria2+Rclone+qBittorrent+WebUI、pyLoad下载管理器、Rclone联动自动上传功能、Rclone远程存储文件列表和Webdav服务、Filebrowser轻量网盘、OliveTin网页执行shell命令、ttyd Web终端、Telegram任务完成通知。 25 | 26 | 1. 联动上传功能只需要准备rclone.conf配置文件, 其他一切配置都预备齐全。 27 | 2. Rclone以daemon方式运行,可在WebUI上手动传输文件和实时监测传输情况。 28 | 3. Aria2、qBittorrent和Rclone可以接入其它host上运行的AriaNg/RcloneNg等前端面板和flexget/Radarr/Sonarr等应用。 29 | 4. 可以从OliveTin网页端执行yt-dlp、gallery-dl和Rclone指令。 30 | 5. ttyd网页终端,可命令行执行yt-dlp下载工具和其它命令。 31 | 6. 基于 [runit](http://smarden.org/runit/index.html) 的进程管理,每个服务可以独立启停。 32 | 7. log目录下有每个服务独立日志。 33 | 8. 集成 [NodeStatus](https://github.com/cokemine/nodestatus) 探针客户端。[NodeStatus 服务端](https://github.com/wy580477/NodeStatus-Docker)也可以部署在 PaaS 平台上。 34 | 35 | ## 部署方式 36 | 37 | **请勿使用本仓库直接部署** 38 | 39 | 1. 点击本仓库右上角Fork,取消选择"Copy the main branch only",再点击Create Fork。 40 | 2. 在Fork出来的仓库页面上点击Setting,勾选Template repository。 41 | 3. 然后点击Code返回之前的页面,点Setting下面新出现的按钮Use this template,起个随机名字创建新库。 42 | 4. 在你新建立的Github仓库页面上点击Setting,再点击Branches,将默认分支改为doprax。 43 | 44 |
45 | 截图 46 | 47 | ![avatar](/screenshots/branch.png) 48 | 49 |
50 | 51 | 4. 前往 Doprax 网站管理面板,点击"Account",再点击"Connect to Github",连接你的 github 账号。 52 | 5. 点击"Dashboard",再点击"New app",建立一个新 app。 53 | 6. 点击你刚建立的 app,再点击"Import from my Github account",然后选择你刚建立的 Github 仓库导入。 54 | 7. 点击"Add environment variable",按下文变量设置部分的说明设置变量。 55 | 8. 点击"Volume", 建立一个新的数据卷(volume)并将其挂载到 /mnt/data/config. 56 | 57 |
58 | 截图 59 | 60 | ![avatar](/screenshots/volume.png) 61 | 62 |
63 | 9. 点击"Deploy", 再点击"Resources". 将 RAM 设置为 512MB, 点击 "Submit". 然后点击开始按钮并等待部署完成。 64 |
65 | 截图 66 | 67 | ![avatar](/screenshots/deploy.png) 68 | 69 |
70 | 71 | ## 变量设置 72 | 73 | 对部署时可设定的变量做如下说明。 74 | | 变量 | 默认值 | 说明 | 75 | | :--- | :--- | :--- | 76 | | `GLOBAL_USER` | admin | 用户名,适用于除qBittorrent外所有需要输入用户名的Web服务 | 77 | | `GLOBAL_PASSWORD` | password | 务必修改为强密码,同样适用于除qBittorrent外所有需要输入密码的Web服务,同时也是Aria2 RPC密钥。 | 78 | | `GLOBAL_LANGUAGE` | en | 设置导航页、qBittorrent和Filebrowser界面语言,chs为中文 | 79 | | `GLOBAL_PORTAL_PATH` | /mypath | 导航页路径和所有Web服务的基础URL,务必设置为不常见路径。不能为“/"和空值,结尾不能加“/" | 80 | | `TZ` | UTC | 时区,Asia/Shanghai为中国时区 | 81 | | `NodeStatus_DSN` | | 可选,NodeStatus 探针服务端连接信息,保持默认空值为禁用。示例:wss://username:password@status.mydomain.com | 82 | 83 | ## 初次使用 84 | 85 | 1. 访问你的 "App URL" + ${GLOBAL_PORTAL_PATH} 即可到达导航页。 86 | 2. 点击AriaNg,这时会弹出认证失败警告,按下图把之前部署时设置的密码填入RPC密钥即可。 87 | 88 | 3. 点击qBittorrent或者VueTorrent,输入默认用户名admin和默认密码adminadmin登陆。然后更改用户名和密码,务必设置为强密码。 89 | 90 | 如果qBittorrent无法使用默认账户密码登陆,通过Filebrowser删除config/qBittorrent/config/qBittorrent.conf文件,然后通过ttyd执行下面命令: 91 | 92 | ``` 93 | sv restart 1 94 | ``` 95 | 4. 通过Filebrowse将rclone.conf文件上传到config目录,可以通过编辑script.conf文件更改Rclone自动上传设置。 96 | 5. yt-dlp和gallery-dl下载工具可以通过ttyd在网页终端执行。 97 | 内置快捷指令: 98 | dlpr:使用yt-dlp下载视频到videos文件夹下,下载完成后发送任务到rclone。 99 | gdlr:使用gallery-dl下载文件到gallery_dl_downloads文件夹下,下载完成后发送任务到rclone。 100 | 6. 如果升级版本后在script.conf文件中没有找到相关新增功能设置,参考最新版 [script.conf](https://github.com/wy580477/Leech-AIO-APP-EX/blob/main/content/script.conf) 文件,自行添加缺失的设置选项。 101 | 102 | ## 更多用法和注意事项 103 | 104 | 1. Telegram通知功能,需要在Telegram内与@BotFather对话注册bot。然后获取自己账户的ChatID或者bot加入的频道ChatID。具体详细步骤请Google。 105 | 106 | 然后编辑config/script.conf文件,将botid:token和ChatID填入对应选项,通知功能即生效。 107 | 2. pyLoad已知Bug: 108 | - 解压后不能删除原文件,解决方法:Settings--Plugins--ExtractArchive,将"Move to trash instead delete"项设置为off。 109 | 3. Doprax 部署后,将下列内容添加到 rclone.conf 文件,可以将容器本地存储作为 Rclone 的远程存储,便于在Rclone WebUI上手动上传。 110 | 111 | ``` 112 | [local] 113 | type = alias 114 | remote = /mnt/data 115 | ``` 116 | 117 | 4. 对于不支持qBittorrent自定义路径的应用, 部署前在content目录下的Caddyfile文件中找到下列内容,去除每行开头的注释符号“#”: 118 | 119 | ``` 120 | handle /api* { 121 | reverse_proxy * localhost:61804 122 | } 123 | ``` 124 | 125 | 5. Aria2 JSON-RPC 路径为: \$\{GLOBAL_PORTAL_PATH\}/jsonrpc 126 | Aria2 XML-RPC 路径为: \$\{GLOBAL_PORTAL_PATH\}/rpc 127 | -------------------------------------------------------------------------------- /docs/README_heroku.md: -------------------------------------------------------------------------------- 1 | ## Heroku stopped offering free product plans and shut down free dynos starting Nov. 28, 2022. 2 | 3 | ## Attention 4 | 5 | 1. **Do not abuse service from Heroku or your account could get banned. Deploy at your own risk.** 6 | 2. Aria2 & qBittorrent download speed is limited to 5MB/s on default. 7 | 3. The Heroku filesystem is ephemeral - that means that any changes to the filesystem whilst the dyno is running only last until that dyno is shut down or restarted. In addition, dynos will restart every day. 8 | 4. To prevent Heroku dyno from auto-sleeping, use website monitoring service such as uptimerobot to http ping your heroku domain every 10 mins. 9 | 5. It is not possible to configure a Rclone remote which requires web authentication through Rclone web UI in this app. You need to prepare rclone.conf file on other devices. 10 | 6. No Rclone mount support. 11 | 12 | 13 | [Overview](#Overview) 14 | 15 | [Deployment](#Deployment) 16 | 17 | [First run](#first) 18 | 19 | [More usages and precautions](#more) 20 | 21 | ## Overview 22 | 23 | This project integrates yt-dlp, gallery-dl, Aria2 + WebUI, qBittorrent + VueTorrent WebUI, pyLoad Download Manager, Rclone + WebUI with auto-upload function, Rclone Serve HTTP & Webdav, customizable portal page, OliveTin WebUI for shell commands, Filebrowser, ttyd web terminal, Telegram notification. 24 | 25 | 1. Rclone auto-upload function only needs to prepare rclone.conf file, and all other configurations are set to go. 26 | 2. Rclone runs on daemon mode, easy to manually transfer files and monitor transfers in real time on WebUI. 27 | 3. You can connect Aria2, qBittorrent and Rclone from frontends/services running on other hosts, including flexget/Radarr/Sonarr. 28 | 4. Auto-backup configuration files to Cloudflare Workers KV, and try to restore when dyno restarts. 29 | 5. Execute predefined yt-dlp, gallery-dl & Rclone commands from OliveTin WebUI. 30 | 6. ttyd web terminal, which can execute yt-dlp and other commands on the command line. 31 | 7. [runit](http://smarden.org/runit/index.html)-based process management, each service can be started and stopped independently. 32 | 8. There are independent logs for each service in the log directory. 33 | 9. [NodeStatus](https://github.com/cokemine/nodestatus) server monitor client. 34 | 35 | ## Deployment 36 | 37 | **Do not deploy directly from this repository** 38 | 39 | 1. [Set up your Cloudflare workers KV service](https://github.com/wy580477/PaaS-Related/blob/main/SET_CLOUDFLARE_KV.md) 40 | 41 | **KV is used as config files storage. Some updates needs to manully update config files.** 42 | **Alternatively you can delete KV data from Cloudflare dashboard to reset config files of your deployment. [IMAGE](https://user-images.githubusercontent.com/98247050/174501970-d22eac74-f2f1-496c-a100-8188832e4da7.png)** 43 | 44 | 2. Fork this this repository, then click Setting on fork repository page and check Template repository. 45 | 3. Go back to "Code" tab. Then Click new button: Use this template,create a new repository. 46 | 4. For example, your Github username is bobby, and the new repository name is green. After logging in to heroku, visit to deploy. 47 | 48 | ## First run 49 | 50 | 1. Visit your_heroku_domain + ${GLOBAL_PORTAL_PATH} to reach portal page. 51 | 2. Click AriaNg, then authentication failure warning will pop up, fill in Aria2 secret RPC token with password set during deployment. 52 | 53 | 54 | 55 | 3. Click and login filebrowser, Open log/qBittorrent/current file under docker volume diretory to get qBit temporary password.Click qBittorrent or VueTorrent, then login in with default user admin and temporary password. Change default user/password to your own. Recommend strong password. 56 | 57 | If you can't log in qBittorrent with the default account/password. Delete config/qBittorrent/config/qBittorrent.conf file via Filebrowser, then run the following command via ttyd: 58 | 59 | ``` 60 | sv restart 1 61 | ``` 62 | 4. Upload rclone.conf file to config folder via Filebrowser, you can edit script.conf file to change Rclone auto-upload settings. 63 | 5. yt-dlp, gallery-dl & other commands can be executed through ttyd web terminal. 64 | Built-in alias: 65 | dlpr:Use yt-dlp to download videos to videos folder, then send task to Rclone after downloads completed. 66 | gdlr: Use gallery-dl to download files to gallery_dl_downloads folder, then send task to Rclone after downloads completed. 67 | 6. If you can't find function settings added in new version in script.conf after upgrading, refer to the latest [script.conf](https://github.com/wy580477/Leech-AIO-APP-EX/blob/main/content/script.conf) file,and add missing setting options by yourself. 68 | 69 | ## More usages and precautions 70 | 71 | 1. To enable Telegram notification function, you need to talk to @BotFather in Telegram to register a bot. Get ChatID of your Telegram account or ChatID of the channel which bot joined. Please Google for detailed steps. 72 | 73 | Edit the config/script.conf file. Fill in the corresponding options for botid:token and ChatID, then the notification function will take effect. 74 | 2. Known pyLoad bugs: 75 | - Fail to delete archives after extraction, solution: Settings--Plugins--ExtractArchive, set "Move to trash instead delete" to off. 76 | 3. After adding following content to rclone.conf file, you can use local heroku storage as a Rclone remote for manually uploading via Rclone Web UI. 77 | 78 | ``` 79 | [local] 80 | type = alias 81 | remote = /mnt/data 82 | ``` 83 | 84 | 4. For apps which don't support custom path for qBittorrent, uncomment followings line in Caddyfile under config/caddy folder before deployment: 85 | 86 | handle /api* { 87 | reverse_proxy * localhost:61804 88 | } 89 | 90 | 5. Aria2 JSON-RPC path: \${GLOBAL_PORTAL_PATH}/jsonrpc 91 | Aria2 XML-RPC path: \${GLOBAL_PORTAL_PATH}/rpc 92 | -------------------------------------------------------------------------------- /docs/README_heroku_chs.md: -------------------------------------------------------------------------------- 1 | ## Heroku已于2022年11月关闭免费服务 2 | 3 | ## 注意 4 | 5 | 1. **请勿滥用,Heroku账号封禁风险自负。** 6 | 2. Heroku的文件系统是临时性的,每24小时强制重启一次后会恢复到部署时状态。不适合长期下载和共享文件用途。 7 | 3. Aria2和qBittorrent配置文件默认限速5MB/s。 8 | 4. 免费Heroku dyno半小时无Web访问会休眠,可以使用uptimerobot、hetrixtools等免费VPS/网站监测服务定时http ping,保持持续运行。 9 | 5. 无法通过Rclone Web前端建立需要网页认证的存储配置。需要自行在其他设备上准备好rclone.conf文件。 10 | 6. 不支持 Rclone mount。 11 | 12 | [概述](#概述) 13 | 14 | [部署方式](#部署方式) 15 | 16 | [变量设置](#变量设置) 17 | 18 | [初次使用](#初次使用) 19 | 20 | [更多用法和注意事项](#更多用法和注意事项) 21 | 22 | ## 概述 23 | 24 | 本项目集成了yt-dlp、gallery-dl、Aria2+Rclone+qBittorrent+WebUI、pyLoad下载管理器、Rclone联动自动上传功能、Rclone远程存储文件列表和Webdav服务、Filebrowser轻量网盘、OliveTin网页执行shell命令、ttyd Web终端、Telegram任务完成通知。 25 | 26 | 1. 联动上传功能只需要准备rclone.conf配置文件, 其他一切配置都预备齐全。 27 | 2. Rclone以daemon方式运行,可在WebUI上手动传输文件和实时监测传输情况。 28 | 3. Aria2、qBittorrent和Rclone可以接入其它host上运行的AriaNg/RcloneNg等前端面板和flexget/Radarr/Sonarr等应用。 29 | 4. 自动备份相关配置文件到Cloudflare Workers KV,dyno重启时尝试恢复,实现了配置文件持久化。 30 | 5. 可以从OliveTin网页端执行yt-dlp、gallery-dl和Rclone指令。 31 | 6. ttyd网页终端,可命令行执行yt-dlp下载工具和其它命令。 32 | 7. 基于 [runit](http://smarden.org/runit/index.html) 的进程管理,每个服务可以独立启停。 33 | 8. log目录下有每个服务独立日志。 34 | 9. 集成 [NodeStatus](https://github.com/cokemine/nodestatus) 探针客户端。[NodeStatus 服务端](https://github.com/wy580477/NodeStatus-Docker)也可以部署在 PaaS 平台上。 35 | 36 | ## 部署方式 37 | 38 | **请勿使用本仓库直接部署** 39 | 40 | 1. [设置Cloudflare Workers KV服务](https://github.com/wy580477/PaaS-Related/blob/main/SET_CLOUDFLARE_KV_chs.md) 41 | 42 | **KV服务用于存储配置文件。部分功能升级需要手动更新配置文件。** 43 | **可以通过删除Cloudflare KV数据以重置配置文件。 [图示](https://user-images.githubusercontent.com/98247050/174501970-d22eac74-f2f1-496c-a100-8188832e4da7.png)** 44 | 45 | 2. 点击本仓库右上角Fork,再点击Create Fork。 46 | 3. 在Fork出来的仓库页面上点击Setting,勾选Template repository。 47 | 4. 然后点击Code返回之前的页面,点Setting下面新出现的按钮Use this template,起个随机名字创建新库。 48 | 5. 比如你的Github用户名是bobby,新库名称是green。浏览器登陆heroku后,访问 即可部署。 49 | 50 | ## 变量设置 51 | 52 | 对部署时需设定的变量做如下说明。 53 | | 变量 | 说明 | 54 | | :--- | :--- | 55 | | `GLOBAL_USER` | 用户名,适用于除qBittorrent外所有需要输入用户名的Web服务 | 56 | | `GLOBAL_PASSWORD` | 务必修改为强密码,同样适用于除qBittorrent外所有需要输入密码的Web服务,同时也是Aria2 RPC密钥。 | 57 | | `GLOBAL_LANGUAGE` | 设置导航页、qBittorrent和Filebrowser界面语言,chs为中文 | 58 | | `GLOBAL_PORTAL_PATH` | 导航页路径和所有Web服务的基础URL,务必设置为不常见路径。不能为“/"和空值,结尾不能加“/"。示例:/mypath | 59 | | `TZ` | 可选,时区,Asia/Shanghai为中国时区 | 60 | | `CLOUDFLARE_WORKERS_HOST` | Cloudflare Workers 服务域名 | 61 | | `CLOUDFLARE_WORKERS_KEY` | Cloudflare Workers 服务密钥 | 62 | | `NodeStatus_DSN` | 可选,NodeStatus 探针服务端连接信息,保持默认空值为禁用。示例:wss://username:password@status.mydomain.com | 63 | 64 | ## 初次使用 65 | 66 | 1. 比如你的heroku域名是bobby.herokuapp.com,导航页路径是/portal,访问bobby.herokuapp.com/portal 即可到达导航页。 67 | 2. 点击AriaNg,这时会弹出认证失败警告,按下图把之前部署时设置的密码填入RPC密钥即可。 68 | 69 | 3. 点击并登陆Filbrowser,在 log/qBittorrent/current 文件中获得 qBit 临时密码,输入默认用户名 admin 和临时密码登陆。点击qBittorrent或者VueTorrent,输入默认用户名admin和临时密码登陆。然后更改用户名和密码,务必设置为强密码。 70 | 71 | 如果qBittorrent无法使用默认账户密码登陆,通过Filebrowser删除config/qBittorrent/config/qBittorrent.conf文件,然后通过ttyd执行下面命令: 72 | 73 | ``` 74 | sv restart 1 75 | ``` 76 | 4. 通过Filebrowse将rclone.conf文件上传到config目录,可以通过编辑script.conf文件更改Rclone自动上传设置。 77 | 5. yt-dlp和gallery-dl下载工具可以通过ttyd在网页终端执行。 78 | 内置快捷指令: 79 | dlpr:使用yt-dlp下载视频到videos文件夹下,下载完成后发送任务到rclone。 80 | gdlr:使用gallery-dl下载文件到gallery_dl_downloads文件夹下,下载完成后发送任务到rclone。 81 | 6. 如果升级版本后在script.conf文件中没有找到相关新增功能设置,参考最新版 [script.conf](https://github.com/wy580477/Leech-AIO-APP-EX/blob/main/content/script.conf) 文件,自行添加缺失的设置选项。 82 | 83 | 84 | ## 更多用法和注意事项 85 | 86 | 1. Telegram通知功能,需要在Telegram内与@BotFather对话注册bot。然后获取自己账户的ChatID或者bot加入的频道ChatID。具体详细步骤请Google。 87 | 88 | 然后编辑config/script.conf文件,将botid:token和ChatID填入对应选项,通知功能即生效。 89 | 2. pyLoad已知Bug: 90 | - 解压后不能删除原文件,解决方法:Settings--Plugins--ExtractArchive,将"Move to trash instead delete"项设置为off。 91 | 3. Heroku部署后,将下列内容添加到rclone.conf文件,可以将Heroku本地存储作为Rclone的远程存储,便于在Rclone WebUI上手动上传。 92 | 93 | ``` 94 | [local] 95 | type = alias 96 | remote = /mnt/data 97 | ``` 98 | 99 | 4. 对于不支持qBittorrent自定义路径的应用, 部署前在content目录下的Caddyfile文件中找到下列内容,去除每行开头的注释符号“#”: 100 | 101 | ``` 102 | handle /api* { 103 | reverse_proxy * localhost:61804 104 | } 105 | ``` 106 | 107 | 5. Aria2 JSON-RPC 路径为: \$\{GLOBAL_PORTAL_PATH\}/jsonrpc 108 | Aria2 XML-RPC 路径为: \$\{GLOBAL_PORTAL_PATH\}/rpc 109 | 110 | -------------------------------------------------------------------------------- /heroku.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | web: Dockerfile 4 | -------------------------------------------------------------------------------- /screenshots/branch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/screenshots/branch.png -------------------------------------------------------------------------------- /screenshots/colab.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/screenshots/colab.jpeg -------------------------------------------------------------------------------- /screenshots/colab_chs.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/screenshots/colab_chs.jpeg -------------------------------------------------------------------------------- /screenshots/deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/screenshots/deploy.png -------------------------------------------------------------------------------- /screenshots/docker.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/screenshots/docker.jpeg -------------------------------------------------------------------------------- /screenshots/docker_chs.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/screenshots/docker_chs.jpeg -------------------------------------------------------------------------------- /screenshots/doprax.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/screenshots/doprax.jpeg -------------------------------------------------------------------------------- /screenshots/doprax_chs.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/screenshots/doprax_chs.jpeg -------------------------------------------------------------------------------- /screenshots/heroku.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/screenshots/heroku.jpeg -------------------------------------------------------------------------------- /screenshots/heroku_chs.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/screenshots/heroku_chs.jpeg -------------------------------------------------------------------------------- /screenshots/volume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Leech-AIO-APP-EX/1213be598b533a23c95ff777c5e85fd7afb82923/screenshots/volume.png --------------------------------------------------------------------------------