Skip to content

Commit

Permalink
Revert "[senmanga] fix extraction and download"
Browse files Browse the repository at this point in the history
This reverts commit 2ace5c7.
  • Loading branch information
mikf committed Oct 23, 2017
1 parent 81a7788 commit c4fcdf2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions gallery_dl/extractor/senmanga.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ class SenmangaChapterExtractor(Extractor):
pattern = [r"(?:https?://)?raw\.senmanga\.com/([^/]+/[^/]+)"]
test = [
("http://raw.senmanga.com/Bokura-wa-Minna-Kawaisou/37A/1", {
"url": "5f95140ff511d8497e2ec08fa7267c6bb231faec",
"url": "32d88382fcad66859d089cd9a61249f375492ec5",
"keyword": "705d941a150765edb33cd2707074bd703a93788c",
"content": "0e37b1995708ffc175f2e175d91a518e6948c379",
"content": "a791dda85ac0d37e3b36d754560cbb65b8dab5b9",
}),
("http://raw.senmanga.com/Love-Lab/2016-03/1", {
"url": "8347b9f00c14b864dd3c19a1f5ae52adb2ef00de",
"keyword": "0765e9d81b7430b3055b25a2627d6438f62de635",
"url": "d4f37c7347e56a09f9679d63c1f24cd32621d0b8",
"keyword": "4e72e4ade57671ad0af9c8d81feeff4259d5bbec",
}),
]
url_base = "https://raw.senmanga.com"
url_base = "http://raw.senmanga.com"

def __init__(self, match):
Extractor.__init__(self)
part = match.group(1)
self.chapter_url = "{}/{}/".format(self.url_base, part)
self.img_url = "{}/viewer/{}/".format(self.url_base, part)
self.session.headers["Referer"] = self.chapter_url
self.session.headers["User-Agent"] = "Mozilla/5.0"
self.session.headers["User-Agent"] = "Mozilla 5.0"

def items(self):
data = self.get_job_metadata()
Expand All @@ -51,13 +51,13 @@ def items(self):
def get_job_metadata(self):
"""Collect metadata for extractor-job"""
page = self.request(self.chapter_url).text
self.session.cookies.clear()
title, pos = text.extract(page, '<title>', '</title>')
count, pos = text.extract(page, '</select> of ', '\n', pos)
manga, _, chapter = title.partition(" - Chapter ")
count, pos = text.extract(page, '</select> of ', ' ', pos)
manga, pos = text.extract(title, '| Raw | ', ' | Chapter ')
chapter, pos = text.extract(title, '', ' | Page ', pos)
return {
"manga": text.unescape(manga),
"chapter_string": chapter.partition(" - Page ")[0],
"manga": text.unescape(manga.replace("-", " ")),
"chapter_string": chapter,
"count": util.safe_int(count),
"lang": "jp",
"language": "Japanese",
Expand Down

0 comments on commit c4fcdf2

Please sign in to comment.