move code into util.py

This commit is contained in:
Mike Fährmann
2017-03-28 13:12:44 +02:00
parent e3212dd98f
commit 841fd50242
12 changed files with 164 additions and 185 deletions

View File

@@ -9,7 +9,7 @@
"""Extract images from galleries at https://exhentai.org/"""
from .common import Extractor, Message
from .. import config, text, iso639_1, exception
from .. import config, text, util, exception
from ..cache import cache
import time
import random
@@ -103,7 +103,7 @@ class ExhentaiGalleryExtractor(Extractor):
("size-units", '', '<'),
("count" , '>Length:</td><td class="gdt2">', ' '),
), values=data)
data["lang"] = iso639_1.language_to_code(data["language"])
data["lang"] = util.language_to_code(data["language"])
data["title"] = text.unescape(data["title"])
data["title_jp"] = text.unescape(data["title_jp"])
return data