ludoux / qbittorrent-torrents-exporter

qBittorrent 种子文件导出小工具 | Export torrent files from BT_backup and append "missing" trackers.
GNU General Public License v3.0
128 stars 1 forks source link

运行程序报错 #10

Closed LoneFireBlossom closed 1 year ago

LoneFireBlossom commented 1 year ago

使用目前最新版程序,运行如下:

PS D:\qb> D:\qb\qbittorrent-torrents-exporter.exe
github.com/ludoux/qbittorrent-torrents-exporter v0.3.1
qBittorrent host url(ex http://127.0.0.1:6363 ):http://****
qBittorrent username:****
qBittorrent password:****
panic: runtime error: index out of range [8] with length 0

goroutine 1 [running]:
main.getTrackerHost({0xc000278b40, 0x82})
        /github/workspace/main.go:82 +0x6b0
main.genMap({0xc000014160, 0x1a}, {0xc00000e110, 0xf}, {0xc000016078, 0x12})
        /github/workspace/main.go:170 +0x6fd
main.main()
        /github/workspace/main.go:573 +0x45e

使用 https://github.com/ludoux/qbittorrent-torrents-exporter/issues/4#issuecomment-1120123461 这里的debug程序,运行如下:

PS D:\qb> D:\qb\debug1.exe
github.com/ludoux/qbittorrent-torrents-exporter v0.2.1
New version found!
qBittorrent host url(ex http://127.0.0.1:6363 ):http://****
qBittorrent username:****
qBittorrent password:****
get torrents: 1~100

……(注:都显示finished)

get torrents: 101~200

……(注:都显示finished)

==** [DHT] **|** [PeX] **|** [LSD] **|https://tracker.*****.pt/announce.php?passkey=***==
err: matchs empty. trackers is ** [DHT] **|** [PeX] **|** [LSD] **|https://tracker.***********.pt/announce.php?passkey=******
panic: runtime error: index out of range [8] with length 0 

goroutine 1 [running]:
main.getTrackerHost({0xc0000b0070, 0x70})
        /home/luu/Documents/Git/qbittorrent-torrents-exporter/main.go:81 +0x7f0
main.genMap({0xc000010160, 0x1a}, {0xc00000a130, 0xf}, {0xc000012078, 0x12})
        /home/luu/Documents/Git/qbittorrent-torrents-exporter/main.go:170 +0x6da
main.main()
        /home/luu/Documents/Git/qbittorrent-torrents-exporter/main.go:569 +0x45e
LoneFireBlossom commented 1 year ago

使用-disableAnalize确实就行了,因为是4.3.9版本所以tracker也还在。 想确认一下,在最后问“是否要tracker分类”的时候,我需要分类,是随便输入任何什么东西只要不留空就可以吗?还是说必须输入""

LoneFireBlossom commented 1 year ago

另外还有一个问题=。= 我用intel Mac运行Linux的386版本打开就直接退出,是不能在Mac上运行么

image
ludoux commented 1 year ago

使用-disableAnalize确实就行了,因为是4.3.9版本所以tracker也还在。 想确认一下,在最后问“是否要tracker分类”的时候,我需要分类,是随便输入任何什么东西只要不留空就可以吗?还是说必须输入""

因为 disableAnalize 了,所以这个 tracker 分类也会正常工作 Edit: 也不会正常工作

另外还有一个问题=。= 我用intel Mac运行Linux的386版本打开就直接退出,是不能在Mac上运行么 image

Mac 上没有特别测试过… Edit:不过可以试一下linux x64版本看看

ludoux commented 1 year ago

这个报错好奇怪,请问你可以找到对应的任务么,方便在qB页面把tracker 那里截图(包括DHT等等)一下么?域名passkey可以打码。 以及那个tracker地址里有特殊符号好的么,谢谢。

LoneFireBlossom commented 1 year ago

根据tracker没法确定是哪一个种子呀,下图只列出一部分种子 passkey没有特殊符号,都是字母和数字

image

ludoux commented 1 year ago

那我可能要周末才能修,主要是我忘记了那个debug的代码了…sorry


From: LoneFireBlossom @.> Sent: Thursday, November 17, 2022 9:21:20 PM To: ludoux/qbittorrent-torrents-exporter @.> Cc: Lu Chang @.>; Comment @.> Subject: Re: [ludoux/qbittorrent-torrents-exporter] 运行程序报错 (Issue #10)

根据tracker没法确定是哪一个种子呀

[image]https://user-images.githubusercontent.com/50087596/202457379-7cd85cf6-3cd5-426b-9f2e-a0ec20d1a538.png

― Reply to this email directly, view it on GitHubhttps://github.com/ludoux/qbittorrent-torrents-exporter/issues/10#issuecomment-1318627393, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADGWKTEOOPEEYRWSLNBT7S3WIYWNBANCNFSM6AAAAAASDK7O6Y. You are receiving this because you commented.Message ID: @.***>

LoneFireBlossom commented 1 year ago

Mac 上没有特别测试过… Edit:不过可以试一下linux x64版本看看

是说qbittorrent-torrents-exporter-v0.3.1-linux-amd64这个吗?运行试了试也不行

ludoux commented 1 year ago

好吧🤣我争取这几天整整,上周末有事情,sorry


From: LoneFireBlossom @.> Sent: Tuesday, November 22, 2022 12:31:06 PM To: ludoux/qbittorrent-torrents-exporter @.> Cc: Lu Chang @.>; Comment @.> Subject: Re: [ludoux/qbittorrent-torrents-exporter] 运行程序报错 (Issue #10)

Mac 上没有特别测试过… Edit:不过可以试一下linux x64版本看看

是说qbittorrent-torrents-exporter-v0.3.1-linux-amd64这个吗?运行试了试也不行

— Reply to this email directly, view it on GitHubhttps://github.com/ludoux/qbittorrent-torrents-exporter/issues/10#issuecomment-1323036904, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADGWKTAWVZ7XWSBBBLLJRYDWJREAVANCNFSM6AAAAAASDK7O6Y. You are receiving this because you commented.Message ID: @.***>

ludoux commented 1 year ago

最新的 v0.3.3 https://github.com/ludoux/qbittorrent-torrents-exporter/commit/1052c4704b651a9b1b59596d8f977248e1ac2150 编译出的 qbittorrent-torrents-exporter-v0.3.3-darwin-amd64.tar.gz 应该可以在英特尔核心的 MacOS 上使用了。 也尝试修复了一下 那个 tracker 错误。假如试用后仍然出现问题,可以带 -debug 参数运行一下,然后把出错前的[Debug][Off]之间的Debug输出,脱敏后回复我么,谢谢

LoneFireBlossom commented 1 year ago

可以在我这边的Mac上运行了

(base) ➜  ~ /Users/lonefireblossom/Downloads/qbittorrent-torrents-exporter; exit
github.com/ludoux/qbittorrent-torrents-exporter v0.3.3
qBittorrent host url(ex http://127.0.0.1:6363 ):***
qBittorrent username:***
qBittorrent password:***
get torrents: 1~100
Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.
Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.
Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.
get torrents: 101~200
Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.
Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.
Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.
Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.
get torrents: 201~300
Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.
LoneFireBlossom commented 1 year ago

-disableAnalize参数运行了一下报了这个错误:

Error:  Game.of.Thrones.S08.2160p.UHD.BluRay.HEVC.Atmos.TrueHD.7.1-DiY@HDHome ( 92ed2f0******** ) Not Found in BT_backup
....
ErrorCount: 1. Please check the log above.

请问这串字符串是啥,我试了一下不是hash也不是磁力链接 不知道为什么BT_bakcup里面会没有

ludoux commented 1 year ago

设计上应该会是 hash…具体代码在这里。可能.torrent文件丢失了?我具体也不太清楚🤣 https://github.com/ludoux/qbittorrent-torrents-exporter/blob/1052c4704b651a9b1b59596d8f977248e1ac2150/main.go#L382

LoneFireBlossom commented 1 year ago

可以在我这边的Mac上运行了

(base) ➜  ~ /Users/lonefireblossom/Downloads/qbittorrent-torrents-exporter; exit
github.com/ludoux/qbittorrent-torrents-exporter v0.3.3
qBittorrent host url(ex http://127.0.0.1:6363 ):***
qBittorrent username:***
qBittorrent password:***
get torrents: 1~100
Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.

请问这里的warning不需要在意是么

ludoux commented 1 year ago

软件觉得同一个任务里面有多个tracker,且分析出来的域名不同,会选择最后一个域名作为后续分类的依据。这个可能存在于BT任务添加了很多公共Tracker,也可能存在于部分站点为了兼容性就是会有多个不同域名的tracker。当然也有可能是软件分析出了问题


From: LoneFireBlossom @.> Sent: Saturday, December 10, 2022 10:50:50 PM To: ludoux/qbittorrent-torrents-exporter @.> Cc: Lu Chang @.>; Comment @.> Subject: Re: [ludoux/qbittorrent-torrents-exporter] 运行程序报错 (Issue #10)

可以在我这边的Mac上运行了

(base) ➜ ~ /Users/lonefireblossom/Downloads/qbittorrent-torrents-exporter; exit

github.com/ludoux/qbittorrent-torrents-exporter v0.3.3

qBittorrent host url(ex http://127.0.0.1:6363 ):***

qBittorrent username:***

qBittorrent password:***

get torrents: 1~100

Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.

请问这里的warning不需要在意是么

— Reply to this email directly, view it on GitHubhttps://github.com/ludoux/qbittorrent-torrents-exporter/issues/10#issuecomment-1345280532, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADGWKTEKOPWXYOC4RLPLIN3WMSKEVANCNFSM6AAAAAASDK7O6Y. You are receiving this because you commented.Message ID: @.***>

LoneFireBlossom commented 1 year ago

今天又试了试Mac的版本,怎么又不行了= =

Error:  [EMTP-Raws]映画ドラえもん 新・のび太の宇宙開拓史[BDrip][x264_FLAC][Hi10P] ( *** ) Not Found in BT_backup
Error:  [VCB-Studio&KTXP] Akame ga Kill! [Hi10p_1080p] ( *** ) Not Found in BT_backup
Done.
ErrorCount: 4379. Please check the log above.

全都报这种错误

然后在Windows里搞倒是没问题

ludoux commented 1 year ago

同样的 qB 客户端和导出选项么?Mac 下操作的时候有没有按流程把 BT_backup 文件夹拷贝到和 exporter 在同一个目录下?假如操作没有问题的话我去看一下 Mac 是不是有什么兼容性问题要处理


From: LoneFireBlossom @.> Sent: Sunday, December 11, 2022 8:10:47 AM To: ludoux/qbittorrent-torrents-exporter @.> Cc: Lu Chang @.>; Comment @.> Subject: Re: [ludoux/qbittorrent-torrents-exporter] 运行程序报错 (Issue #10)

Reopened #10https://github.com/ludoux/qbittorrent-torrents-exporter/issues/10.

― Reply to this email directly, view it on GitHubhttps://github.com/ludoux/qbittorrent-torrents-exporter/issues/10#event-8006102096, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADGWKTDA3APJFF5NTE3MR73WMULYPANCNFSM6AAAAAASDK7O6Y. You are receiving this because you commented.Message ID: @.***>

LoneFireBlossom commented 1 year ago

是在同一个目录下, 同一个qb客户端的webui 先试了Mac不行,然后打开Mac上的Windows虚拟机(目录映射,没有移动文件)搞就成功了

image
ludoux commented 1 year ago

你好,我这边新推送了新的 0.3.4 版本,主要是细化了错误日志。 qbittorrent-torrents-exporter-v0.3.4-darwin-amd64.tar.gz 。由于我没有 Mac 开发环境,暂时只能先细化错误日志,看看具体报错信息再继续排查。

假如方便的话麻烦下载试一下,相比于 v0.3.3,同类情况下现在遇到问题会判断:

  1. 文件确实不存在,则输出 Not Found https://github.com/ludoux/qbittorrent-torrents-exporter/blob/249dc6421d30d6e8e8e25ca6084756bb015bab79/main.go#L382
  2. 权限问题,则输出 No permission https://github.com/ludoux/qbittorrent-torrents-exporter/blob/249dc6421d30d6e8e8e25ca6084756bb015bab79/main.go#L386
  3. 其他问题,输出错误信息 https://github.com/ludoux/qbittorrent-torrents-exporter/blob/249dc6421d30d6e8e8e25ca6084756bb015bab79/main.go#L390

此外,软件会针对每个任务,均判断 .torrent 文件和 .fastresume 文件(上述代码仅引用了 .torrent 文件报错,fastresume 文件类似)。但针对 qB 4.3.9 及以下版本,假如没有 .fastresume 文件,本工具仅会报错但是仍可以正常导出,4.4.0 以上则会报错且无法导出。

LoneFireBlossom commented 1 year ago

这次是还没运行完就报错

get torrents: 3401~3500
Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.
Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.
Warning: different trackerhost in the same torrent! Will use the last trackerhost for filter.
get torrents: 3501~3600
panic: runtime error: index out of range [8] with length 0

goroutine 1 [running]:
main.getTrackerHost({0x0, 0x0})
    /github/workspace/main.go:82 +0x7c5
main.genMap({0xc00001cf80, 0x1b}, {0xc00001f070, 0xf}, {0xc0000204f8, 0x12})
    /github/workspace/main.go:174 +0x6fd
main.main()
    /github/workspace/main.go:593 +0x45e
ludoux commented 1 year ago

你的任务数好多啊😂,感觉我这个小工具有点难胜任你的需求

这是两个问题。这个 panic 的问题还是那个 tracker host 分析出了问题,可能是 tracker url 有什么特别的我之前没有考虑到,可以带 -debug 参数运行一下,然后把出错前的[Debug]和[Off]之间的Debug输出,脱敏后回复我么,谢谢。

LoneFireBlossom commented 1 year ago

在Mac上用-debug,或者-debug-disableAnalize,都是全部报错:


==[Debug]==
Raw Trackers: https://daydream.*****/announce?secure=*****
Result: dmhy.best
==[Off]==
Error:  [2012 Movie][Doraemon Nobita to Kiseki no Shima Animal Adventure][BDRIP][1080P+SP] ( ****** .torrent) Not Found in BT_backup
Done.
ErrorCount: 4379. Please check the log above.

在Windows上两种方式都没问题
ludoux commented 1 year ago

针对 MacOS 上 BT_backup 文件夹相关问题:

初步怀疑是文件夹权限相关问题。最新 0.3.5 版本针对此问题,在每次运行的时候会第一时间检测 BT_backup 文件夹并尝试访问。

qbittorrent-torrents-exporter-v0.3.5-darwin-amd64

麻烦有空时候,不带参数运行使用一下最新的 0.3.5 版本,谢谢这段时间的跟进回复。

若运行后得到 BT_backup check PASS...,说明软件可以访问文件夹。若后续仍出现之前遇到的 Not Found in BT_backup 相关问题,麻烦请再反馈。

若以 Error 开头(如下),软件输出完后就会自行退出,敬请注意。

若运行后得到 Error: BT_backup folder does not exist.,说明软件可以访问文件系统,但是没有检测到此文件夹的存在。若确实文件夹存在,麻烦请再反馈。

若运行后得到 Error: exporter has no permission to access BT_backup.,说明软件由于权限问题无法试图访问 BT_backup,请尝试调整设置文件夹权限和本 exporter 的权限,再重试。若设置后仍存在请反馈。

若运行后遇到的错误输出不属于以上几类,请反馈,多谢。


针对panic: runtime error: index out of range [8] with length 0且闪退问题:

新开了一个 issue #11 ,可以前去查看并在 #11 处跟进回复,多谢。

LoneFireBlossom commented 1 year ago

确实哎 是文件夹权限的问题

image
LoneFireBlossom commented 1 year ago

-disableAnalize参数运行了一下报了这个错误:

Error:  Game.of.Thrones.S08.2160p.UHD.BluRay.HEVC.Atmos.TrueHD.7.1-DiY@HDHome ( 92ed2f0******** ) Not Found in BT_backup
....
ErrorCount: 1. Please check the log above.

请问这串字符串是啥,我试了一下不是hash也不是磁力链接 不知道为什么BT_bakcup里面会没有

但是之前我运行0.3.3版本的时候只是有很少的几个种子报这个错误的

都是在~/Downloads目录之中运行的

ludoux commented 1 year ago

好玄学我只能说…我手头也没有 mac 设备没法测试,但是我看代码也看不出啥问题,可能要等更多用 mac 的人反馈了🤣假如你用windows 能导出就先用windows 吧, 反正应该也不会经常导出吧, 谢谢你这段时间测试了

LoneFireBlossom commented 1 year ago

应该是我谢谢大佬这段时间愿意帮忙解决问题的

LoneFireBlossom commented 1 year ago

感觉我先关掉issue吧,Mac设备权限问题就先不管了

LoneFireBlossom commented 1 year ago

请问能不能设置把在终端里log输出成文件? 提示ErrorCount: 1. Please check the log above.但输出太多了,已经不在可见范围内了

LoneFireBlossom commented 1 year ago

感觉我先关掉issue吧,Mac设备权限问题就先不管了

我知道了,我需要在终端里cd到程序所在的目录才行。这和Windows上不一样,Windows的powershell里不需要cd过去

ludoux commented 1 year ago

请问能不能设置把在终端里log输出成文件? 提示ErrorCount: 1. Please check the log above.但输出太多了,已经不在可见范围内了

你试一下能不能比如 ./qbittorrent-torrents-exporter >> log.txt 这样子把输出重定向追加进 log.txt 文件,但是我不知道还能不能交互。你可以按传参的方法把 qB 地址、密码都给设定好(比如 README 文件里的 ./qbittorrent-torrents-exporter -qh "http://127.0.0.1:8080" -qu "admin" -qp "adminadmin"),这样子一回车应该就会自动导出,不会再问那个导出筛选的问题了。

假如这个没法的话,我只能之后推一个更新来把这个给导出到文件

LoneFireBlossom commented 1 year ago

还是会问那个导出的问题= = 不过明天我就得出发了,更新了也没法测试了,回来得明年两月

image image
ludoux commented 1 year ago

啊这好吧,不过可能还是tracker的什么问题,目前空 tracker 导出还是会有问题什么的,哎。

------ 原始信息 ------ 来自 "LoneFireBlossom" @.> 收件人 "ludoux/qbittorrent-torrents-exporter" @.> 抄送 "Lu Chang" @.>; "Comment" @.> 日期 2022/12/28 10:14:40 主题 Re: [ludoux/qbittorrent-torrents-exporter] 运行程序报错 (Issue #10)

还是会问那个导出的问题= = 不过明天我就得出发了,更新了也没法测试了,回来得明年两月

image https://user-images.githubusercontent.com/50087596/209746537-a56da00f-224c-4a03-a559-221488d5399c.png

image https://user-images.githubusercontent.com/50087596/209746489-521945f9-a0e8-4dc8-a2b7-7d70abf0e4f9.png

— Reply to this email directly, view it on GitHub https://github.com/ludoux/qbittorrent-torrents-exporter/issues/10#issuecomment-1366316666, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGWKTF3ZXYOVKLMBCUIPV3WPOPBBANCNFSM6AAAAAASDK7O6Y. You are receiving this because you commented.Message ID: @.***>