yann0917 / dedao-dl

得到 APP 课程下载工具,可在终端查看文章内容,可生成 PDF,音频文件,markdown 文稿,可下载电子书。
MIT License
569 stars 110 forks source link

电子书下载pdf 格式报错 #200

Closed lengyueyang closed 8 months ago

lengyueyang commented 9 months ago

Mac系统,应该是打开本地文件报错

正在生成文件:【output/Ebook/115609打造第二大脑【美】蒂亚戈·福特.pdf】 pdfg create err: &errors.errorString{s:"Loading pages (1/6)\n[> ] 0%\r[===> ] 5%\r[======> ] 10%\rError: Failed to load file://output/Ebook/cover.html, with network status code 302 and http status code 0 - Request for opening non-local file file://output/Ebook/cover.html\nError: Failed loading page file://output/Ebook/cover.html (sometimes it will work just to ignore this error with --load-error-handling ignore)\n[=============> ] 22%\r[=============> ] 23%\r[==============> ] 24%\r[===============> ] 25%\r[================> ] 27%\r[================> ] 28%\r[=================> ] 29%\r[=====================> ] 36%\r[=============================> ] 49%\r[=================================> ] 55%\rExit with code 1 due to network error: ProtocolInvalidOperationError\n\nexit status 1"} Error: Loading pages (1/6) Error: Failed to load file://output/Ebook/cover.html, with network status code 302 and http status code 0 - Request for opening non-local file file://output/Ebook/cover.html Error: Failed loading page file://output/Ebook/cover.html (sometimes it will work just to ignore this error with --load-error-handling ignore) Exit with code 1 due to network error: ProtocolInvalidOperationError

exit status 1 Usage: dedao-dl dle [flags]

Examples: dedao-dl dle 123 -t 1

Flags: -t, --downloadType int 下载格式, 1:html, 2:PDF文档, 3:epub (default 1) -h, --help help for dle

yann0917 commented 8 months ago

wkhtmltopdf 设置封面时查找相对路径报错,解决方案:改成绝对路径。估计是升级 go-wkhtmltopdf 之后出现的问题。