use 'v[0] == "c"' instead of 'v.startswith("c")'
This commit is contained in:
@@ -401,7 +401,7 @@ class DeviantartExtractor(Extractor):
|
||||
html = content["html"]
|
||||
markup = html["markup"]
|
||||
|
||||
if not markup.startswith("{"):
|
||||
if not markup or markup[0] != "{":
|
||||
return markup
|
||||
|
||||
if html["type"] == "tiptap":
|
||||
|
||||
@@ -260,9 +260,9 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor):
|
||||
"torrentcount" : extr('>Torrent Download (', ')'),
|
||||
}
|
||||
|
||||
if data["uploader"].startswith("<"):
|
||||
data["uploader"] = text.unescape(text.extr(
|
||||
data["uploader"], ">", "<"))
|
||||
uploader = data["uploader"]
|
||||
if uploader and uploader[0] == "<":
|
||||
data["uploader"] = text.unescape(text.extr(uploader, ">", "<"))
|
||||
|
||||
f = data["favorites"][0]
|
||||
if f == "N":
|
||||
|
||||
@@ -37,7 +37,7 @@ class FoolfuukaExtractor(BaseExtractor):
|
||||
|
||||
if not url and "remote_media_link" in media:
|
||||
url = self.remote(media)
|
||||
if url.startswith("/"):
|
||||
if url and url[0] == "/":
|
||||
url = self.root + url
|
||||
|
||||
post["filename"], _, post["extension"] = \
|
||||
|
||||
@@ -19,7 +19,7 @@ BASE_PATTERN = r"(?:https?://)?(?:ww[\dw]?\.)?mangakakalot\.tv"
|
||||
class MangakakalotBase():
|
||||
"""Base class for mangakakalot extractors"""
|
||||
category = "mangakakalot"
|
||||
root = "https://ww6.mangakakalot.tv"
|
||||
root = "https://ww8.mangakakalot.tv"
|
||||
|
||||
|
||||
class MangakakalotChapterExtractor(MangakakalotBase, ChapterExtractor):
|
||||
@@ -40,7 +40,7 @@ class MangakakalotChapterExtractor(MangakakalotBase, ChapterExtractor):
|
||||
match = re.match(
|
||||
r"(?:[Vv]ol\. *(\d+) )?"
|
||||
r"[Cc]hapter *([^:]*)"
|
||||
r"(?:: *(.+))?", info)
|
||||
r"(?:: *(.+))?", info or "")
|
||||
volume, chapter, title = match.groups() if match else ("", "", info)
|
||||
chapter, sep, minor = chapter.partition(".")
|
||||
|
||||
@@ -86,7 +86,7 @@ class MangakakalotMangaExtractor(MangakakalotBase, MangaExtractor):
|
||||
data["chapter"] = text.parse_int(chapter)
|
||||
data["chapter_minor"] = sep + minor
|
||||
|
||||
if url.startswith("/"):
|
||||
if url[0] == "/":
|
||||
url = self.root + url
|
||||
results.append((url, data.copy()))
|
||||
return results
|
||||
|
||||
@@ -50,7 +50,7 @@ class PostmillExtractor(BaseExtractor):
|
||||
forum = match.group(1)
|
||||
id = int(match.group(2))
|
||||
|
||||
is_text_post = url.startswith("/")
|
||||
is_text_post = (url[0] == "/")
|
||||
is_image_post = self._search_image_tag(page) is not None
|
||||
data = {
|
||||
"title": title,
|
||||
|
||||
@@ -49,7 +49,7 @@ class TelegraphGalleryExtractor(GalleryExtractor):
|
||||
url, pos = text.extract(figure, 'src="', '"')
|
||||
if url.startswith("/embed/"):
|
||||
continue
|
||||
elif url.startswith("/"):
|
||||
elif url[0] == "/":
|
||||
url = self.root + url
|
||||
caption, pos = text.extract(figure, "<figcaption>", "<", pos)
|
||||
num += 1
|
||||
|
||||
@@ -148,8 +148,10 @@ class TsuminoSearchExtractor(TsuminoBase, Extractor):
|
||||
data["PageNumber"] += 1
|
||||
|
||||
def _parse(self, query):
|
||||
if not query:
|
||||
return {}
|
||||
try:
|
||||
if query.startswith("?"):
|
||||
if query[0] == "?":
|
||||
return self._parse_simple(query)
|
||||
return self._parse_jsurl(query)
|
||||
except Exception as exc:
|
||||
@@ -187,8 +189,6 @@ class TsuminoSearchExtractor(TsuminoBase, Extractor):
|
||||
Example: ~(name~'John*20Doe~age~42~children~(~'Mary~'Bill))
|
||||
Ref: https://github.com/Sage/jsurl
|
||||
"""
|
||||
if not data:
|
||||
return {}
|
||||
i = 0
|
||||
imax = len(data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user