-
Notifications
You must be signed in to change notification settings - Fork 9
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
zim格式词典解码问题 #9
Comments
感觉和这个issue比较像,#8 |
纯新人,想问一下readzim.py这个文件具体怎样为最新版呢?(文件我已经下载好了),直接替换群晖里的docker文件,还是需要重新编译好再安装? 直接替换我找了半天没找到文件的具体位置,重新编译的话新手不会捣鼓呢,望大神能指点一下,谢谢! |
docker我也不太清楚,能找到这个文件的位置吗,如果能找到,替换后重启应该就可以。如果不行的话,我再试试生成一个最新版的镜像,可能在下个周。 |
用WinSCP以root账户进入群晖,找了N久也没找到这个文件的具体目录,群晖更换docker为Container Manager后目录和之前很不一样了,网上查到的方法都不正确,大神有时间的话帮忙再编译一个最新版的吧,谢谢!还尝试下载你的旧版本的tar文件再修改,也是没下载成功。。。 |
今天成功找到并更换readzim.py这个文件,群晖具体目录如下:/volume2/@docker/btrfs/subvolumes/2b5f56861995d1f64994a6e7abd18295df5f1da25e476c6a88fe1149313948ba/code/mdict/readlib/src,但是仍然报错,错误日志如下:
大神参考一下,有时间的时候帮忙修复一下吧,谢谢!!! |
从报错信息看,加载的仍然是旧的reazim.py文件,旧文件698行是metadata_dict.update({entry['url']: self._get_article_by_index(file, idx)[0].decode('utf-8')}),新文件698行是entry_url = self._get_article_by_index(file, idx)[0]。我不太清楚docker,镜像重新运行后,改动的文件会被自动恢复吗 |
太棒了,成功解决停止响应的问题。太感谢您了!!在群晖上成功运行,部署笔记如下,需要的朋友参考一下: 这个最新版镜像目前搜索不到,可以用命令的方式添加进去,所以安装采取了命令行方式: 命令解析:
综上所述,这个命令的作用是在一个后台运行的 Docker 容器中启动了一个名为 "django-mdict" 的 Django 应用程序,并将其映射到本地的端口18001,同时将本地目录挂载到容器内的媒体文件目录,以便持久化存储应用程序的媒体文件。 管理员账户建立: |
再请教一下大神,创建管理员账号的时候,输入admin会提示: |
django-mdict default user:admin django-mdict default password:admin123 |
请教一下,我用mdict格式的词典没任何问题,但是添加zim格式的维基百科词库,重启就会报错中止运行,不管是几十MB还是20GB的都是这样。错误日志如下:
2024/02/16 18:48:54 stdout [INIT_UTILS.CHECK_DIR_CHANGE] dir change founded.
2024/02/16 18:48:53 stdout [MDICT_UTILS.SET_MDICT_PATH] /code/media/mdict/doc is root dir.
2024/02/16 18:48:52 stdout [MYSITE.SETTINGS] settings path: /code/mysite/settings.py
2024/02/16 18:48:52 stdout [MANAGE] manage path: /code/manage.py
2024/02/16 18:48:43 stdout UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x89 in position 0: invalid start byte
2024/02/16 18:48:43 stdout metadata_dict.update({entry[‘url’]: self._get_article_by_index(file, idx)[0].decode(‘utf-8’)})
2024/02/16 18:48:43 stdout File “/code/mdict/readlib/src/readzim.py”, line 698, in get_metadata_by_url
2024/02/16 18:48:43 stdout return self.get_metadata_by_url(file)
2024/02/16 18:48:43 stdout File “/code/mdict/readlib/src/readzim.py”, line 716, in metadata
2024/02/16 18:48:43 stdout self.header = self.metadata(zim_file)
2024/02/16 18:48:43 stdout File “/code/mdict/readlib/src/readzim.py”, line 396, in init
2024/02/16 18:48:43 stdout zim = ZIMFile(zim_path, encoding=‘utf-8’)
2024/02/16 18:48:43 stdout File “/code/mdict/mdict_utils/mdict_utils2.py”, line 70, in get_mdict_dict
2024/02/16 18:48:43 stdout init_vars.mdict_odict, init_vars.zim_list = get_mdict_dict(tmdict_root_path)
2024/02/16 18:48:43 stdout File “/code/mdict/mdict_utils/init_utils.py”, line 195, in rewrite_cache
2024/02/16 18:48:43 stdout rewrite_cache(mdict_root_path)
2024/02/16 18:48:43 stdout File “/code/mdict/mdict_utils/init_utils.py”, line 212, in init_mdict_list
2024/02/16 18:48:43 stdout init_mdict_list()
2024/02/16 18:48:43 stdout File “/code/mdict/apps.py”, line 47, in ready
2024/02/16 18:48:43 stdout app_config.ready()
2024/02/16 18:48:43 stdout File “/usr/lib/python3.9/site-packages/django/apps/registry.py”, line 124, in populate
2024/02/16 18:48:43 stdout apps.populate(settings.INSTALLED_APPS)
2024/02/16 18:48:43 stdout File “/usr/lib/python3.9/site-packages/django/init.py”, line 24, in setup
2024/02/16 18:48:43 stdout django.setup()
2024/02/16 18:48:43 stdout File “/usr/lib/python3.9/site-packages/django/core/management/init.py”, line 416, in execute
2024/02/16 18:48:43 stdout utility.execute()
2024/02/16 18:48:43 stdout File “/usr/lib/python3.9/site-packages/django/core/management/init.py”, line 442, in execute_from_command_line
2024/02/16 18:48:43 stdout execute_from_command_line(sys.argv)
2024/02/16 18:48:43 stdout File “/code/manage.py”, line 17, in
2024/02/16 18:48:43 stdout Traceback (most recent call last):
2024/02/16 18:48:29 stdout [INIT_UTILS.CHECK_DIR_CHANGE] dir change founded.
2024/02/16 18:48:28 stdout [MDICT_UTILS.SET_MDICT_PATH] /code/media/mdict/doc is root dir.
2024/02/16 18:48:28 stdout [MYSITE.SETTINGS] settings path: /code/mysite/settings.py
2024/02/16 18:48:27 stdout [MANAGE] manage path: /code/manage.py
看错误提示好像是文件编码格式UTF-8的解码问题,zim我是在维基百科官方下载的,请教下这个问题如何解决呢,谢谢!!!
The text was updated successfully, but these errors were encountered: