summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/__init__.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2023-03-13 02:07:49 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2023-03-13 02:07:49 -0400
commit10987f08f8b6c510ba64f4b42d95ba67eec6e5b0 (patch)
tree1af82cad9ac859a70cafc976a980280b939cfcc7 /gallery_dl/extractor/__init__.py
parent919f8ba16a7b82ba1099bd25b2c61c7881a05aa2 (diff)
New upstream version 1.25.0.upstream/1.25.0
Diffstat (limited to 'gallery_dl/extractor/__init__.py')
-rw-r--r--gallery_dl/extractor/__init__.py40
1 files changed, 31 insertions, 9 deletions
diff --git a/gallery_dl/extractor/__init__.py b/gallery_dl/extractor/__init__.py
index 6140c2c..3968d72 100644
--- a/gallery_dl/extractor/__init__.py
+++ b/gallery_dl/extractor/__init__.py
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
-# Copyright 2015-2022 Mike Fährmann
+# Copyright 2015-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
# published by the Free Software Foundation.
+import sys
import re
modules = [
@@ -34,6 +35,7 @@ modules = [
"desktopography",
"deviantart",
"dynastyscans",
+ "e621",
"erome",
"exhentai",
"fallenangels",
@@ -92,6 +94,7 @@ modules = [
"mangasee",
"mangoxo",
"mememuseum",
+ "misskey",
"myhentaigallery",
"myportfolio",
"nana",
@@ -118,6 +121,7 @@ modules = [
"plurk",
"poipiku",
"pornhub",
+ "pornpics",
"pururin",
"reactor",
"readcomiconline",
@@ -137,6 +141,7 @@ modules = [
"soundgasm",
"speakerdeck",
"subscribestar",
+ "szurubooru",
"tapas",
"tcbscans",
"telegraph",
@@ -217,20 +222,33 @@ def extractors():
# --------------------------------------------------------------------
# internals
-_cache = []
-_module_iter = iter(modules)
-
def _list_classes():
- """Yield all available extractor classes"""
+ """Yield available extractor classes"""
yield from _cache
- globals_ = globals()
- for module_name in _module_iter:
- module = __import__(module_name, globals_, None, (), 1)
+ for module in _module_iter:
yield from add_module(module)
- globals_["_list_classes"] = lambda : _cache
+ globals()["_list_classes"] = lambda : _cache
+
+
+def _modules_internal():
+ globals_ = globals()
+ for module_name in modules:
+ yield __import__(module_name, globals_, None, (), 1)
+
+
+def _modules_path(path, files):
+ sys.path.insert(0, path)
+ try:
+ return [
+ __import__(name[:-3])
+ for name in files
+ if name.endswith(".py")
+ ]
+ finally:
+ del sys.path[0]
def _get_classes(module):
@@ -240,3 +258,7 @@ def _get_classes(module):
hasattr(cls, "pattern") and cls.__module__ == module.__name__
)
]
+
+
+_cache = []
+_module_iter = _modules_internal()