From 75ff08f73c4565e759be839fbd59bfdd3675e15f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 11 Dec 2015 00:07:21 +0100 Subject: [PATCH] [nijie] proper login and other issues fixed --- gallery-dl.conf | 8 ++------ gallery_dl/extractor/nijie.py | 32 ++++++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/gallery-dl.conf b/gallery-dl.conf index 305a8c6b..884791dc 100644 --- a/gallery-dl.conf +++ b/gallery-dl.conf @@ -27,12 +27,8 @@ }, "nijie": { - "cookies": - { - "NIJIEIJIEID": null, - "nijie_email_hash": null, - "nijie_login_hash": null - } + "email": null, + "password": null }, "gelbooru": { diff --git a/gallery_dl/extractor/nijie.py b/gallery_dl/extractor/nijie.py index 0249afb1..22b980aa 100644 --- a/gallery_dl/extractor/nijie.py +++ b/gallery_dl/extractor/nijie.py @@ -10,10 +10,9 @@ from .common import AsynchronousExtractor, Message from .. import config, text -import re - -class NijieExtractor(AsynchronousExtractor): +class NijieUserExtractor(AsynchronousExtractor): + """Extract all works of a single nijie-user""" category = "nijie" directory_fmt = ["{category}", "{artist-id}"] filename_fmt = "{category}_{artist-id}_{image-id}_p{index:>02}.{extension}" @@ -28,13 +27,9 @@ class NijieExtractor(AsynchronousExtractor): + self.artist_id ) self.session.headers["Referer"] = self.artist_url - self.session.cookies["R18"] = "1" - self.session.cookies["nijie_referer"] = "nijie.info" - self.session.cookies.update( - config.get(("extractor", self.category, "cookies")) - ) def items(self): + self.login() data = self.get_job_metadata() yield Message.Version, 1 yield Message.Directory, data @@ -53,16 +48,25 @@ class NijieExtractor(AsynchronousExtractor): def get_image_ids(self): """Collect all image-ids for a specific artist""" page = self.request(self.artist_url).text - regex = r'