mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 04:02:32 +01:00
fix bug in test_init and update example URLs
This commit is contained in:
parent
24a1d46391
commit
27ec653991
@ -96,7 +96,7 @@ class BloggerPostExtractor(BloggerExtractor):
|
||||
"""Extractor for a single blog post"""
|
||||
subcategory = "post"
|
||||
pattern = BASE_PATTERN + r"(/\d\d\d\d/\d\d/[^/?#]+\.html)"
|
||||
example = "https://BLOG.blogspot.com/YYYY/MM/TITLE.html"
|
||||
example = "https://BLOG.blogspot.com/1970/01/TITLE.html"
|
||||
|
||||
def __init__(self, match):
|
||||
BloggerExtractor.__init__(self, match)
|
||||
|
@ -25,7 +25,7 @@ class ComicvineTagExtractor(BooruExtractor):
|
||||
archive_fmt = "{id}"
|
||||
pattern = (r"(?:https?://)?comicvine\.gamespot\.com"
|
||||
r"(/([^/?#]+)/(\d+-\d+)/images/.*)")
|
||||
example = "https://comicvine.gamespot.com/TAG/ID/images/"
|
||||
example = "https://comicvine.gamespot.com/TAG/123-45/images/"
|
||||
|
||||
def __init__(self, match):
|
||||
BooruExtractor.__init__(self, match)
|
||||
|
@ -80,7 +80,7 @@ class FapelloPathExtractor(Extractor):
|
||||
pattern = (r"(?:https?://)?(?:www\.)?fapello\.com"
|
||||
r"/(?!search/?$)(top-(?:likes|followers)|videos|trending"
|
||||
r"|popular_videos/[^/?#]+)/?$")
|
||||
example = "https://fapello.com/PATH/"
|
||||
example = "https://fapello.com/trending/"
|
||||
|
||||
def __init__(self, match):
|
||||
Extractor.__init__(self, match)
|
||||
|
@ -53,7 +53,7 @@ class FoolslideChapterExtractor(FoolslideExtractor):
|
||||
"{manga}_c{chapter:>03}{chapter_minor:?//}_{page:>03}.{extension}")
|
||||
archive_fmt = "{id}"
|
||||
pattern = BASE_PATTERN + r"(/read/[^/?#]+/[a-z-]+/\d+/\d+(?:/\d+)?)"
|
||||
example = "https://read.powermanga.org/read/MANGA/en/0/CHAPTER/"
|
||||
example = "https://read.powermanga.org/read/MANGA/en/0/123/"
|
||||
|
||||
def items(self):
|
||||
page = self.request(self.gallery_url).text
|
||||
|
@ -215,9 +215,10 @@ class GelbooruRedirectExtractor(GelbooruBase, Extractor):
|
||||
|
||||
def __init__(self, match):
|
||||
Extractor.__init__(self, match)
|
||||
self.redirect_url = text.ensure_http_scheme(
|
||||
binascii.a2b_base64(match.group(1)).decode())
|
||||
self.url_base64 = match.group(1)
|
||||
|
||||
def items(self):
|
||||
url = text.ensure_http_scheme(binascii.a2b_base64(
|
||||
self.url_base64).decode())
|
||||
data = {"_extractor": GelbooruPostExtractor}
|
||||
yield Message.Queue, self.redirect_url, data
|
||||
yield Message.Queue, url, data
|
||||
|
@ -111,7 +111,7 @@ class GelbooruV01FavoriteExtractor(GelbooruV01Extractor):
|
||||
archive_fmt = "f_{favorite_id}_{id}"
|
||||
per_page = 50
|
||||
pattern = BASE_PATTERN + r"/index\.php\?page=favorites&s=view&id=(\d+)"
|
||||
example = "https://allgirl.booru.org/index.php?page=favorites&s=view&id=N"
|
||||
example = "https://allgirl.booru.org/index.php?page=favorites&s=view&id=1"
|
||||
|
||||
def __init__(self, match):
|
||||
GelbooruV01Extractor.__init__(self, match)
|
||||
|
@ -232,7 +232,7 @@ class HentaifoundryRecentExtractor(HentaifoundryExtractor):
|
||||
directory_fmt = ("{category}", "Recent Pictures", "{date}")
|
||||
archive_fmt = "r_{index}"
|
||||
pattern = BASE_PATTERN + r"/pictures/recent/(\d\d\d\d-\d\d-\d\d)"
|
||||
example = "https://www.hentai-foundry.com/pictures/recent/YYYY-MM-DD"
|
||||
example = "https://www.hentai-foundry.com/pictures/recent/1970-01-01"
|
||||
|
||||
def __init__(self, match):
|
||||
HentaifoundryExtractor.__init__(self, match)
|
||||
|
@ -246,8 +246,8 @@ class PostimgGalleryExtractor(ImagehostImageExtractor):
|
||||
"""Extractor for images galleries from postimages.org"""
|
||||
category = "postimg"
|
||||
subcategory = "gallery"
|
||||
pattern = (r"(?:https?://)?((?:www\.)?(?:postimg|pixxxels)\.(?:cc|org)"
|
||||
r"/(?:gallery/)([^/?#]+)/?)")
|
||||
pattern = (r"(?:https?://)?((?:www\.)?(?:postim(?:ages|g)|pixxxels)"
|
||||
r"\.(?:cc|org)/gallery/([^/?#]+))")
|
||||
example = "https://postimages.org/gallery/ID"
|
||||
|
||||
def items(self):
|
||||
|
@ -135,7 +135,7 @@ class InkbunnyFavoriteExtractor(InkbunnyExtractor):
|
||||
r"userfavorites_process\.php\?favs_user_id=(\d+)|"
|
||||
r"submissionsviewall\.php\?([^#]+&mode=userfavs&[^#]+))")
|
||||
example = ("https://inkbunny.net/userfavorites_process.php"
|
||||
"?mode=userfavs&favs_user_id=12345")
|
||||
"?favs_user_id=12345")
|
||||
|
||||
def __init__(self, match):
|
||||
InkbunnyExtractor.__init__(self, match)
|
||||
@ -167,7 +167,7 @@ class InkbunnySearchExtractor(InkbunnyExtractor):
|
||||
pattern = (BASE_PATTERN +
|
||||
r"/submissionsviewall\.php\?([^#]+&mode=search&[^#]+)")
|
||||
example = ("https://inkbunny.net/submissionsviewall.php"
|
||||
"?mode=search&text=TAG")
|
||||
"?text=TAG&mode=search&type=")
|
||||
|
||||
def __init__(self, match):
|
||||
InkbunnyExtractor.__init__(self, match)
|
||||
|
@ -469,7 +469,7 @@ class InstagramGuideExtractor(InstagramExtractor):
|
||||
"""Extractor for an Instagram guide"""
|
||||
subcategory = "guide"
|
||||
pattern = USER_PATTERN + r"/guide/[^/?#]+/(\d+)"
|
||||
example = "https://www.instagram.com/USER/guide/"
|
||||
example = "https://www.instagram.com/USER/guide/NAME/12345"
|
||||
|
||||
def __init__(self, match):
|
||||
InstagramExtractor.__init__(self, match)
|
||||
|
@ -267,7 +267,7 @@ class KemonopartyDiscordExtractor(KemonopartyExtractor):
|
||||
filename_fmt = "{id}_{num:>02}_{filename}.{extension}"
|
||||
archive_fmt = "discord_{server}_{id}_{num}"
|
||||
pattern = BASE_PATTERN + r"/discord/server/(\d+)(?:/channel/(\d+))?#(.*)"
|
||||
example = "https://kemono.party/discard/server/12345/channel/12345"
|
||||
example = "https://kemono.party/discord/server/12345#CHANNEL"
|
||||
|
||||
def __init__(self, match):
|
||||
KemonopartyExtractor.__init__(self, match)
|
||||
@ -346,7 +346,7 @@ class KemonopartyDiscordExtractor(KemonopartyExtractor):
|
||||
class KemonopartyDiscordServerExtractor(KemonopartyExtractor):
|
||||
subcategory = "discord-server"
|
||||
pattern = BASE_PATTERN + r"/discord/server/(\d+)$"
|
||||
example = "https://kemono.party/discard/server/12345"
|
||||
example = "https://kemono.party/discord/server/12345"
|
||||
|
||||
def __init__(self, match):
|
||||
KemonopartyExtractor.__init__(self, match)
|
||||
|
@ -48,7 +48,7 @@ class KomikcastBase():
|
||||
class KomikcastChapterExtractor(KomikcastBase, ChapterExtractor):
|
||||
"""Extractor for manga-chapters from komikcast.site"""
|
||||
pattern = BASE_PATTERN + r"(/chapter/[^/?#]+/)"
|
||||
example = "https://komikcast.site/chapter/TITLE"
|
||||
example = "https://komikcast.site/chapter/TITLE/"
|
||||
|
||||
def metadata(self, page):
|
||||
info = text.extr(page, "<title>", " - Komikcast<")
|
||||
|
@ -83,7 +83,7 @@ class MangaparkMangaExtractor(MangaparkBase, Extractor):
|
||||
"""Extractor for manga from mangapark.net"""
|
||||
subcategory = "manga"
|
||||
pattern = BASE_PATTERN + r"/title/(\d+)(?:-[^/?#]*)?/?$"
|
||||
example = "https://mangapark.net/title/MANGA"
|
||||
example = "https://mangapark.net/title/12345-MANGA"
|
||||
|
||||
def __init__(self, match):
|
||||
self.root = text.root_from_url(match.group(0))
|
||||
|
@ -349,7 +349,7 @@ class NewgroundsMoviesExtractor(NewgroundsExtractor):
|
||||
"""Extractor for all movies of a newgrounds user"""
|
||||
subcategory = _path = "movies"
|
||||
pattern = r"(?:https?://)?([\w-]+)\.newgrounds\.com/movies/?$"
|
||||
example = "https://USER.newgrounds.com/movies<"
|
||||
example = "https://USER.newgrounds.com/movies"
|
||||
|
||||
|
||||
class NewgroundsGamesExtractor(NewgroundsExtractor):
|
||||
|
@ -244,7 +244,7 @@ class RedditSubmissionExtractor(RedditExtractor):
|
||||
pattern = (r"(?:https?://)?(?:"
|
||||
r"(?:\w+\.)?reddit\.com/(?:(?:r|u|user)/[^/?#]+"
|
||||
r"/comments|gallery)|redd\.it)/([a-z0-9]+)")
|
||||
example = "https://www.reddit.com/r/SUBREDDIT/comments/ID/"
|
||||
example = "https://www.reddit.com/r/SUBREDDIT/comments/id/"
|
||||
|
||||
def __init__(self, match):
|
||||
RedditExtractor.__init__(self, match)
|
||||
|
@ -21,7 +21,7 @@ class WebmshareVideoExtractor(Extractor):
|
||||
archive_fmt = "{id}"
|
||||
pattern = (r"(?:https?://)?(?:s\d+\.)?webmshare\.com"
|
||||
r"/(?:play/|download-webm/)?(\w{3,})")
|
||||
example = "https://webmshare.com/ID"
|
||||
example = "https://webmshare.com/_ID_"
|
||||
|
||||
def __init__(self, match):
|
||||
Extractor.__init__(self, match)
|
||||
|
@ -144,7 +144,6 @@ class TestExtractorModule(unittest.TestCase):
|
||||
extr = cls.from_url(cls.example)
|
||||
extr.initialize()
|
||||
extr.finalize()
|
||||
break
|
||||
|
||||
@unittest.skipIf(sys.hexversion < 0x3060000, "test fails in CI")
|
||||
def test_init_ytdl(self):
|
||||
|
Loading…
Reference in New Issue
Block a user