| 1 |
|
| 2 |
|
| 3 |
n |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
"""Extractors for https://hdoujin.org/""" |
| 10 |
|
| 11 |
from . import schalenetwork |
| 12 |
|
| 13 |
BASE_PATTERN = r"(?:https?://)?(?:www\.)?(hdoujin\.(?:org|net))" |
| 14 |
|
| 15 |
|
| 16 |
class HdoujinBase(): |
| 17 |
"""Base class for hdoujin extractors""" |
| 18 |
category = "hdoujin" |
| 19 |
root = "https://hdoujin.org" |
| 20 |
root_api = "https://api.hdoujin.org" |
| 21 |
root_auth = "https://auth.hdoujin.org" |
| 22 |
|
| 23 |
|
| 24 |
class HdoujinGalleryExtractor( |
| 25 |
HdoujinBase, schalenetwork.SchalenetworkGalleryExtractor): |
| 26 |
pattern = BASE_PATTERN + r"/(?:g|reader)/(\d+)/(\w+)" |
| 27 |
example = "https://hdoujin.org/g/12345/67890abcdef/" |
| 28 |
|
| 29 |
|
| 30 |
class HdoujinSearchExtractor( |
| 31 |
HdoujinBase, schalenetwork.SchalenetworkSearchExtractor): |
| 32 |
pattern = BASE_PATTERN + r"/(?:tag/([^/?#]+)|browse)?(?:/?\?([^#]*))?$" |
| 33 |
example = "https://hdoujin.org/browse?s=QUERY" |
| 34 |
|
| 35 |
|
| 36 |
class HdoujinFavoriteExtractor( |
| 37 |
HdoujinBase, schalenetwork.SchalenetworkFavoriteExtractor): |
| 38 |
pattern = BASE_PATTERN + r"/favorites(?:\?([^#]*))?" |
| 39 |
example = "https://hdoujin.org/favorites" |
| 40 |
|
| 41 |
|
| 42 |
HdoujinBase.extr_class = HdoujinGalleryExtractor |