Girbons / comics-downloader

tool to download comics and manga in pdf/epub/cbr/cbz from a website
MIT License
453 stars 48 forks source link

Add `referer` header for mangatown request #146

Open vaskozl opened 3 months ago

vaskozl commented 3 months ago

New downloads fail via mangatown due to a missing referer header. Example commands:

comics-downloader -url="https://www.mangatown.com/manga/spy_x_family/" -last 
comics-downloader -url="https://www.mangatown.com/manga/vagabond/" -last 

Since https://github.com/Girbons/comics-downloader/commit/c9eb756f85024bc783b4589c1da2072dc6078fcd the referer header is only set for mangakakalot and manganato, but mangatown has a cloudflare rule to block requests on new files without a refer header.

Always setting Referer in pkg/http/client.go fixes this

Girbons commented 3 months ago

thanks for the report @vaskozl!

Always setting Referer in pkg/http/client.go fixes this

I remember that there were cases that always setting this header was causing issues but I'll have a look!