Files
ProxyPool/app/plugins/__init__.py

49 lines
1.8 KiB
Python

"""插件包 - 在这里显式注册所有爬虫插件"""
from app.core.plugin_system import registry
from .fate0 import Fate0Plugin
from .proxylist_download import ProxyListDownloadPlugin
from .ip3366 import Ip3366Plugin
from .ip89 import Ip89Plugin
from .kuaidaili import KuaiDaiLiPlugin
from .speedx import SpeedXPlugin
from .yundaili import YunDaiLiPlugin
from .proxyscrape import ProxyScrapePlugin
from .fpw_proxy_list_download import FpwProxyListDownloadPlugin
from .fpw_socks_ssl_proxy import FpwSocksSslProxyPlugin
from .fpw_spys_one import FpwSpysOnePlugin
from .fpw_proxynova import FpwProxynovaPlugin
from .fpw_hidemy import FpwHidemyPlugin
from .fpw_premproxy import FpwPremproxyPlugin
from .fpw_freeproxylists import FpwFreeproxylistsPlugin
from .fpw_gatherproxy import FpwGatherproxyPlugin
from .fpw_checkerproxy import FpwCheckerproxyPlugin
# 显式注册所有插件
registry.register(Fate0Plugin)
registry.register(ProxyListDownloadPlugin)
registry.register(Ip3366Plugin)
registry.register(Ip89Plugin)
registry.register(KuaiDaiLiPlugin)
registry.register(SpeedXPlugin)
registry.register(YunDaiLiPlugin)
registry.register(ProxyScrapePlugin)
registry.register(FpwProxyListDownloadPlugin)
registry.register(FpwSocksSslProxyPlugin)
registry.register(FpwSpysOnePlugin)
registry.register(FpwProxynovaPlugin)
registry.register(FpwHidemyPlugin)
registry.register(FpwPremproxyPlugin)
registry.register(FpwFreeproxylistsPlugin)
registry.register(FpwGatherproxyPlugin)
registry.register(FpwCheckerproxyPlugin)
# 可选:从 config 的 plugins_dir 加载用户插件(根目录下目录,非 app/plugins 包)
from pathlib import Path
from app.core.config import settings as _app_settings
from app.core.config_paths import project_root as _project_root
_ext_dir = _project_root() / _app_settings.plugins_dir
registry.load_external_plugins_directory(_ext_dir)