aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/reactor.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/reactor.py')
-rw-r--r--gallery_dl/extractor/reactor.py23
1 files changed, 6 insertions, 17 deletions
diff --git a/gallery_dl/extractor/reactor.py b/gallery_dl/extractor/reactor.py
index aa0ba6d..971347b 100644
--- a/gallery_dl/extractor/reactor.py
+++ b/gallery_dl/extractor/reactor.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2019-2020 Mike Fährmann
+# Copyright 2019-2021 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
@@ -11,11 +11,8 @@
from .common import Extractor, Message
from .. import text
import urllib.parse
-import random
-import time
import json
-
BASE_PATTERN = r"(?:https?://)?((?:[^/.]+\.)?reactor\.cc)"
@@ -24,17 +21,14 @@ class ReactorExtractor(Extractor):
basecategory = "reactor"
filename_fmt = "{post_id}_{num:>02}{title[:100]:?_//}.{extension}"
archive_fmt = "{post_id}_{num}"
+ instances = ()
+ request_interval = 5.0
def __init__(self, match):
Extractor.__init__(self, match)
self.root = "http://" + match.group(1)
self.session.headers["Referer"] = self.root
- self.wait_min = self.config("wait-min", 3)
- self.wait_max = self.config("wait-max", 6)
- if self.wait_max < self.wait_min:
- self.wait_max = self.wait_min
-
if not self.category:
# set category based on domain name
netloc = urllib.parse.urlsplit(self.root).netloc
@@ -60,8 +54,6 @@ class ReactorExtractor(Extractor):
def _pagination(self, url):
while True:
- time.sleep(random.uniform(self.wait_min, self.wait_max))
-
response = self.request(url)
if response.history:
# sometimes there is a redirect from
@@ -231,11 +223,11 @@ class JoyreactorSearchExtractor(ReactorSearchExtractor):
category = "joyreactor"
pattern = JR_BASE_PATTERN + r"/search(?:/|\?q=)([^/?#]+)"
test = (
- ("http://joyreactor.cc/search/Cirno", {
+ ("http://joyreactor.cc/search/Nature", {
"range": "1-25",
"count": ">= 20",
}),
- ("http://joyreactor.com/search?q=Cirno", {
+ ("http://joyreactor.com/search?q=Nature", {
"range": "1-25",
"count": ">= 20",
}),
@@ -305,10 +297,7 @@ class PornreactorSearchExtractor(ReactorSearchExtractor):
category = "pornreactor"
pattern = PR_BASE_PATTERN + r"/search(?:/|\?q=)([^/?#]+)"
test = (
- ("http://pornreactor.cc/search?q=ecchi+hentai", {
- "range": "1-25",
- "count": ">= 25",
- }),
+ ("http://pornreactor.cc/search?q=ecchi+hentai"),
("http://fapreactor.com/search/ecchi+hentai"),
)