Commit c8b4e01
Fix Douban cover download failing with HTTP 418
Douban's image CDN (*.doubanio.com) enforces hotlink protection and
returns HTTP 418 unless the request carries a douban Referer, so covers
fetched via the Douban metadata provider never download.
Send `Referer: https://book.douban.com/` when the cover URL points at a
doubanio.com host so save_cover_from_url succeeds. Requests to any other
host are unaffected. This mirrors how existing Calibre desktop Douban
plugins work around the same protection.
Refs #913
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 43718d8 commit c8b4e01
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
1062 | 1062 | | |
1063 | 1063 | | |
1064 | 1064 | | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
1065 | 1071 | | |
1066 | | - | |
| 1072 | + | |
1067 | 1073 | | |
1068 | | - | |
| 1074 | + | |
1069 | 1075 | | |
1070 | 1076 | | |
1071 | 1077 | | |
| |||
0 commit comments