Skip to content

Commit

Permalink
v2.0.9
Browse files Browse the repository at this point in the history
此版本后支持自动更新,Python文件的变动只需重启即可更新,其它硬性更新才会通过docker更新版本

修复aria2面板添加的任务与conf文件的配置冲突导致本地文件被删除 666wcy#18 666wcy#16

修复odprivate命令失效(与后续指令冲突导致失效) 666wcy#17

修复默认面板账号密码为默认,存在安全隐患,修改为账号:`admin`,密码:你设置的`Aria2_secret`的值
  • Loading branch information
666wcy committed Sep 10, 2021
1 parent 930910f commit cb6064d
Show file tree
Hide file tree
Showing 6 changed files with 316 additions and 238 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
<!--
* @Date: 2021-06-05 12:04:51
* @LastEditors: Ben
* @LastEditTime: 2021-09-06 18:22:30
* @LastEditTime: 2021-09-10 17:22:29
-->

[![GitHub Stars](https://img.shields.io/github/stars/666wcy/ARPT-Bot.svg?color=inactived&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-qbittorrent) [![Docker Pulls](https://img.shields.io/docker/pulls/benchao/arpt.svg?color=inactived&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/repository/docker/benchao/arpt) [![GitHub Release](https://img.shields.io/docker/v/benchao/arpt?color=inactived&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=最新版本&logo=docker)](https://github.com/linuxserver/docker-qbittorrent/releases)

# 更新说明

v2.0.9

此版本后支持自动更新,Python文件的变动只需重启即可更新,其它硬性更新才会通过docker更新版本

修复aria2面板添加的任务与conf文件的配置冲突导致本地文件被删除 [#18](https://github.com/666wcy/ARPT-Bot/issues/18)[#16](https://github.com/666wcy/ARPT-Bot/issues/16)

修复odprivate命令失效(与后续指令冲突导致失效) [#17](https://github.com/666wcy/ARPT-Bot/issues/17)

修复默认面板账号密码为默认,存在安全隐患,修改为账号:`admin`,密码:你设置的`Aria2_secret`的值

<details>
<summary>历史记录</summary>

v2.0.8

修复rclone剩余时间显示问题
Expand All @@ -18,8 +31,6 @@ v2.0.8

同步原作者[更新](https://github.com/gaowanliang/OneDriveShareLinkPushAria2/commit/a8dd447040ccd0aca89a3e2680a871200ca8c446),修复od分享链接文件数直到30的问题,感谢原作者

<details>
<summary>历史记录</summary>


v2.0.7
Expand Down
57 changes: 56 additions & 1 deletion bot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,67 @@
from pyrogram import Client
import base64
import os
import requests
import json


Aria2_host="http://127.0.0.1"
Aria2_port="8080"
Aria2_secret=os.environ.get('Aria2_secret')

def change_password():


login_url = "http://127.0.0.1:9184/api/login"

login_data = {"username": "admin", "password": "admin", "recaptcha": ""}

html = requests.post(url=login_url, json=login_data)
if html.status_code!=200:
print(f"登录失败:{html.text}")
return

change_url = "http://127.0.0.1:9184/api/users/1"

print(html.text)
headers = {}
headers['Cookie'] = f"auth={html.text}"

zh_data = {
"data": {
"hideDotfiles": False,
"id": 1,
"locale": "zh-cn",
"singleClick": False
},
"what": "user",
"which": [
"locale",
"hideDotfiles",
"singleClick"
]
}

change_result = requests.put(url=change_url, json=zh_data, headers=headers)

if change_result.status_code==403:
headers['X-Auth']=html.text
change_result = requests.put(url=change_url, json=zh_data, headers=headers)

print(change_result.text)

change_data = {"data": {"id": 1, "password": str(Aria2_secret)}, "what": "user", "which": ["password"]}

change_result = requests.put(url=change_url, json=change_data, headers=headers)

if change_result.status_code == 403:
headers['X-Auth'] = html.text
change_result = requests.put(url=change_url, json=change_data, headers=headers)

print(change_result.text)

change_password()

try:
App_title=os.environ.get('Title')
if App_title ==None:
Expand All @@ -25,7 +79,7 @@
Rclone_share=False
except:
Rclone_share=False

print(f"是否rclone_share:{Rclone_share}")

try:
Expand Down Expand Up @@ -65,6 +119,7 @@
ari2_ng_url=f"https://{App_title}.herokuapp.com/ng/#!/settings/rpc/set/https/{App_title}.herokuapp.com/443/jsonrpc/{base64_message}"

client.send_message(chat_id=int(Telegram_user_id), text=f"Bot上线!!!\nAria2NG快捷面板:{ari2_ng_url}")

Bot_info=client.get_me()

BOT_name=Bot_info.username
Expand Down
10 changes: 6 additions & 4 deletions bot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ async def help(client, message):
/nhentaisearch 搜索词 - 在nhentai中搜索本子,支持ZIP上传到网盘和发送到TG
********** 其它相关 **********
/downtgfile - 发送TG文件并上传至网盘
/
- 发送TG文件并上传至网盘
发送 /downtgfile 后按提示发送文件即可
Expand Down Expand Up @@ -410,7 +411,10 @@ def start_bot():
more_magnet,
filters=filters.text & filters.create(chexk_group) & filters.private
)

print(f"检查odprivate_download_handler -{App_title}-")
if App_title == "":
print("添加odprivate_download_handler")
client.add_handler(odprivate_download_handler, group=1)

client.add_handler(search_all_photo_handler, group=0)
client.add_handler(start_download_video_handler, group=0)
Expand Down Expand Up @@ -468,8 +472,6 @@ def start_bot():
client.add_handler(start_more_magnet_handler, group=1)


if App_title == "":
client.add_handler(odprivate_download_handler, group=1)



Expand Down
Loading

0 comments on commit cb6064d

Please sign in to comment.