Comment 4 for bug 1853091

xuyang (xuygelba) wrote :

I found a valid key from internet and wrote a test code like this:
--------------------------
.....
headers = {
 # 测试必须用老版本的UA标识,否则会失败
 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)' +
      ' Chrome/70.0.3538.110 Safari/537.36',
 'Referer': 'https://www.douban.com'
}

# 从网上找的别人的apikey
url = douban_base_url_ofc + 'isbn/' + isbn + '?apikey=my_key_xxxx'

log.debug("url:{}".format(url))
item = DoubanItem()
...
--------------------------

the code worked, then i downloaded source code of calibre and replaced key in calibre\ebooks\metadata\douban.py, generated douban.pyo and replaced it into pylib.zip of current version in my computer, but it didn't work. I didn't read calibre source code carefully and completely, maybe should i also change request headers in calibre douban plugin?

Anather solution is i send this key to you, but i don't know if there will be a legal problem to use this key in calibre.