summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/hdoujin.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-09-23 07:44:37 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2025-09-23 07:44:37 -0400
commit42b62671fabfdcf983a9575221420d85f7fbcac1 (patch)
treefa6b2af249a7216aae5c70a926c6d08be1ac55a6 /gallery_dl/extractor/hdoujin.py
parent3b7f8716690b7aa1994a9cb387bbc7215e01a4ed (diff)
New upstream version 1.30.8.upstream/1.30.8
Diffstat (limited to 'gallery_dl/extractor/hdoujin.py')
-rw-r--r--gallery_dl/extractor/hdoujin.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/gallery_dl/extractor/hdoujin.py b/gallery_dl/extractor/hdoujin.py
new file mode 100644
index 0000000..080b899
--- /dev/null
+++ b/gallery_dl/extractor/hdoujin.py
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2025 Mike Fährmann
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+
+"""Extractors for https://hdoujin.org/"""
+
+from . import schalenetwork
+
+BASE_PATTERN = r"(?:https?://)?(?:www\.)?(hdoujin\.(?:org|net))"
+
+
+class HdoujinBase():
+ """Base class for hdoujin extractors"""
+ category = "hdoujin"
+ root = "https://hdoujin.org"
+ root_api = "https://api.hdoujin.org"
+ root_auth = "https://auth.hdoujin.org"
+
+
+class HdoujinGalleryExtractor(
+ HdoujinBase, schalenetwork.SchalenetworkGalleryExtractor):
+ pattern = rf"{BASE_PATTERN}/(?:g|reader)/(\d+)/(\w+)"
+ example = "https://hdoujin.org/g/12345/67890abcdef/"
+
+
+class HdoujinSearchExtractor(
+ HdoujinBase, schalenetwork.SchalenetworkSearchExtractor):
+ pattern = rf"{BASE_PATTERN}/(?:tag/([^/?#]+)|browse)?(?:/?\?([^#]*))?$"
+ example = "https://hdoujin.org/browse?s=QUERY"
+
+
+class HdoujinFavoriteExtractor(
+ HdoujinBase, schalenetwork.SchalenetworkFavoriteExtractor):
+ pattern = rf"{BASE_PATTERN}/favorites(?:\?([^#]*))?"
+ example = "https://hdoujin.org/favorites"
+
+
+HdoujinBase.extr_class = HdoujinGalleryExtractor