diff --git a/gallery-dl.conf b/gallery-dl.conf index 5ad10b97..305a8c6b 100644 --- a/gallery-dl.conf +++ b/gallery-dl.conf @@ -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 }, diff --git a/gallery_dl/extractor/3dbooru.py b/gallery_dl/extractor/3dbooru.py index a7986880..9376d76d 100644 --- a/gallery_dl/extractor/3dbooru.py +++ b/gallery_dl/extractor/3dbooru.py @@ -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+)"] diff --git a/gallery_dl/extractor/danbooru.py b/gallery_dl/extractor/danbooru.py index 389fd4a2..7da1247a 100644 --- a/gallery_dl/extractor/danbooru.py +++ b/gallery_dl/extractor/danbooru.py @@ -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+)"] diff --git a/gallery_dl/extractor/e621.py b/gallery_dl/extractor/e621.py index c39c86aa..45f8cec3 100644 --- a/gallery_dl/extractor/e621.py +++ b/gallery_dl/extractor/e621.py @@ -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+)"] diff --git a/gallery_dl/extractor/gelbooru.py b/gallery_dl/extractor/gelbooru.py index bcf6acee..0c217996 100644 --- a/gallery_dl/extractor/gelbooru.py +++ b/gallery_dl/extractor/gelbooru.py @@ -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+)"] diff --git a/gallery_dl/extractor/hentaifoundry.py b/gallery_dl/extractor/hentaifoundry.py index 2811d942..fdbc1956 100644 --- a/gallery_dl/extractor/hentaifoundry.py +++ b/gallery_dl/extractor/hentaifoundry.py @@ -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/" diff --git a/gallery_dl/extractor/kissmanga.py b/gallery_dl/extractor/kissmanga.py index 8da25aa9..c8054b74 100644 --- a/gallery_dl/extractor/kissmanga.py +++ b/gallery_dl/extractor/kissmanga.py @@ -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): diff --git a/gallery_dl/extractor/konachan.py b/gallery_dl/extractor/konachan.py index c6f0048e..0c0b65ea 100644 --- a/gallery_dl/extractor/konachan.py +++ b/gallery_dl/extractor/konachan.py @@ -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+)"] diff --git a/gallery_dl/extractor/mangahere.py b/gallery_dl/extractor/mangahere.py index 0348a3b6..a0b6cc0a 100644 --- a/gallery_dl/extractor/mangahere.py +++ b/gallery_dl/extractor/mangahere.py @@ -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/" diff --git a/gallery_dl/extractor/mangamint.py b/gallery_dl/extractor/mangamint.py index 5c976d5a..3142629f 100644 --- a/gallery_dl/extractor/mangamint.py +++ b/gallery_dl/extractor/mangamint.py @@ -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+))"] diff --git a/gallery_dl/extractor/mangapanda.py b/gallery_dl/extractor/mangapanda.py index 0fb54382..9421bb53 100644 --- a/gallery_dl/extractor/mangapanda.py +++ b/gallery_dl/extractor/mangapanda.py @@ -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)", diff --git a/gallery_dl/extractor/mangareader.py b/gallery_dl/extractor/mangareader.py index 8b4df746..e593546e 100644 --- a/gallery_dl/extractor/mangareader.py +++ b/gallery_dl/extractor/mangareader.py @@ -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)", diff --git a/gallery_dl/extractor/mangashare.py b/gallery_dl/extractor/mangashare.py index 277c6f9a..01018ad5 100644 --- a/gallery_dl/extractor/mangashare.py +++ b/gallery_dl/extractor/mangashare.py @@ -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+)"] diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py index 91a9c011..ae2ef53c 100644 --- a/gallery_dl/extractor/pixiv.py +++ b/gallery_dl/extractor/pixiv.py @@ -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): diff --git a/gallery_dl/extractor/safebooru.py b/gallery_dl/extractor/safebooru.py index 4f09ae42..4e0d2d9a 100644 --- a/gallery_dl/extractor/safebooru.py +++ b/gallery_dl/extractor/safebooru.py @@ -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+)"] diff --git a/gallery_dl/extractor/yandere.py b/gallery_dl/extractor/yandere.py index c14dabab..9e2139ce 100644 --- a/gallery_dl/extractor/yandere.py +++ b/gallery_dl/extractor/yandere.py @@ -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+)"]