1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 10:42:34 +01:00

[mangastream] adjust regex

This commit is contained in:
Mike Fährmann 2016-04-20 08:28:17 +02:00
parent 1416e7f6f7
commit 7af8ae509c
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -14,14 +14,14 @@ from .. import text
class MangaStreamExtractor(AsynchronousExtractor): class MangaStreamExtractor(AsynchronousExtractor):
category = "mangastream" category = "mangastream"
directory_fmt = ["{category}", "{manga}", "c{chapter:>03}{chapter-minor} - {title}"] directory_fmt = ["{category}", "{manga}", "c{chapter} - {title}"]
filename_fmt = "{manga}_c{chapter:>03}{chapter-minor}_{page:>03}.{extension}" filename_fmt = "{manga}_c{chapter}_{page:>03}.{extension}"
pattern = [r"(?:https?://)?(?:www\.)?readms\.com/r/([^/]*/(\d+)([^/]*)?/(\d+))"] pattern = [r"(?:https?://)?(?:www\.)?readms\.com/r/([^/]*/([^/]+)/(\d+))"]
url_base = "https://readms.com/r/" url_base = "https://readms.com/r/"
def __init__(self, match): def __init__(self, match):
AsynchronousExtractor.__init__(self) AsynchronousExtractor.__init__(self)
self.part, self.chapter, self.ch_minor,self.ch_id = match.groups() self.part, self.chapter, self.ch_id = match.groups()
def items(self): def items(self):
page = self.request(self.url_base + self.part).text page = self.request(self.url_base + self.part).text
@ -41,8 +41,7 @@ class MangaStreamExtractor(AsynchronousExtractor):
"""Collect metadata for extractor-job""" """Collect metadata for extractor-job"""
data = { data = {
"category": self.category, "category": self.category,
"chapter": self.chapter, "chapter": text.unquote(self.chapter),
"chapter-minor": self.ch_minor,
"chapter-id": self.ch_id, "chapter-id": self.ch_id,
"lang": "en", "lang": "en",
"language": "English", "language": "English",