simplify extractor constants

- single strings for URL patterns
- tuples instead of lists for 'directory_fmt' and 'test'
- single-tuple tests where applicable
This commit is contained in:
Mike Fährmann
2019-02-08 13:45:40 +01:00
parent 34bab080ae
commit 6284731107
84 changed files with 1080 additions and 1108 deletions

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Mike Fährmann
# Copyright 2018-2019 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -16,13 +16,13 @@ class NgomikChapterExtractor(ChapterExtractor):
"""Extractor for manga-chapters from ngomik.in"""
category = "ngomik"
root = "http://ngomik.in"
pattern = [r"(?:https?://)?(?:www\.)?ngomik\.in"
r"/manga/([^/?&#]+/chapter-[^/?&#]+)"]
test = [(("http://ngomik.in/manga/chuuko-demo-koi-ga-shitai"
"/chapter-21-5?style=list"), {
pattern = (r"(?:https?://)?(?:www\.)?ngomik\.in"
r"/manga/([^/?&#]+/chapter-[^/?&#]+)")
test = (("http://ngomik.in/manga/chuuko-demo-koi-ga-shitai"
"/chapter-21-5?style=list"), {
"url": "e87ed713f31d576013f179b50b4e10d7c678e53a",
"keyword": "a774caea148fc18a7d889f453dadbe3def9e0c2c",
})]
})
def __init__(self, match):
url = "{}/manga/{}?style=list".format(self.root, match.group(1))