GithubHelp home page GithubHelp logo

aria2bot's Introduction

aria2bot's People

Contributors

jw-star avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aria2bot's Issues

【请求功能】 自动上传aria2下载的文件至群组

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

文件名中含有符号时可能识别任务失败

Screenshot_2023-07-02-11-12-40-299_org telegram messenger web-edit
如上图,我直接在机器人这发送链接时,文件名是222~1.mp4,但是识别会直接识别成222,然后导致下载失败,下面是我在aria2直接手动添加,是没有问题的,希望大佬解决一下这个问题!感谢大佬的付出!

请问不知道错在什么地方?JSON_RPC_URL:这个地址怎么填?填路由器转发的公网ip?还是?

/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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.