Kenshin / simpread

简悦 ( SimpRead ) - 让你瞬间进入沉浸式阅读的扩展
http://ksria.com/simpread
GNU General Public License v3.0
8.04k stars 529 forks source link

stackoverflow部分文章导出为PDF时较慢 #4950

Open shadu120 opened 1 year ago

shadu120 commented 1 year ago

目标网址:

https://stackoverflow.com/questions/12351702/how-to-write-a-bash-script-to-set-global-environment-variable

操作方法

进入阅读模式,快捷键操作 aa--sr--pf

效果

会先看到一个tmp-how-to-write-a-bash-script-to-set-global-environment-variable***.html文件在output目录下,大概等3~5分钟,才能看到pdf文件输出,并被移动到目标文件夹。

关键参数

同步助手基础版和高级版都测试过,效果一样。

使用了文件名输出格式化{{id}}{{title}}-{{date_format|yyyyMMddhhmmss}}{{mode}}

一些猜想

1)html转pdf,有联网操作,但是被墙,等待超时? 2)不是所有的网页都这样,有的很快啊,比如这个:https://new.qq.com/rain/a/20221215A0A4YU00 3) 跟文件名自定义有关?bug导致?

看时间对比

[2022-12-23 23:18:02.370] INFO (on MBP.local): write: /Users/xxx/Library/CloudStorage/坚果云-xxx/SimpRead/output/tmp-李家超:明年与内地通关有现实可能性_腾讯新闻-20221223231802.html
[2022-12-23 23:18:03.594] INFO (on MBP.local): write: /Users/xxx/Documents/SimpRead/output/pdf/李家超:明年与内地通关有现实可能性_腾讯新闻-20221223231802.pdf
[2022-12-23 23:18:03.596] INFO (on MBP.local): write: /Users/xxx/Documents/SimpRead/output/pdf/

[2022-12-23 23:24:11.673] INFO (on MBP.local): write: /Users/xxx/Library/CloudStorage/坚果云-xxx/SimpRead/output/tmp-shell - How to write a bash script to set global environment variable- - Stack Overflow-20221223232411.html
[2022-12-23 23:27:59.863] INFO (on MBP.local): write: /Users/xxx/Documents/SimpRead/output/pdf/shell - How to write a bash script to set global environment variable- - Stack Overflow-20221223232411.pdf
[2022-12-23 23:27:59.872] INFO (on MBP.local): write: /Users/xxx/Documents/SimpRead/output/pdf/
shadu120 commented 1 year ago

关键是我后面有程序用这个pdf,对这个时间比较关注。

shadu120 commented 1 year ago

pdf生成过程中会重新加载HTML中的图片资源吗? 我看了下https://www.gravatar.com/avatar/5b3ea0600ed7ddb4fa2923f2f2c771f2?s=64&d=identicon&r=PG ,这种头像地址是无法访问的,原因在此?

Kenshin commented 1 year ago

嗨,很奇怪,只有使用 PDF 基础打印方案才会出现这个问题,使用前者会跟网络有关系,因为你可以理解前者类似爬虫方案,所以有个「加载的过程」。

另外,这两天 🐑 了,所以太复杂的调查暂时没法做,毕竟脑袋没有那么好使了 😂

我先记录下这个问题。

shadu120 commented 1 year ago

感谢回复。 Merry Christmas Eve.