常用软件:
- 文本编辑器 notepad3 : https://www.rizonesoft.com/downloads/notepad3/
- IntelliJ
- redis客户端 https://github.com/qishibo/AnotherRedisDesktopManager
aria2 telegram bot
License: MIT License
常用软件:
有一个项目大佬可以参考一下,他这个项目编程语言也是python,实现了实时任务进度的显示,理论上原理就是不断查询aria2的状态,然后不断修改机器人返回的信息。
报错信息如下图:
防止因bot名称泄露被人恶意使用。
如题
能否支持 telegram 转载的图片和视频 ?
Docker Aria2能够正常使用,但是aria2bot使用它就会报错,
日志
aria2_bot | WebSocket连接成功
aria2_bot | 2024-04-23 19:21:26 debian-s-1vcpu-1gb-sfo3-01 bot[1] INFO Test_240423_Bot bot启动成功...
aria2_bot | 2024-04-23 19:23:25 debian-s-1vcpu-1gb-sfo3-01 bot[1] INFO 2024-04-23 19:23:25.219551:⬇️正在下载
aria2_bot | 2024-04-23 19:23:26 debian-s-1vcpu-1gb-sfo3-01 telethon.client.updates[1] ERROR Unhandled exception on send_welcome
aria2_bot | Traceback (most recent call last):
aria2_bot | File "/root/.local/lib/python3.11/site-packages/telethon/client/updates.py", line 570, in _dispatch_update
aria2_bot | await callback(event)
aria2_bot | File "/app/app.py", line 81, in send_welcome
aria2_bot | await downloading(event)
aria2_bot | File "/app/app.py", line 203, in downloading
aria2_bot | tasks = await client.tell_active()
aria2_bot | ^^^^^^^^^^^^^^^^^^^^^^^^^^
aria2_bot | File "/app/async_aria2_client.py", line 267, in tell_active
aria2_bot | return data['result']
aria2_bot | ~~~~^^^^^^^^^^
aria2_bot | KeyError: 'result'
aria2 |
aria2 | 04/23 19:24:28 [NOTICE] Serialized session to '/config/aria2.session' successfully.
aria2_bot | rec message:{"jsonrpc":"2.0","method":"aria2.onDownloadStart","params":[{"gid":"875ebec621f5910b"}]}
aria2_bot | ===========下载 开始 任务id:875ebec621f5910b
aria2 |
aria2 | 04/23 19:24:31 [NOTICE] Download complete: /downloads/__down
aria2_bot | 2024-04-23 19:24:31 debian-s-1vcpu-1gb-sfo3-01 asyncio[1] ERROR Task exception was never retrieved
aria2_bot | future: <Task finished name='Task-23' coro=<AsyncAria2Client.listen() done, defined at /app/async_aria2_client.py:42> exception=KeyError('result')>
aria2_bot | Traceback (most recent call last):
aria2_bot | File "/app/async_aria2_client.py", line 55, in listen
aria2_bot | await self.on_download_start(result)
aria2_bot | File "/app/async_aria2_client.py", line 128, in on_download_start
aria2_bot | tellStatus = await self.tell_status(gid)
aria2_bot | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
aria2_bot | File "/app/async_aria2_client.py", line 110, in tell_status
aria2_bot | return data['result']
aria2_bot | ~~~~^^^^^^^^^^
aria2_bot | KeyError: 'result'
aria2 | 04/23 19:24:31 [INFO] .aria2 file does not exist.
aria2 | 04/23 19:24:31 [INFO] General download task, skipped delete .torrent file.
aria2 | 04/23 19:24:31 [INFO] Deleting empty directory ...
aria2 |
aria2 | 04/23 19:24:32 [NOTICE] Serialized session to '/config/aria2.session' successfully.
docker compose
version: "3.7"
services:
aria2bot:
image: jwstar/aria2bot
network_mode: host
container_name: aria2_bot
restart: always
volumes:
- ./db:/app/db
- /root/docker/aria2-downloads:/downloads
- /qqqq:/qqqq
build: .
environment:
TZ: Asia/Shanghai
aria2:
image: p3terx/aria2-pro
container_name: aria2
restart: unless-stopped
ports:
- "6800:6800"
- "6888:6888"
- "6888:6888/udp"
environment:
- PUID=$UID
- PGID=$GID
- UMASK_SET=022
- RPC_SECRET=xxx
- RPC_PORT=6800
- LISTEN_PORT=6888
volumes:
- /root/docker/aria2-config:/config
- /root/docker/aria2-downloads:/downloads
- /qqqq:/qqqq
/app/bot.py:392: DeprecationWarning: There is no current event loop
loop = asyncio.get_event_loop()
Task exception was never retrieved
future: <Task finished name='Task-17' coro=<main() done, defined at /app/bot.py:43> exception=Aria2rpcException('Server disconnected')>
Traceback (most recent call last):
File "/root/.local/lib/python3.10/site-packages/aioaria2/client.py", line 804, in new
self.client_session = await self._client_session.ws_connect(self.url, **self.kw)
File "/root/.local/lib/python3.10/site-packages/aiohttp/client.py", line 779, in _ws_connect
resp = await self.request(
File "/root/.local/lib/python3.10/site-packages/aiohttp/client.py", line 560, in _request
await resp.start(conn)
File "/root/.local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 899, in start
message, payload = await protocol.read() # type: ignore[union-attr]
File "/root/.local/lib/python3.10/site-packages/aiohttp/streams.py", line 616, in read
await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/bot.py", line 44, in main
await ar.init()
File "/app/aria2client.py", line 26, in init
self.client: Aria2WebsocketClient = await Aria2WebsocketClient.new(self.rpc_url, token=self.rpc_token,
File "/root/.local/lib/python3.10/site-packages/aioaria2/client.py", line 809, in new
raise Aria2rpcException(str(err), connection_error=("Cannot connect" in str(err))) from err
aioaria2.exceptions.Aria2rpcException: Aria2rpcException: Server disconnected
麻烦大佬
如题
如下图所示:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.