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

[BUG]: bgmi 4.2.4 aria2 下载报错 #449

Closed
fmd12345 opened this issue Apr 5, 2023 · 3 comments
Closed

[BUG]: bgmi 4.2.4 aria2 下载报错 #449

fmd12345 opened this issue Apr 5, 2023 · 3 comments
Labels

Comments

@fmd12345
Copy link

fmd12345 commented Apr 5, 2023

Describe the bug

使用最新的4.2.4版本,bgmi update --download 下载番剧报错,下载方式为aria2
报错内容如下:

Traceback (most recent call last):
  File "/usr/lib/python3.10/xmlrpc/client.py", line 523, in __dump
    f = self.dispatch[type(value)]
KeyError: <class 'tomlkit.items.String'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/bgmi", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/bgmi/main.py", line 50, in main
    cli.main(prog_name="bgmi")
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bgmi/main.py", line 448, in update
    ctl.update(names, download=download, not_ignore=not_ignore)
  File "/usr/local/lib/python3.10/dist-packages/bgmi/lib/controllers.py", line 434, in update
    download_prepare(download_queue)
  File "/usr/local/lib/python3.10/dist-packages/bgmi/lib/download.py", line 29, in download_prepare
    driver = get_download_driver(cfg.download_delegate)
  File "/usr/local/lib/python3.10/dist-packages/bgmi/lib/download.py", line 20, in get_download_driver
    stevedore.DriverManager(namespace.DOWNLOAD_DELEGATE, name=delegate, invoke_on_load=True).driver,
  File "/usr/local/lib/python3.10/dist-packages/stevedore/driver.py", line 54, in __init__
    super(DriverManager, self).__init__(
  File "/usr/local/lib/python3.10/dist-packages/stevedore/named.py", line 78, in __init__
    extensions = self._load_plugins(invoke_on_load,
  File "/usr/local/lib/python3.10/dist-packages/stevedore/extension.py", line 218, in _load_plugins
    self._on_load_failure_callback(self, ep, err)
  File "/usr/local/lib/python3.10/dist-packages/stevedore/extension.py", line 206, in _load_plugins
    ext = self._load_one_plugin(ep,
  File "/usr/local/lib/python3.10/dist-packages/stevedore/named.py", line 156, in _load_one_plugin
    return super(NamedExtensionManager, self)._load_one_plugin(
  File "/usr/local/lib/python3.10/dist-packages/stevedore/extension.py", line 242, in _load_one_plugin
    obj = plugin(*invoke_args, **invoke_kwds)
  File "/usr/local/lib/python3.10/dist-packages/bgmi/downloader/aria2_rpc.py", line 18, in __init__
    r = s.aria2.getVersion(cfg.aria2.rpc_token)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1123, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1462, in __request
    request = dumps(params, methodname, encoding=self.__encoding,
  File "/usr/lib/python3.10/xmlrpc/client.py", line 982, in dumps
    data = m.dumps(params)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 514, in dumps
    dump(v, write)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 533, in __dump
    raise TypeError("cannot marshal %s objects" % type(value))
TypeError: cannot marshal <class 'tomlkit.items.String'> objects

手动将

class Aria2DownloadRPC(BaseDownloadService):
    def __init__(self):
        self.server = xmlrpc.client.ServerProxy(cfg.aria2.rpc_url)
        if cfg.aria2.rpc_token.startswith("token:"):
            self.token = cfg.aria2.rpc_token
        else:
            self.token = "token:" + cfg.aria2.rpc_token
        s = xmlrpc.client.ServerProxy(cfg.aria2.rpc_url)
        r = s.aria2.getVersion(cfg.aria2.rpc_token)
        version = r["version"]
        if version:
            old_version = [int(x) for x in version.split(".")] < [1, 18, 4]
            if old_version:
                print_error("you are using old aria2 version, please upgrade to it >1.18.4")
        else:
            print_warning("Get aria2c version failed")

中的 r = s.aria2.getVersion(cfg.aria2.rpc_token) 修改为 r = s.aria2.getVersion(str(cfg.aria2.rpc_token)) 后,
导出下载到aria2时继续报错

2023-04-05 14:40:41 INFO    | fetching 转生贵族的异世界冒险录 〜不知自重的诸神的使徒〜 ...
2023-04-05 14:40:45 INFO    | 转生贵族的异世界冒险录 〜不知自重的诸神的使徒〜 updated, episode: 1
2023-04-05 14:40:46 ERROR   | Error when downloading 【喵萌奶茶屋】★04月新番★[转生贵族的异世界冒险录 ~不知克制的众神的使徒~ / Tensei Kizoku no Isekai Boukenroku][01][1080p][繁日双语][招募翻译]:
 cannot marshal <class 'tomlkit.items.String'> objects
2023-04-05 14:40:46 INFO    | fetching 因为太怕痛就全点防御力了。2 ...

System Info:

Ubuntu 22.04.2 LTS
bgmi 4.2.4
Python 3.10.6

@fmd12345 fmd12345 added the bug label Apr 5, 2023
@trim21
Copy link
Member

trim21 commented Apr 5, 2023

神秘,我看看

@trim21
Copy link
Member

trim21 commented Apr 5, 2023

等ci跑完之后试一下4.2.5

@fmd12345
Copy link
Author

fmd12345 commented Apr 5, 2023

解决了,可以正常下载了

@fmd12345 fmd12345 closed this as completed Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants