fix flake8 and other tests

This commit is contained in:
Mike Fährmann
2021-08-12 16:05:26 +02:00
parent 975e1ac6e2
commit ed4b3c48cb
4 changed files with 26 additions and 15 deletions

View File

@@ -1325,7 +1325,7 @@ Description
extractor.luscious.gif
--------------------------
----------------------
Type
``bool``
Default
@@ -1333,7 +1333,7 @@ Default
Description
Format in which to download animated images.
Use ``true`` to download animated images as gifs and ``false``
Use ``true`` to download animated images as gifs and ``false``
to download as mp4 videos.
@@ -1641,7 +1641,7 @@ Description
extractor.reactor.gif
--------------------------
---------------------
Type
``bool``
Default
@@ -1649,7 +1649,7 @@ Default
Description
Format in which to download animated images.
Use ``true`` to download animated images as gifs and ``false``
Use ``true`` to download animated images as gifs and ``false``
to download as mp4 videos.

View File

@@ -799,6 +799,12 @@ Consider all sites to be NSFW unless otherwise known.
<td>Artists, Artist Listings, Artworks, individual Images</td>
<td></td>
</tr>
<tr>
<td>Wikieat</td>
<td>https://wikieat.club/</td>
<td>Boards, Threads</td>
<td></td>
</tr>
<tr>
<td>xHamster</td>
<td>https://xhamster.com/</td>

View File

@@ -131,8 +131,10 @@ class LusciousAlbumExtractor(LusciousExtractor):
image["date"] = text.parse_timestamp(image["created"])
image["id"] = text.parse_int(image["id"])
url = image["url_to_original"] or image["url_to_video"] \
if self.gif else image["url_to_video"] or image["url_to_original"]
url = (image["url_to_original"] or image["url_to_video"]
if self.gif else
image["url_to_video"] or image["url_to_original"])
yield Message.Url, url, text.nameext_from_url(url, image)
def metadata(self):

View File

@@ -12,7 +12,7 @@ from .common import Extractor, Message
from .. import text
class _WikieatThreadExtractor(Extractor):
class WikieatThreadExtractor(Extractor):
"""Extractor for Wikieat threads"""
category = "wikieat"
subcategory = "thread"
@@ -20,16 +20,18 @@ class _WikieatThreadExtractor(Extractor):
filename_fmt = "{time}{num:?-//} {filename}.{extension}"
archive_fmt = "{board}_{thread}_{tim}"
pattern = r"(?:https?://)?wikieat\.club/([^/]+)/res/(\d+)"
test = (
("https://wikieat.club/cel/res/25321.html")
)
test = ("https://wikieat.club/cel/res/25321.html", {
"pattern": r"https://wikieat\.club/cel/src/\d+(-\d)?\.\w+",
"count": ">= 200",
})
def __init__(self, match):
Extractor.__init__(self, match)
self.board, self.thread = match.groups()
def items(self):
url = "https://wikieat.club/{}/res/{}.json".format(self.board, self.thread)
url = "https://wikieat.club/{}/res/{}.json".format(
self.board, self.thread)
posts = self.request(url).json()["posts"]
title = posts[0].get("sub") or text.remove_html(posts[0]["com"])
process = self._process
@@ -62,14 +64,15 @@ class _WikieatThreadExtractor(Extractor):
return Message.Url, url, post
class _WikieatBoardExtractor(Extractor):
class WikieatBoardExtractor(Extractor):
"""Extractor for Wikieat boards"""
category = "wikieat"
subcategory = "board"
pattern = r"(?:https?://)?wikieat\.club/([^/?#]+)/(?:index|catalog|\d+)\.html"
pattern = (r"(?:https?://)?wikieat\.club"
r"/([^/?#]+)/(?:index|catalog|\d+)\.html")
test = (
("https://wikieat.club/cel/index.html", {
"pattern": _WikieatThreadExtractor.pattern,
"pattern": WikieatThreadExtractor.pattern,
"count": ">= 100",
}),
("https://wikieat.club/cel/catalog.html"),
@@ -89,5 +92,5 @@ class _WikieatBoardExtractor(Extractor):
url = "https://wikieat.club/{}/res/{}.html".format(
self.board, thread["no"])
thread["page"] = page["page"]
thread["_extractor"] = _WikieatThreadExtractor
thread["_extractor"] = WikieatThreadExtractor
yield Message.Queue, url, thread