Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加下载失败 startswith first arg must be bytes or a tuple of bytes, not str无法从nastool添加下载 #786

Open
3 tasks done
aztdmxb opened this issue Oct 6, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@aztdmxb
Copy link

aztdmxb commented Oct 6, 2024

确认

  • 我的版本是最新版本,我的版本号与 version 相同。
  • 我已经 issue 中搜索过,确认我的问题没有被提出过。
  • 我已经修改标题,将标题中的 描述 替换为我遇到的问题。

当前程序版本

3.4.1

问题类型

主程序运行问题

问题描述

添加下载失败 startswith first arg must be bytes or a tuple of bytes, not str
QQ20241006-180801
处理事件:download.add - [<function DownloaderHelper.listen_download_add_event at 0x7f26d050a4d0>, <function Webhook.send at 0x7f26d05039a0>]

QQ20241006-181216

发生问题时系统日志和配置文件

Exception: startswith first arg must be bytes or a tuple of bytes, not str
Callstack:
Traceback (most recent call last):
File "/nas-tools/web/main.py", line 1104, in do
return WebAction().action(cmd, data)
File "/nas-tools/web/action.py", line 269, in action
return func(data)
2024-10-06 18:06:55,220 INFO: 处理事件:download.add - [<function DownloaderHelper.listen_download_add_event at 0x7f468ba20280>, <function Webhook.send at 0x7f468ba65d80>]
File "/nas-tools/web/action.py", line 625, in __download_link
_, ret, ret_msg = Downloader().download(media_info=media,
File "/nas-tools/app/downloader/downloader.py", line 333, in download
if url.startswith("magnet:"):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str



Exception: startswith first arg must be bytes or a tuple of bytes, not str
Callstack:
Traceback (most recent call last):
File "/nas-tools/web/main.py", line 1104, in do
return WebAction().action(cmd, data)
File "/nas-tools/web/action.py", line 269, in action
return func(data)
File "/nas-tools/web/action.py", line 625, in __download_link
_, ret, ret_msg = Downloader().download(media_info=media,
File "/nas-tools/app/downloader/downloader.py", line 333, in download
if url.startswith("magnet:"):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
@aztdmxb aztdmxb added the bug Something isn't working label Oct 6, 2024
@naughtyGitCat
Copy link

fixed in https://github.com/naughtyGitCat/nas-tools, u can try it

@XXwhite
Copy link

XXwhite commented Dec 22, 2024

兄弟我找到了解决办法,我使用馒头要到了同样的问题,在站点维护中新增一个站点,地址是https://api.m-team.cc,其他保持不变,这样就能正常下载了。

@LukeLu0415
Copy link

兄弟我找到了解决办法,我使用馒头要到了同样的问题,在站点维护中新增一个站点,地址是https://api.m-team.cc,其他保持不变,这样就能正常下载了。

牛逼啊,什么原理呢

@XXwhite
Copy link

XXwhite commented Dec 27, 2024

兄弟我找到了解决办法,我使用馒头要到了同样的问题,在站点维护中新增一个站点,地址是https://api.m-team.cc,其他保持不变,这样就能正常下载了。

牛逼啊,什么原理呢

可能因为馒头种子的地址跟网站地址前缀不一样导致nastool识别错误吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants