JimmXinu / FanFicFare

FanFicFare is a tool for making eBooks from stories on fanfiction and other web sites.
Other
739 stars 157 forks source link

The images are not downloading #941

Closed i-push-code closed 1 year ago

i-push-code commented 1 year ago

This story has images but they're not downloading https://forum.questionablequesting.com/threads/asias-adventurous-travels-dxd-si-oc.21599/

JimmXinu commented 1 year ago

This appears to be specific to the gelbooru.com image hosting site, I'm not seeing problems with other stories with images. The image site is returning an HTML that then shows the page instead of the actual image.

It is very similar to #940. So much so that the same fix appears to work. If you use the latest test version of FFF, it works for me:

[https://forum.questionablequesting.com/threads/asias-adventurous-travels-dxd-si-oc.21599/]
force_img_referer:https://img3.gelbooru.com
JimmXinu commented 1 year ago

Looking at #940 and #941, I plan to change force_img_referer to force_img_self_referer instead. That way the user doesn't need to figure out the referrer URL and it will still work with images from different hosting sites.

## If set true, FFF will use the img tag's own src URL as the HTTP
## Referer instead of the page URL.  This is useful for some image
## hosting sites that watermark or return HTML instead of image data
## without it.
#force_img_self_referer:false

(Note that Referer is correct when talking about HTTP--it's a typo in the standard we're all stuck with.)

JimmXinu commented 1 year ago

New force_img_self_referer_regexp option works.

From defaults.ini:

## If set, and the img tag's URL matches the regular expression, FFF
## will use the img tag's own src URL as the HTTP Referer instead of
## the page URL.  This is useful for some image hosting sites that
## watermark or return HTML instead of image data without it.
#force_img_self_referer_regexp:gelbooru.com|photobucket.com