最近收到一些插件反馈,对Calibre
桌面版豆瓣插件进行一些简单升级
以前安装文档:https://fugary.com/?p=264
Calibre
电子书管理软件:https://calibre-ebook.com/download
calibre-douban
是Calibre
电子书软件的豆瓣元数据插件
下载地址
项目地址:https://github.com/fugary/calibre-douban
下载地址:https://github.com/fugary/calibre-douban/releases/latest/download/NewDouban.zip
代理下载:https://ghproxy.com/https://github.com/fugary/calibre-douban/releases/latest/download/NewDouban.zip
从release页面下载zip包,然后再calibre
中安装为插件即可。
升级内容
删除了一些无用代码,另外增加功能:
- 增加
gzip
支持,有可能提升一点速度 - 增加随机毫秒延迟,减少被403的几率
- 增加
Cookie
输入框,可以填入浏览器登录后的Cookie
,减少403
配置随机延迟
默认已开启随机延迟,也就是在并发请求详情数据的时候随机sleep
一定的毫秒数,可以关闭:
参考代码
def random_sleep(self, log):
random_sec = random.random() / 10
log.info("Random sleep time {}s".format(random_sec))
time.sleep(random_sec)
Cookie配置
有时候可能我们的IP已经被拦了,这时可以自己登录豆瓣网站,然后把Cookie
复制出来填进插件配置中。
IP
被拦的错误如下:
有异常请求从你的 IP 发出,请 登录 使用豆瓣
用Chrome
或者Edge
浏览器打开https://www.douban.com,点击【登录】进入登录页面,登录成功之后,按F12
打开开发者工具:
从Network
,找到Doc
类型,随便点击一个豆瓣的网址,进入Headers
,找到Request Headers
里面的Cookie
字段,如图:
如果是中文版:
从网络
,找到文档
类型,随便点击一个豆瓣的网址,进入标头
,找到请求标头
里面的Cookie
字段,如图:
找到Cookie:
后面的部分,复制后面的内容,不包含Cookie:
。
到Calibre
插件配置页面填入Cookie
:
然后就可以用用户的身份查询,一般是可以解决403问题。
常见错误
如果又遇到查询失败,可能是这个错误
…你访问豆瓣的方式有点像机器人程序。为了保护用户的数据,请向我们证明你是人类:
因为使用了Cookie
,可以在浏览器中自己点击证明一下,再在calibre
中重新查询即可。
有时不需要下载封面,好像不能单独下载元数据?
牛逼,可用的,感谢
感谢博主~收藏了~
大佬,自定义插件只有元数据段的选择和 include subtitle,下不了怎么办😱
最好提供下软件版本,错误日志等,可以到GitHub提交issue
及空间的calibre docker怎么设置呢?大佬
你好,请问,我WIN11,在Calibre桌面版安装插件后,菜单栏上看不到这个插件,但插件自定义那显示已经安装了这个插件,这会是什么原因呢?
已经找到了,原来在元数据下载那里体现的。谢谢啦
大佬,是不是最近豆瓣插件不能用了,新书导入搜不到,旧书也搜不出来元数据了
calibre, version 7.1.0
错误: 无匹配项: 无法为你找到书籍元数据。请尝试扩大搜索范围。比如:只使用作者的姓氏或只包含书名中具有特征性的词。要查看完整的日志,请点击“显示详情”。
Running identify query with parameters:
{‘title’: ‘做一个清醒的现代人’, ‘authors’: [‘刘擎’], ‘identifiers’: {‘isbn’: ‘9787572601149’, ‘mobi-asin’: ‘B09246F2GY’, ‘new_douban’: ‘35425621’}, ‘timeout’: 30}
Using plugins: New Douban Books (2, 0, 1)
The log from individual plugins is below
** New Douban Books (2, 0, 1) **
Found 0 results
Downloading from New Douban Books took 0.010049104690551758
Plugin New Douban Books failed
Traceback (most recent call last):
File “calibreebooksmetadatasourcesidentify.py”, line 47, in run
File “calibre_plugins.dummy1.init“, line 328, in identify
File “calibre_plugins.dummy1.init“, line 64, in search_books
File “calibre_plugins.dummy1.init“, line 49, in load_book_urls_new
File “urllibrequest.py”, line 216, in urlopen
File “urllibrequest.py”, line 519, in open
File “urllibrequest.py”, line 536, in _open
File “urllibrequest.py”, line 496, in _call_chain
File “urllibrequest.py”, line 1391, in https_open
File “urllibrequest.py”, line 1348, in do_open
File “httpclient.py”, line 1286, in request
File “httpclient.py”, line 1327, in _send_request
File “httpclient.py”, line 1264, in putheader
ValueError: Invalid header value b’nll=”108288″; bid=wVAIsVo4WLo; _pk_id.100001.8cb4=c2e99b46c8fc569b.1699621167.; push_noty_num=0; push_doumail_num=0; utmz=30149280.1699693602.2.2.utmcsr=accounts.douban.com|utmccn=(referral)|utmcmd=referral|utmcct=/; utmv=30149280.296; dbcl2=”2964267:3CUBSj7ic5A”; ct=y; ck=uuPf; _pk_ses.100001.8cb4=1; utma=30149280.1550351057.1699621168.1701175746.1701242934.9; utmc=30149280; utmt=1; utmb=30149280.4.10.1701242934′
The identify phase took 0.20 seconds
The longest time (0.010049) was taken by: New Douban Books
Merging results fro
昨天还用过,应该没问题吧,有isbn号优先用isbn号,可以尝试删除isbn再试试看
彻底删除后重装软件即可解决问题,感谢大佬~
#################### Log for 娱乐至死 (尼尔·波兹曼) (Z-Library) ####################
Running identify query with parameters:
{‘title’: ‘娱乐至死 (尼尔·波兹曼) (Z-Library)’, ‘authors’: None, ‘identifiers’: {}, ‘timeout’: 30}
Using plugins: New Douban Books (2, 0, 1)
The log from individual plugins is below
** New Douban Books (2, 0, 1) **
Found 0 results
Downloading from New Douban Books took 9.706180334091187
The identify phase took 9.82 seconds
The longest time (9.706180) was taken by: New Douban Books
Merging results from different sources
We have 0 merged results, merging took: 0.00 seconds
Failed to download metadata for 娱乐至死 (尼尔·波兹曼) (Z-Library)
** New Douban Books Covers **
Request extra headers: [(‘User-agent’, ‘Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko’)]
Failed to download valid cover
Took 9.61152195930481 seconds
No cached cover found, running identify
No cover found
报这个错,不知道什么原因,能请博主看看嘛?
改改名字再搜,名字乱了也搜不到数据
ok,下好了,谢谢博主
Calibre桌面版:5.1.0
近期更新图书也较少,刚发现插件2023年7月有更新,尝试了https://github.com/fugary/calibre-douban,v2.0.1版本的插件,下载封面时有如下日志报错信息。配置Cookie时也遇到了上文所述的机器人验证,已通过,但Cookie内容和图示有所差别。由于看不懂,就把Cookie双击复制到插件的文本框内。看报错信息成功找到了正确的元数据网址,但似乎因为这个xpath属性导致报错。
我是在摸索群晖存储电子书的过程中发现了宝藏博主,感谢分享!向您学习!
** New Douban Books Covers **
Request extra headers: [(‘User-agent’, ‘Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36’)]
Failed to download valid cover
Took 2.9021875858306885 seconds
No cached cover found, running identify
Random sleep time 0.07146690869968869s
Downloaded:https://book.douban.com/subject/34813624/ Successful,Time 2506ms
Failed to download cover from New Douban Books
Traceback (most recent call last):
File “site-packagescalibreebooksmetadatasourcescovers.py”, line 46, in run
File “calibre_plugins.dummy1.init“, line 262, in download_cover
File “calibre_plugins.dummy1.init“, line 328, in identify
File “calibre_plugins.dummy1.init“, line 68, in search_books
File “concurrentfutures_base.py”, line 432, in result
File “concurrentfutures_base.py”, line 388, in get_result
File “concurrentfuturesthread.py”, line 57, in run
File “calibre_plugins.dummy1.init“, line 82, in load_book
File “calibre_plugins.dummy1.init__”, line 113, in parse_book
AttributeError: ‘NoneType’ object has no attribute ‘xpath’
我本来是手动维护的,后来突然想到会不会有插件,一搜还真有,非常好用,感谢您
感谢感谢^^
大大,豆瓣源书籍信息可以找到并添加,但是到书封面那里无法加载,看了日志显示403
Downloading cover from: https://img1.doubanio.com/view/subject/l/public/s33596798.jpg
Failed to download cover from: https://img1.doubanio.com/view/subject/l/public/s33596798.jpg
Traceback (most recent call last):
File “calibre_plugins.dummy2.init“, line 295, in download_cover
File “mechanize_mechanize.py”, line 241, in open_novisit
File “mechanize_mechanize.py”, line 313, in _mech_open
mechanize._response.get_seek_wrapper_class..httperror_seek_wrapper: HTTP Error 403: Forbidden
最新版应该已经修复此问题
calibre升级到最新6.22,然后插件卸载重装可以了,感谢大佬
就是现在一定要配置自己豆瓣账号的cooki了,然后搜4-5本要去机器人验证下,哈哈
是指插件版本,下载一个最新版插件
安装插件出错怎么破?
calibre 3.48 portable,
上面URL下载的插件。
谢谢!
calibre 3.48 Portable embedded-python: True is64bit: False
Windows-7-6.1.7601-SP1 Windows (’32bit’, ‘WindowsPE’)
(‘Windows’, ‘7’, ‘6.1.7601’)
Python 2.7.15+
Windows: (‘7’, ‘6.1.7601’, ‘SP1′, u’Multiprocessor Free’)
Interface language: zh_CN
Traceback (most recent call last):
File “site-packagescalibregui2preferencesplugins.py”, line 319, in add_plugin
File “site-packagescalibrecustomizeui.py”, line 472, in add_plugin
File “site-packagescalibrecustomizeui.py”, line 61, in load_plugin
File “site-packagescalibrecustomizezipplugin.py”, line 201, in load
File “site-packagespolyglotbuiltins.py”, line 186, in reload
File “site-packagescalibrecustomizezipplugin.py”, line 185, in load_module
File “calibre_plugins.dummy1.init“, line 5, in
ImportError: No module named concurrent.futures
calibre5以下版本不支持,必须是5.x或更高版本,python3
清楚了,谢谢!
谢谢,可以工作了,是我弄错了。
感谢博主的制作与分享
很棒的插件,感谢!
这个插件太棒了!