From 8f24329e306873e062a32578d294727fff6be254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 10 Apr 2015 17:32:36 +0200 Subject: [PATCH] [pixiv] fix http headers and cookies --- gallery_dl/extractor/pixiv.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py index 765ac825..479e0bde 100644 --- a/gallery_dl/extractor/pixiv.py +++ b/gallery_dl/extractor/pixiv.py @@ -46,11 +46,13 @@ class PixivExtractor(AsynchronousExtractor): self.config = config self.artist_id = match.group(1) self.api = PixivAPI(config["pixiv-cookies"]["PHPSESSID"]) + self.session.headers.update({"Referer": "http://www.pixiv.net/"}) + self.session.cookies.update(self.config["pixiv-cookies"]) def items(self): yield Message.Version, 1 - yield Message.Headers, {"Referer": "http://www.pixiv.net/"} - yield Message.Cookies, self.config["pixiv-cookies"] + yield Message.Headers, self.session.headers + yield Message.Cookies, self.session.cookies yield Message.Directory, self.get_job_metadata() for illust_id in self.get_illust_ids():