1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

add subcategories to extractors

This commit is contained in:
Mike Fährmann 2015-11-30 01:11:13 +01:00
parent 81dcfbec90
commit f7c47a6018
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
16 changed files with 46 additions and 1 deletions

View File

@ -4,7 +4,14 @@
{
"pixiv":
{
"directory_fmt": ["{category}", "{artist-id}"],
"user":
{
"directory_fmt": ["{category}", "{artist-id}"]
},
"bookmark":
{
"directory_fmt": ["{category}", "my bookmarks"]
},
"username": null,
"password": null
},

View File

@ -21,12 +21,15 @@ class ThreeDeeBooruExtractor(booru.JSONBooruExtractor):
class ThreeDeeBooruTagExtractor(ThreeDeeBooruExtractor, booru.BooruTagExtractor):
"""Extract images from 3dbooru based on search-tags"""
subcategory = "tag"
pattern = [r"(?:https?://)?(?:www\.)?behoimi\.org/post(?:/(?:index)?)?\?tags=([^&]+)"]
class ThreeDeeBooruPoolExtractor(ThreeDeeBooruExtractor, booru.BooruPoolExtractor):
"""Extract image-pools from 3dbooru"""
subcategory = "pool"
pattern = [r"(?:https?://)?(?:www\.)?behoimi\.org/pool/show/(\d+)"]
class ThreeDeeBooruPostExtractor(ThreeDeeBooruExtractor, booru.BooruPostExtractor):
"""Extract single images from 3dbooru"""
subcategory = "post"
pattern = [r"(?:https?://)?(?:www\.)?behoimi\.org/post/show/(\d+)"]

View File

@ -17,12 +17,15 @@ class DanbooruExtractor(booru.JSONBooruExtractor):
class DanbooruTagExtractor(DanbooruExtractor, booru.BooruTagExtractor):
"""Extract images from danbooru based on search-tags"""
subcategory = "tag"
pattern = [r"(?:https?://)?(?:www\.)?danbooru.donmai.us/posts\?(?:utf8=%E2%9C%93&)?tags=([^&]+)"]
class DanbooruPoolExtractor(DanbooruExtractor, booru.BooruPoolExtractor):
"""Extract image-pools from danbooru"""
subcategory = "pool"
pattern = [r"(?:https?://)?(?:www\.)?danbooru.donmai.us/pools/(\d+)"]
class DanbooruPostExtractor(DanbooruExtractor, booru.BooruPostExtractor):
"""Extract single images from danbooru"""
subcategory = "post"
pattern = [r"(?:https?://)?(?:www\.)?danbooru.donmai.us/posts/(\d+)"]

View File

@ -17,6 +17,7 @@ class E621Extractor(booru.JSONBooruExtractor):
class E621TagExtractor(E621Extractor, booru.BooruTagExtractor):
"""Extract images from e621 based on search-tags"""
subcategory = "tag"
pattern = [
r"(?:https?://)?(?:www\.)?e621\.net/post/index/\d+/([^?]+)",
r"(?:https?://)?(?:www\.)?e621\.net/post\?tags=([^&]+)",
@ -24,8 +25,10 @@ class E621TagExtractor(E621Extractor, booru.BooruTagExtractor):
class E621PoolExtractor(E621Extractor, booru.BooruPoolExtractor):
"""Extract image-pools from e621"""
subcategory = "pool"
pattern = [r"(?:https?://)?(?:www\.)?e621\.net/pool/show/(\d+)"]
class E621PostExtractor(E621Extractor, booru.BooruPostExtractor):
"""Extract single images from e621"""
subcategory = "post"
pattern = [r"(?:https?://)?(?:www\.)?e621\.net/post/show/(\d+)"]

View File

@ -31,13 +31,16 @@ class GelbooruExtractor(booru.XMLBooruExtractor):
class GelbooruTagExtractor(GelbooruExtractor, booru.BooruTagExtractor):
"""Extract images from gelbooru based on search-tags"""
subcategory = "tag"
pattern = [r"(?:https?://)?(?:www\.)?gelbooru\.com/(?:index\.php)?\?page=post&s=list&tags=([^&]+)"]
# TODO: find out how to access pools via gelbooru-api
# class GelbooruPoolExtractor(GelbooruExtractor, booru.BooruPoolExtractor):
# """Extract image-pools from gelbooru"""
# subcategory = "pool"
# pattern = [r"(?:https?://)?(?:www\.)?gelbooru\.com/(?:index\.php)?\?page=pool&s=show&id=(\d+)"]
class GelbooruPostExtractor(GelbooruExtractor, booru.BooruPostExtractor):
"""Extract single images from gelbooru"""
subcategory = "post"
pattern = [r"(?:https?://)?(?:www\.)?gelbooru\.com/(?:index\.php)?\?page=post&s=view&id=(\d+)"]

View File

@ -14,6 +14,7 @@ from .. import text
class HentaiFoundryUserExtractor(Extractor):
"""Extract all pictures of a hentaifoundry-user"""
category = "hentaifoundry"
subcategory = "user"
directory_fmt = ["{category}", "{artist}"]
filename_fmt = "{category}_{index}_{title}.{extension}"
pattern = [
@ -103,6 +104,7 @@ class HentaiFoundryUserExtractor(Extractor):
class HentaiFoundryImageExtractor(Extractor):
"""Extract a single hentaifoundry picture"""
category = "hentaifoundry"
subcategory = "image"
directory_fmt = ["{category}", "{artist}"]
filename_fmt = "{category}_{index}_{title}.{extension}"
pattern = [(r"(?:https?://)?(?:www\.)?hentai-foundry\.com/pictures/user/"

View File

@ -26,6 +26,7 @@ class KissmangaExtractor(Extractor):
class KissmangaMangaExtractor(KissmangaExtractor):
"""Extract all manga-chapters from kissmanga"""
subcategory = "manga"
pattern = [r"(?:https?://)?(?:www\.)?kissmanga\.com/Manga/[^/]+/?$"]
def items(self):
@ -44,6 +45,7 @@ class KissmangaMangaExtractor(KissmangaExtractor):
class KissmangaChapterExtractor(KissmangaExtractor):
"""Extract a single manga-chapter from kissmanga"""
subcategory = "chapter"
pattern = [r"(?:https?://)?(?:www\.)?kissmanga\.com/Manga/.+/.+\?id=\d+"]
def items(self):

View File

@ -17,12 +17,15 @@ class KonachanExtractor(booru.JSONBooruExtractor):
class KonachanTagExtractor(KonachanExtractor, booru.BooruTagExtractor):
"""Extract images from konachan based on search-tags"""
subcategory = "tag"
pattern = [r"(?:https?://)?(?:www\.)?konachan\.com/post\?tags=([^&]+)"]
class KonachanPoolExtractor(KonachanExtractor, booru.BooruPoolExtractor):
"""Extract image-pools from konachan"""
subcategory = "pool"
pattern = [r"(?:https?://)?(?:www\.)?konachan\.com/pool/show/(\d+)"]
class KonachanPostExtractor(KonachanExtractor, booru.BooruPostExtractor):
"""Extract single images from konachan"""
subcategory = "post"
pattern = [r"(?:https?://)?(?:www\.)?konachan\.com/post/show/(\d+)"]

View File

@ -15,6 +15,7 @@ import re
class MangaHereMangaExtractor(Extractor):
"""Extract all manga-chapters from mangahere"""
category = "mangahere"
subcategory = "manga"
pattern = [r"(?:https?://)?(?:www\.)?mangahere\.co/manga/([^/]+)/?$"]
def __init__(self, match):
@ -38,6 +39,7 @@ class MangaHereMangaExtractor(Extractor):
class MangaHereChapterExtractor(AsynchronousExtractor):
"""Extract a single manga-chapter from mangahere"""
category = "mangahere"
subcategory = "chapter"
directory_fmt = ["{category}", "{manga}", "c{chapter:>03}{chapter-minor}"]
filename_fmt = "{manga}_c{chapter:>03}{chapter-minor}_{page:>03}.{extension}"
pattern = [(r"(?:https?://)?(?:www\.)?mangahere\.co/manga/"

View File

@ -15,6 +15,7 @@ import re
class MangaMintMangaExtractor(Extractor):
"""Extract all manga-chapters from mangamint"""
category = "mangamint"
subcategory = "manga"
pattern = [r"(?:https?://)?(?:www\.)?mangamint\.com(/manga/[^\?]+-manga)"]
url_base = "https://www.mangamint.com"
@ -45,6 +46,7 @@ class MangaMintMangaExtractor(Extractor):
class MangaMintChapterExtractor(Extractor):
"""Extract a single manga-chapter from mangamint"""
category = "mangamint"
subcategory = "chapter"
directory_fmt = ["{category}", "{manga}", "c{chapter:>03}{chapter-minor}"]
filename_fmt = "{manga}_c{chapter:>03}{chapter-minor}_{page:>03}.{extension}"
pattern = [r"(?:https?://)?(?:www\.)?mangamint\.com/([^\?]+-(\d+))"]

View File

@ -18,11 +18,13 @@ class MangaPandaBase():
class MangaPandaMangaExtractor(MangaPandaBase, MangaReaderMangaExtractor):
"""Extract all manga-chapters from mangapanda"""
subcategory = "manga"
pattern = [r"(?:https?://)?(?:www\.)?mangapanda\.com(/[^/]+)$"]
class MangaPandaChapterExtractor(MangaPandaBase, MangaReaderChapterExtractor):
"""Extract a single manga-chapter from mangapanda"""
subcategory = "chapter"
pattern = [
r"(?:https?://)?(?:www\.)?mangapanda\.com((/[^/]+)/(\d+))",
r"(?:https?://)?(?:www\.)?mangapanda\.com(/\d+-\d+-\d+(/[^/]+)/chapter-(\d+).html)",

View File

@ -21,6 +21,7 @@ class MangaReaderBase():
class MangaReaderMangaExtractor(MangaReaderBase, Extractor):
"""Extract all manga-chapters from mangareader"""
subcategory = "manga"
pattern = [r"(?:https?://)?(?:www\.)?mangareader\.net(/[^/]+)$"]
def __init__(self, match):
@ -39,6 +40,7 @@ class MangaReaderMangaExtractor(MangaReaderBase, Extractor):
class MangaReaderChapterExtractor(MangaReaderBase, AsynchronousExtractor):
"""Extract a single manga-chapter from mangareader"""
subcategory = "chapter"
pattern = [
r"(?:https?://)?(?:www\.)?mangareader\.net((/[^/]+)/(\d+))",
r"(?:https?://)?(?:www\.)?mangareader\.net(/\d+-\d+-\d+(/[^/]+)/chapter-(\d+).html)",

View File

@ -14,6 +14,7 @@ from .. import text
class MangaShareMangaExtractor(Extractor):
"""Extract all manga-chapters from mangashare"""
category = "mangashare"
subcategory = "manga"
pattern = [r"(?:https?://)?read\.mangashare\.com/[^/]+$"]
def __init__(self, match):
@ -36,6 +37,7 @@ class MangaShareMangaExtractor(Extractor):
class MangaShareChapterExtractor(AsynchronousExtractor):
"""Extract a single manga-chapter from mangashare"""
category = "mangashare"
subcategory = "chapter"
directory_fmt = ["{category}", "{manga}", "c{chapter:>03} - {title}"]
filename_fmt = "{manga}_c{chapter:>03}_{page:>03}.{extension}"
pattern = [r"(?:https?://)?read\.mangashare\.com/([^/]+/chapter-\d+)"]

View File

@ -17,6 +17,7 @@ import time
class PixivUserExtractor(Extractor):
"""Extract all works of a single pixiv-user"""
category = "pixiv"
subcategory = "user"
directory_fmt = ["{category}", "{artist-id}-{artist-nick}"]
filename_fmt = "{category}_{artist-id}_{id}{num}.{extension}"
pattern = [r"(?:https?://)?(?:www\.)?pixiv\.net/member(?:_illust)?\.php\?id=(\d+)"]
@ -132,6 +133,7 @@ class PixivUserExtractor(Extractor):
class PixivWorkExtractor(PixivUserExtractor):
"""Extract a single pixiv work/illustration"""
subcategory = "work"
pattern = [(r"(?:https?://)?(?:www\.)?pixiv\.net/member(?:_illust)?\.php"
r"\?(?:[^&]+&)*illust_id=(\d+)")]
@ -151,6 +153,7 @@ class PixivWorkExtractor(PixivUserExtractor):
class PixivFavoriteExtractor(PixivUserExtractor):
"""Extract all favorites/bookmarks of a single pixiv-user"""
subcategory = "favorite"
directory_fmt = ["{category}", "bookmarks", "{artist-id}-{artist-nick}"]
pattern = [r"(?:https?://)?(?:www\.)?pixiv\.net/bookmark\.php\?id=(\d+)"]
@ -164,6 +167,7 @@ class PixivFavoriteExtractor(PixivUserExtractor):
class PixivBookmarkExtractor(PixivFavoriteExtractor):
"""Extract all favorites/bookmarks of your own account"""
subcategory = "bookmark"
pattern = [r"(?:https?://)?(?:www\.)?pixiv\.net/bookmark\.php()$"]
def __init__(self, match):

View File

@ -27,8 +27,10 @@ class SafebooruExtractor(booru.XMLBooruExtractor):
class SafebooruTagExtractor(SafebooruExtractor, booru.BooruTagExtractor):
"""Extract images from safebooru based on search-tags"""
subcategory = "tag"
pattern = [r"(?:https?://)?(?:www\.)?safebooru\.org/(?:index\.php)?\?page=post&s=list&tags=([^&]+)"]
class SafebooruPostExtractor(SafebooruExtractor, booru.BooruPostExtractor):
"""Extract single images from safebooru"""
subcategory = "post"
pattern = [r"(?:https?://)?(?:www\.)?safebooru\.org/(?:index\.php)?\?page=post&s=view&id=(\d+)"]

View File

@ -17,12 +17,15 @@ class YandereExtractor(booru.JSONBooruExtractor):
class YandereTagExtractor(YandereExtractor, booru.BooruTagExtractor):
"""Extract images from yandere based on search-tags"""
subcategory = "tag"
pattern = [r"(?:https?://)?(?:www\.)?yande\.re/post\?tags=([^&]+)"]
class YanderePoolExtractor(YandereExtractor, booru.BooruPoolExtractor):
"""Extract image-pools from yandere"""
subcategory = "pool"
pattern = [r"(?:https?://)?(?:www\.)?yande.re/pool/show/(\d+)"]
class YanderePostExtractor(YandereExtractor, booru.BooruPostExtractor):
"""Extract single images from yandere"""
subcategory = "post"
pattern = [r"(?:https?://)?(?:www\.)?yande.re/post/show/(\d+)"]