zrong / wiz2joplin

Migrate from WizNote to Joplin.
GNU General Public License v3.0
90 stars 21 forks source link

运行后报错,提示找不到get-uuid文件 #2

Closed Felix2yu closed 3 years ago

Felix2yu commented 3 years ago

macOS 11.2.2 python 3.9.2

安装后运行w2j -o ~/w2j -w ~/.wiznote -u xxx@gmail.com -t xxx -a

Please read [/Users/fei/w2j/w2j.log] to check the conversion states.
Traceback (most recent call last):
  File "/usr/local/bin/w2j", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/w2j/__init__.py", line 65, in main
    ad = adapter.Adapter(ws, jda, work_dir=output_dir)
  File "/usr/local/lib/python3.9/site-packages/w2j/adapter.py", line 413, in __init__
    self.ws.resolve()
  File "/usr/local/lib/python3.9/site-packages/w2j/wiz.py", line 478, in resolve
    self.documents = self.build_documents()
  File "/usr/local/lib/python3.9/site-packages/w2j/wiz.py", line 448, in build_documents
    document.resolve(
  File "/usr/local/lib/python3.9/site-packages/w2j/wiz.py", line 202, in resolve
    self.resolve_body()
  File "/usr/local/lib/python3.9/site-packages/w2j/wiz.py", line 197, in resolve_body
    self._parse_wiz_note()
  File "/usr/local/lib/python3.9/site-packages/w2j/wiz.py", line 189, in _parse_wiz_note
    self.body, self.internal_links, self.images = parse_wiz_html(self.note_extract_dir, self.title)
  File "/usr/local/lib/python3.9/site-packages/w2j/parser.py", line 124, in parse_wiz_html
    img = WizImage(image.group(0), image.group(1), note_extract_dir)
  File "/usr/local/lib/python3.9/site-packages/w2j/parser.py", line 80, in __init__
    raise FileNotFoundError(f'找不到文件 {self.file}!')
FileNotFoundError: 找不到文件 /Users/fei/w2j/documents/a7be02df-3aad-4d75-9323-da31b379fd6f/index_files/get-uuid!

w2j.log为空,该路径有如下文件

ll /Users/fei/w2j/documents/a7be02df-3aad-4d75-9323-da31b379fd6f/index_files
total 2592
-rw-r--r--  1 fei  staff    35K  3  2 22:10 beantech.min.css
-rw-r--r--  1 fei  staff   228K  3  2 22:10 bootstrap.min.css
-rw-r--r--  1 fei  staff    53K  3  2 22:10 font-awesome.min.css
-rw-r--r--  1 fei  staff    69K  3  2 22:10 fontawesome-webfont.eot
-rw-r--r--  1 fei  staff   357K  3  2 22:10 fontawesome-webfont.svg
-rw-r--r--  1 fei  staff   139K  3  2 22:10 fontawesome-webfont.ttf
-rw-r--r--  1 fei  staff    82K  3  2 22:10 fontawesome-webfont.woff
-rw-r--r--  1 fei  staff    65K  3  2 22:10 fontawesome-webfont.woff2
-rw-r--r--  1 fei  staff    69K  3  2 22:10 fontawesome-webfont_2.eot
-rw-r--r--  1 fei  staff    20K  3  2 22:10 glyphicons-halflings-regular.eot
-rw-r--r--  1 fei  staff    12K  3  2 22:10 glyphicons-halflings-regular.svg
-rw-r--r--  1 fei  staff    44K  3  2 22:10 glyphicons-halflings-regular.ttf
-rw-r--r--  1 fei  staff    23K  3  2 22:10 glyphicons-halflings-regular.woff
-rw-r--r--  1 fei  staff    18K  3  2 22:10 glyphicons-halflings-regular.woff2
-rw-r--r--  1 fei  staff    20K  3  2 22:10 glyphicons-halflings-regular_2.eot
-rw-r--r--  1 fei  staff   5.8K  3  2 22:10 highlight.css
-rw-r--r--  1 fei  staff   7.2K  3  2 22:10 ironman.png
-rw-r--r--  1 fei  staff   3.7K  3  2 22:10 rocket.css
-rw-r--r--  1 fei  staff   276B  3  2 22:10 signature.css
-rw-r--r--  1 fei  staff   2.6K  3  2 22:10 toc.css
-rw-r--r--  1 fei  staff   1.6K  3  2 22:10 widget.css
zrong commented 3 years ago

看一下这个文件的内容:

/Users/fei/w2j/documents/a7be02df-3aad-4d75-9323-da31b379fd6f/index.html

其中是否有一个图像文件名称为 get-uuid,类似于这样的源码:

<img src="index_files/get-uuid".....

有可能是正则匹配到了一个不存在的图像文件。可以编辑源码将这个图像文件删除,然后再跑程序。

Felix2yu commented 3 years ago

抱歉,经查看是当初剪裁网页时将livere这个博客评论组件也保存了导致的。删掉后即正常,现在能正常迁移到joplin了,非常感谢!