muzuiget / niconvert

弹幕转换工具
257 stars 33 forks source link

不支持特定格式的xml #35

Closed LTHPKBTE closed 1 year ago

LTHPKBTE commented 1 year ago

设置如图: 图片 报错如下:

[2023-01-13 00:28:08] 开始转换 ...
Traceback (most recent call last):
  File "D:\Aira2c\Download\niconvert-master\niconvert\fndtk\utils.py", line 23, in redirect_stdio
    yield
  File "D:\Aira2c\Download\niconvert-master\niconvert\fndtk\main.py", line 106, in on_convert_button_clicked
    convert(*args_list)
  File "D:\Aira2c\Download\niconvert-master\niconvert\fndcli\main.py", line 43, in convert
    producer.start_handle()
  File "D:\Aira2c\Download\niconvert-master\niconvert\libsite\producer.py", line 22, in start_handle
    self.load_input_file()
  File "D:\Aira2c\Download\niconvert-master\niconvert\libsite\producer.py", line 29, in load_input_file
    self.all_danmakus = bilibili.loads(path)
  File "D:\Aira2c\Download\niconvert-master\niconvert\libsite\bilibili.py", line 74, in loads
    danmakus = list(map(Danmaku, comments))
  File "D:\Aira2c\Download\niconvert-master\niconvert\libsite\bilibili.py", line 7, in __init__
    self.raw = self._raw()
  File "D:\Aira2c\Download\niconvert-master\niconvert\libsite\bilibili.py", line 18, in _raw
    attr_string, content_string = reg.findall(self.text)[0]
IndexError: list index out of range

源文件如下: https://82pmlj-my.sharepoint.com/:u:/g/personal/java8ver64_82pmlj_onmicrosoft_com/ERlmiwtuRnlEqIYqXSvESiIB9tYt8D6U4NBGL-eFBd9nIg?e=M78Gcx

muzuiget commented 1 year ago

打不开你这个文件。

如果这个 xml 不是 bilibili 的 xml,那么就不会支持了,其实我也很久没转 bilibili 的弹幕了。

如果你会点编程,可以自己写个脚本转成 JSON 格式,然后让 niconvert 来生成 ass 字幕文件。

LTHPKBTE commented 1 year ago

可以确定是b站来源的,只不过格式貌似有略微不同(参数位置不太一样)在线转换器可以正常工作。 附上源文件另外一个链接https://t.wss.ink/f/a9ayggoftkz 【魔狼咪莉娅】【全熟】ଘ出道直播!.txt GitHub不支持传xml文件 暂且改成txt 编码是UTF-8

LTHPKBTE commented 1 year ago

能正常转换的项目参考https://github.com/tiansh/us-danmaku

muzuiget commented 1 year ago

36