rewrite extractors to use config-module
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
"""Extract images and ugoira from http://www.pixiv.net/"""
|
||||
|
||||
from .common import SequentialExtractor, Message
|
||||
from .. import text
|
||||
from .. import config, text
|
||||
import re
|
||||
import json
|
||||
|
||||
@@ -29,16 +29,15 @@ class PixivExtractor(SequentialExtractor):
|
||||
member_url = "http://www.pixiv.net/member_illust.php"
|
||||
illust_url = "http://www.pixiv.net/member_illust.php?mode=medium"
|
||||
|
||||
def __init__(self, match, config):
|
||||
SequentialExtractor.__init__(self, config)
|
||||
self.config = config
|
||||
def __init__(self, match):
|
||||
SequentialExtractor.__init__(self)
|
||||
self.artist_id = match.group(1)
|
||||
self.api = PixivAPI(self.session)
|
||||
|
||||
def items(self):
|
||||
self.api.login(
|
||||
self.config.get("pixiv", "username"),
|
||||
self.config.get("pixiv", "password"),
|
||||
config.get(("extractor", "pixiv", "username")),
|
||||
config.get(("extractor", "pixiv", "password")),
|
||||
)
|
||||
metadata = self.get_job_metadata()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user