webcomics / dosage

dosage is a comic strip downloader and archiver
https://dosage.rocks/
MIT License
123 stars 59 forks source link

request functionality: add cookie-Support #186

Open grince opened 3 years ago

grince commented 3 years ago

Hi,

some comics have different images wether you are logged in or not. would it be possible to add cookie-support for a scraper, so I can either set various cookies within the scraper definition or head to a cookies.txt-file which contains all necessary cookies?

TobiX commented 3 years ago

Since we are using https://docs.python-requests.org/en/master/ basic cookie support is already there. See for example the webtoons module: https://github.com/webcomics/dosage/blob/848f051a8922c96c172158dcc6adf8010cf815c3/dosagelib/plugins/webtoons.py#L23

Injecting additional cookies via a command line option would probably a nice extension to this feature...

grince commented 3 years ago

well - webtoons doesn't use _basicscraper, so I have to fiddle around a little bit. maybe I'll find a way to inject it with basicscraper.

TobiX commented 3 years ago

_BasicScraper is basically deprecated, but the HTTP part should neverless work the same way regardless of scraper base class.

grince commented 3 years ago

Ah, good to know. then I'll try ParserScraper, since that seems to be the better choice. Thanks for the information!