Code Monkey home page Code Monkey logo

downloadbot's Introduction

Hi there, I'm Gaowan Liang! 👋

Hi, I'm Gaowan Liang, a passionate self-taught full stack developer from China.

  • 🔭 I’m currently a student
  • 🌱 I’m currently learning Golang

Languages and Tools:

ℹ️ Some Statistics Fun

Github Stats gaowanliang gaowanliang
Github Streaks

gaowanliang

downloadbot's People

Contributors

dulljz avatar gaowanliang avatar reaitten avatar user1121114685 avatar wangedward avatar xmjwit 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

downloadbot's Issues

机器人上传OneDrive报错

./DownloadBot
2022/03/16 15:31:27 Configuration information loading completed!
2022/03/16 15:31:27 Connecting to ws://127.0.0.1:5800/jsonrpc
2022/03/16 15:31:27 Aria2 websocket connection established! Aria2 version 1.36.0
2022/03/16 15:31:29 Login to authorized account pigkie_bot
2022/03/16 15:32:43 [{b24daa85dc263312}] Download started!
2022/03/16 15:32:45 [{b24daa85dc263312}] Download completed!
2022/03/16 15:33:11 Failed to Restore :EOF
panic: Failed to Restore :EOF

goroutine 97 [running]:
log.Panicf(0x661497, 0x15, 0x40002c7f38, 0x1, 0x1)
D:/program_app/go/src/log/log.go:358 +0xa8
onedrive.restore.func1(0x40005086d0, 0x4000266240, 0x6831e8, 0x6831f0, 0x40003ec140, 0x3b, 0x4000262020, 0x40004de5a0, 0x30, 0x4000262038, ...)
D:/program_data/go/DownloadBot/vendor/onedrive/onedrive.go:104 +0x1f0
created by onedrive.restore
D:/program_data/go/DownloadBot/vendor/onedrive/onedrive.go:94 +0x174

TG显示:
********, [2022/3/16 15:32]
[{b24daa85dc263312}] Download started!

[{DownloadBot_0.0.5_freebsd_arm64.tar.gz}] Download completed!

File: downloads/DownloadBot_0.0.5_Linux_arm64.tar.gz Start upload to OneDrive
Accounts:********
File less than 4MB, go to small file channel, uploading in progress

File: downloads/DownloadBot_0.0.5_freebsd_arm64.tar.gz Start upload to OneDrive
Accounts:********
File less than 4MB, go to small file channel, uploading in progress

运行./DownloadBot时报错

2021/11/30 21:38:27 dial tcp 127.0.0.1:6800: connect: connection refused
panic: dial tcp 127.0.0.1:6800: connect: connection refused

goroutine 1 [running]:
log.Panic(0xc00069fec0, 0x1, 0x1)
/usr/local/go/src/log/log.go:354 +0xae
main.dropErr(...)
/tmp/Down/DownloadBot/main.go:14
main.aria2Load()
/tmp/Down/DownloadBot/Aria2.go:66 +0x129
main.main()
/tmp/Down/DownloadBot/main.go:32 +0x4d

一次启动就只能下一个磁力

一次启动就只能下一个磁力
再添加磁力就自动暂停,但是又不出现文件选择框,然后就卡死了,其他命令也失效了
image

how to deply?

Can you add little more details regarding how to deploy this bot?

设置的下载目录不起作用

这是我的config.json
{
"aria2-server": "ws://127.0.0.1:6800/jsonrpc",
"aria2-key": "xxx",
"bot-key": "123:xxx",
"user-id": "123",
"max-index": 10,
"sign": "Main Aria2",
"language": "zh-CN",
"downloadFolder": "/root/Download",
"moveFolder":"/root/OneDrive"
}
但是文件并没有下载到/root/Download下,而是下载到了/usr/local/caddy/www/aria2/Download/下

多用户机器人使用

希望可以增加多用户使用

  • config.json user-id 允许多个用户
  • config.json group-id 允许群组使用

上传重复的问题

情况描述

对于 G Drive, 多次上传将产生多个文件夹
对于 G Drive, 多次上传将产生多个文件夹



对于 onedrive,多次上传将产生带后缀的文件(虽然在同文件夹中),


并且onedrive无法上传大文件

tg 聊天记录

...There was a connection problem when uploading downloads/100MB.bin. Retrying. It's the 9 times retrying

DownloadFolder upload to OneDrive complete

在输出上述内容后,程序报错退出

2021/05/24 19:06:20 Failed to Restore :The Content-Range header length does not match the provided number of bytes.
panic: Failed to Restore :The Content-Range header length does not match the provided number of bytes.

goroutine 70 [running]:
log.Panicf(0xaef62c, 0x15, 0xc0001e3f40, 0x1, 0x1)
        D:/program_app/go/src/log/log.go:358 +0xc0
onedrive.restore.func1(0xc000548670, 0xc00019bc20, 0xb114b8, 0xb114c0, 0xc0004c3620, 0x29, 0xc0000b2288, 0xc00051be00, 0x13, 0xc0000b22b8, ...)
        D:/program_data/go/DownloadBot/vendor/onedrive/onedrive.go:104 +0x299
created by onedrive.restore
        D:/program_data/go/DownloadBot/vendor/onedrive/onedrive.go:94 +0x207

希望可以解答下以下几个问题

希望可以指定配置文件路径,这样可以用 systemctl 控制后台运行,或者现在用什么保证后台运行,screen?

使用多台服务器连接同一个机器人时,会报错,那么一台服务器还是要一个机器人吗?
2021/04/02 23:42:14 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
2021/04/02 23:42:14 Failed to get updates, retrying in 3 seconds...

Help!

Not a issue
Any docs or
support to deploy on online platforms like heroku, vercel, others ❤️

从源码自行编译的版本在tg中点击按钮报错

运行起来之后在tg中点击“正在下载”按钮,无反应
image

回到终端中查看发现以下报错:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x9124d6]

goroutine 49 [running]:
main.GetDiskPercent(0x4040d90b2164c3c0)
        /root/DownloadBot/utils.go:590 +0x56
main.formatTellSomething(0xc001306000, 0xfa, 0x13c, 0x0, 0x0, 0xfa, 0x13c)
        /root/DownloadBot/Aria2.go:186 +0x13e5
main.activeRefresh.func1(0x0, 0x6018aa59, 0xc00035b4a0, 0xc000076fa0, 0xc0000b69a0)
        /root/DownloadBot/Telegram.go:673 +0x94
main.activeRefresh(0x4, 0xc00035b4a0, 0xc000076fa0, 0x3e4b)
        /root/DownloadBot/Telegram.go:728 +0x14d
created by main.tgBot
        /root/DownloadBot/Telegram.go:899 +0x32ca

image

点击“正在等待”按钮和“已完成”按钮也没反应
image
点击“正在等待”按钮时的报错:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x9124d6]

goroutine 30 [running]:
main.GetDiskPercent(0x4059000000000000)
        /root/DownloadBot/utils.go:590 +0x56
main.formatTellSomething(0xc0000c3000, 0xa, 0xd, 0x0, 0x0, 0x0, 0xc0000c3000)
        /root/DownloadBot/Aria2.go:186 +0x13e5
main.tgBot(0xc00002a300, 0x2e, 0xc0000294a0)
        /root/DownloadBot/Telegram.go:901 +0x312a
created by main.main
        /root/DownloadBot/main.go:34 +0x9f

点击“已完成”按钮时的报错:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x9124d6]

goroutine 30 [running]:
main.GetDiskPercent(0x4059000000000000)
        /root/DownloadBot/utils.go:590 +0x56
main.formatTellSomething(0xc0000c3000, 0xa, 0xd, 0x0, 0x0, 0x0, 0xc0000c3000)
        /root/DownloadBot/Aria2.go:186 +0x13e5
main.tgBot(0xc00002a300, 0x2e, 0xc000029490)
        /root/DownloadBot/Telegram.go:908 +0x2ffd
created by main.main
        /root/DownloadBot/main.go:34 +0x9f

image

使用release中的版本点击“正在下载”也会报错:

2022/02/23 09:25:02 context deadline exceeded
panic: context deadline exceeded

goroutine 48 [running]:
log.Panic(0xc00012cdd8, 0x1, 0x1)
        D:/program_app/go/src/log/log.go:351 +0xac
main.dropErr(...)
        D:/program_data/go/DownloadBot/main.go:14
main.formatTellSomething(0x0, 0x0, 0x0, 0xbc6a40, 0x102fee0, 0x0, 0x0)
        D:/program_data/go/DownloadBot/Aria2.go:77 +0x8b
main.activeRefresh.func1(0x0, 0x6018aa59, 0xc00048a640, 0xc000066460, 0x0)
        D:/program_data/go/DownloadBot/Telegram.go:541 +0x94
main.activeRefresh(0x18, 0xc00048a640, 0xc000066460, 0xd857)
        D:/program_data/go/DownloadBot/Telegram.go:596 +0x159
created by main.tgBot
        D:/program_data/go/DownloadBot/Telegram.go:767 +0x3207

image

但是点击“等待中”和“已停止”按钮都不会报错,不知道什么原因,源码我是自己git clone源码之后编译的版本,系统是centos7.9,另外能否增加忽略证书错误的功能,我aria2为了适应启用了https的ariang,开启了https,然后在机器人的配置文件中使用“wss://127.0.0.1:6800/jsonrpc"连接会报错”cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs
image

下载重复的任务会自动停止

下载好的文件已经删掉了,但还是会停止。
从aria2ng中把已完成任务全删了,才可以继续下载。
这里希望能够自定义

无法移动至挂载的网盘?

下载时一段时间后就停止下载,查看挂载目录也没有文件。vps是justhost小盘鸡,常常导致磁盘满盈...

[feature request]请求添加Telegram文件、视频自动转直链下载功能

之前用的是tele-aria2,发现这个可以选择需要下载的文件,更好用。
希望能够增加Tg的直链下载功能,就是转发到bot的视频和文件可以自动提取直链发送到aria进行下载。目前,按照一个repo部署了直链提取功能,然后想要发送到aria需要:
1、转发文件到另外一个bot提取直链
2、将直链复制到downloadbot发送到aria下载
步骤较为繁琐。如果downloadbot能够内置该功能就更好了。
附:用于提取直链的repo

运行错误

`root@server:~/downloadbot# sudo ./DownloadBot
2021/04/04 17:17:50 12346
2021/04/04 17:17:50 stat : no such file or directory
panic: stat : no such file or directory

goroutine 1 [running]:
log.Panic(0xc000039e80, 0x1, 0x1)
D:/program_app/go/src/log/log.go:351 +0xac
main.dropErr(...)
D:/program_data/go/DownloadBot/main.go:14
main.locLan(0xc00001471a, 0x5)
D:/program_data/go/DownloadBot/utils.go:69 +0xba
main.init.0()
D:/program_data/go/DownloadBot/main.go:26 +0x181`
不知道是不是我配置的问题,一旦运行就会报错

config.json

Can you tell the path where I should edit the variables cause I cannot find the files in the repository. Hoping you would help soon

BUG: Google drive 无法成功创建配置

创建google drive上传配置时,程序要求输入跳转网址所得代码
输入进tgbot后会提示为 未知的下载链接,请重新检查
因此无法成功授权google drive

希望能修复这个bug,感谢开发者

遇到的一个问题,ssh要一直连

ssh连接,并且输入一次./DownloadBot,之后才会有消息提醒,一旦退出ssh,再点“正在下载”,点击按钮机器人没有任何提示,直到再次ssh连接,然后执行./DownloadBot才正常,退出又没有了,如此反复,请问大佬知道怎么解决?

授权失败

国际版团队/组织盘提示要管理员同意。但管理员一般很难联系。
能否降低要求,账户授权即可

文件名称带有下划线会触发bug导致程序停止运行

报错日志

{"ChatID":*********,"ChannelUsername":"","ReplyToMessageID":0,"ReplyMarkup":{"inline_keyboard":[[{"text":"1","callback_data":"f9b7e1d8b6b60b9a:1"}]]},"DisableNotification":false,"Text":"停止哪一个?\n1: [电影天堂www.dytt89.com]发财日记-2021_HD国语中字.mp4","ParseMode":"Markdown","DisableWebPagePreview":false}

2021/02/14 17:22:00 Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 65

panic: Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 65

https://community.home-assistant.io/t/telegram-bot-error-sending-messags-with/43889

请问这个功能实现了吗?

对于大bt文件进行根据硬盘大小分段下载,每次都下载一部分,然后上传网盘,删除再下载其他部分,直到下载完所有文件

Feature requests

1.Upload to telegram after torrent finishes.if the files is larger than 2gb,it must split and then upload to tg by parts

2.Need ZIP option to compress downloaded files before uploading to cloud (most wanted)

  1. Need RCLONE support too,then we can add gdrive,onedrive..everything in one simple setup

4.if you can add ytdl-org code support too..for downloading videos

消息过长导致的服务端错误

运行环境

Debian 10, 使用 DownloadBot_0.0.5_Linux_x86_64.tar.gz 安装

报错内容

2021/05/24 18:29:50 [{86e3eeffd4b075f6}] Download started!
2021/05/24 18:29:51 [{86e3eeffd4b075f6}] Download paused!
2021/05/24 18:29:51 Bad Request: message is too long
panic: Bad Request: message is too long

goroutine 14 [running]:
log.Panic(0xc00029b730, 0x1, 0x1)
        D:/program_app/go/src/log/log.go:351 +0xac
main.dropErr(...)
        D:/program_data/go/DownloadBot/main.go:14
main.TMSelectMessage(0xc000155c20)
        D:/program_data/go/DownloadBot/Telegram.go:169 +0x1a0d
created by main.tgBot
        D:/program_data/go/DownloadBot/Telegram.go:707 +0x85d

可能原因

根据TG官方文档, API 每条消息只能支持4096字节,或许可使用分段方式发送?

运行./DownloadBot时报错

2021/07/23 01:51:31 strconv.ParseInt: parsing "": invalid syntax
panic: strconv.ParseInt: parsing "": invalid syntax

goroutine 37 [running]:
log.Panic(0xc00025f3a8, 0x1, 0x1)
D:/program_app/go/src/log/log.go:351 +0xac
main.dropErr(...)
D:/program_data/go/DownloadBot/main.go:14
main.toInt64(0x0, 0x0, 0x4)
D:/program_data/go/DownloadBot/utils.go:514 +0x9d
main.TMSelectMessage(0xc000212c80)
D:/program_data/go/DownloadBot/Telegram.go:62 +0x4e
created by main.tgBot
D:/program_data/go/DownloadBot/Telegram.go:707 +0x85d

Help with setting up bot

Tutorial have literally 3 steps. I just found aria2 so tutorial covering setting it up (can't find good one online) would be great. To me this tutorial sems like it's telling you to download, configurate and run and that's it but how I can do that? Btw it's possible to set it up on azure?

运行后报错 unexpected EOF

2021/12/09 00:07:16 Configuration information loading completed!
2021/12/09 00:07:16 unexpected EOF
panic: unexpected EOF

goroutine 1 [running]:
log.Panic(0xc0005efec0, 0x1, 0x1)
/Down/go/src/log/log.go:354 +0xae
main.dropErr(...)
/Down/DownloadBot/main.go:14
main.aria2Load()
/Down/DownloadBot/Aria2.go:66 +0x129
main.main()
/Down/DownloadBot/main.go:32 +0x4d

上傳Google drive報錯

λ go run drive.go struct.go Aria2.go main.go Telegram.go utils.go
2021/02/19 21:45:17 配置信息加载完成!
2021/02/19 21:45:17 与 ws://127.0.0.1:6800/jsonrpc 连接中
2021/02/19 21:45:17 Aria2 websocket连接已建立!Aria2版本:1.35.0
2021/02/19 21:45:17 已登入授权账户 xxxxxxx_DownloadBot
2021/02/19 21:45:34 Aria2Data
2021/02/19 21:45:34 Unable to create folder: Post "https://www.googleapis.com/drive/v3/files?alt=json&prettyPrint=false": oauth2: token expired and refresh token is not set
panic: Unable to create folder: Post "https://www.googleapis.com/drive/v3/files?alt=json&prettyPrint=false": oauth2: token expired and refresh token is not set

goroutine 50 [running]:
log.Panicf(0xa48e7b, 0x1b, 0xc000435dc8, 0x1, 0x1)
C:/Program Files/Go/src/log/log.go:361 +0xc7
googledrive.GetAllFile(0xc00001ae61, 0x9, 0x0, 0x0, 0x0, 0xc000272080, 0x602fc0fe, 0xc0004084c8, 0x18, 0xc0004ae108, ...)
C:/DownloadBot/vendor/googledrive/gdUpload.go:124 +0x39e
googledrive.Upload(0xc0005383c0, 0x30, 0xc00001ae61, 0x9, 0xa67278, 0xa67280)
C:/DownloadBot/vendor/googledrive/gdUpload.go:240 +0x46e
created by main.uploadDFToGoogleDrive
C:/DownloadBot/drive.go:61 +0x14b
exit status 2

還有config.json的downloadFolder設置不了,它會下載到Aria2設置/默認的位置。留空的話啓動會報錯。

image

硬盘使用占比错误,无数据

image

如图,使用了目前最新的源码编译运行的,系统是Linux hostname #30~18.04.1-Ubuntu SMP Tue Oct 20 11:09:25 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

编译过程是按照项目说明文档来的

panic: stat : no such file or directory

系统环境 Debian 10 x64
在配置完成 config.json 文件后,运行 DownloadBot 二进制文件时报错

报错信息如下
2021/01/24 13:21:09 stat : no such file or directory
panic: stat : no such file or directory
goroutine 1 [running]:
log.Panic(0xc000093e80, 0x1, 0x1)
        D:/program_app/go/src/log/log.go:351 +0xac
main.dropErr(...)
        D:/program_data/go/DownloadBot/main.go:14
main.locLan(0xc0000a867a, 0x5)
        D:/program_data/go/DownloadBot/utils.go:69 +0xba
main.init.0()
        D:/program_data/go/DownloadBot/main.go:26 +0x181

运行错误

当我配置好的config.json后,运行./DownloadBot,提示这些:

root@i-e5e2f29565ddd8a1:~# ./DownloadBot 
2020/12/30 06:56:40 12346
置信氥 载實06:56:40 

我没法判断这是什么错误,我应该怎么办?另外,在提示这些之后,我的tg机器人仍然是没有任何反应的。

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.