summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/rule34us.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/rule34us.py')
-rw-r--r--gallery_dl/extractor/rule34us.py39
1 files changed, 5 insertions, 34 deletions
diff --git a/gallery_dl/extractor/rule34us.py b/gallery_dl/extractor/rule34us.py
index 00b6972..6439a22 100644
--- a/gallery_dl/extractor/rule34us.py
+++ b/gallery_dl/extractor/rule34us.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2021 Mike Fährmann
+# Copyright 2021-2023 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
@@ -10,8 +10,8 @@
from .booru import BooruExtractor
from .. import text
-import re
import collections
+import re
class Rule34usExtractor(BooruExtractor):
@@ -19,8 +19,7 @@ class Rule34usExtractor(BooruExtractor):
root = "https://rule34.us"
per_page = 42
- def __init__(self, match):
- BooruExtractor.__init__(self, match)
+ def _init(self):
self._find_tags = re.compile(
r'<li class="([^-"]+)-tag"[^>]*><a href="[^;"]+;q=([^"]+)').findall
@@ -55,11 +54,7 @@ class Rule34usTagExtractor(Rule34usExtractor):
directory_fmt = ("{category}", "{search_tags}")
archive_fmt = "t_{search_tags}_{id}"
pattern = r"(?:https?://)?rule34\.us/index\.php\?r=posts/index&q=([^&#]+)"
- test = ("https://rule34.us/index.php?r=posts/index&q=[terios]_elysion", {
- "pattern": r"https://img\d*\.rule34\.us"
- r"/images/../../[0-9a-f]{32}\.\w+",
- "count": 10,
- })
+ example = "https://rule34.us/index.php?r=posts/index&q=TAG"
def __init__(self, match):
Rule34usExtractor.__init__(self, match)
@@ -96,31 +91,7 @@ class Rule34usPostExtractor(Rule34usExtractor):
subcategory = "post"
archive_fmt = "{id}"
pattern = r"(?:https?://)?rule34\.us/index\.php\?r=posts/view&id=(\d+)"
- test = (
- ("https://rule34.us/index.php?r=posts/view&id=3709005", {
- "pattern": r"https://img\d*\.rule34\.us/images/14/7b"
- r"/147bee6fc2e13f73f5f9bac9d4930b13\.png",
- "content": "d714342ea84050f82dda5f0c194d677337abafc5",
- }),
- ("https://rule34.us/index.php?r=posts/view&id=4576310", {
- "pattern": r"https://video\.rule34\.us/images/a2/94"
- r"/a294ff8e1f8e0efa041e5dc9d1480011\.mp4",
- "keyword": {
- "extension": "mp4",
- "file_url": str,
- "filename": "a294ff8e1f8e0efa041e5dc9d1480011",
- "height": "3982",
- "id": "4576310",
- "md5": "a294ff8e1f8e0efa041e5dc9d1480011",
- "score": r"re:\d+",
- "tags": "tagme, video",
- "tags_general": "video",
- "tags_metadata": "tagme",
- "uploader": "Anonymous",
- "width": "3184",
- },
- }),
- )
+ example = "https://rule34.us/index.php?r=posts/view&id=12345"
def __init__(self, match):
Rule34usExtractor.__init__(self, match)