This commit is contained in:
jxxghp 2023-06-09 19:25:12 +08:00
parent 77b755da5f
commit 6925dde254
76 changed files with 137 additions and 102 deletions

View File

@ -1,9 +1,7 @@
from fastapi import APIRouter, Depends, HTTPException, BackgroundTasks from fastapi import APIRouter, Depends, HTTPException, BackgroundTasks
from sqlalchemy.orm import Session
from app import schemas from app import schemas
from app.chain.douban_sync import DoubanSyncChain from app.chain.douban_sync import DoubanSyncChain
from app.db import get_db
from app.db.models.user import User from app.db.models.user import User
from app.db.userauth import get_current_active_superuser from app.db.userauth import get_current_active_superuser

View File

@ -6,7 +6,8 @@ from fastapi.security import OAuth2PasswordRequestForm
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from app import schemas from app import schemas
from app.core import security, settings from app.core import security
from app.core.config import settings
from app.db import get_db from app.db import get_db
from app.db.models.user import User from app.db.models.user import User

View File

@ -5,7 +5,7 @@ from fastapi import Request
from app import schemas from app import schemas
from app.chain.user_message import UserMessageChain from app.chain.user_message import UserMessageChain
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.modules.wechat.WXBizMsgCrypt3 import WXBizMsgCrypt from app.modules.wechat.WXBizMsgCrypt3 import WXBizMsgCrypt

View File

@ -5,7 +5,7 @@ from sqlalchemy.orm import Session
from app import schemas from app import schemas
from app.chain.subscribe import SubscribeChain from app.chain.subscribe import SubscribeChain
from app.core import settings from app.core.config import settings
from app.db import get_db from app.db import get_db
from app.db.models.subscribe import Subscribe from app.db.models.subscribe import Subscribe
from app.db.models.user import User from app.db.models.user import User

View File

@ -3,7 +3,7 @@ from fastapi import APIRouter, BackgroundTasks, Request
from app import schemas from app import schemas
from app.chain.webhook_message import WebhookMessageChain from app.chain.webhook_message import WebhookMessageChain
from app.core import settings from app.core.config import settings
router = APIRouter() router = APIRouter()

View File

@ -5,7 +5,9 @@ from typing import Optional, Any, Tuple, List, Set, Union
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import Context, ModuleManager, MediaInfo, TorrentInfo from app.core.context import Context
from app.core.module_manager import ModuleManager
from app.core.context import MediaInfo, TorrentInfo
from app.core.meta import MetaBase from app.core.meta import MetaBase
from app.log import logger from app.log import logger
from app.utils.singleton import AbstractSingleton, Singleton from app.utils.singleton import AbstractSingleton, Singleton

View File

@ -3,8 +3,7 @@ from pathlib import Path
from typing import List, Optional, Tuple, Set, Dict from typing import List, Optional, Tuple, Set, Dict
from app.chain import ChainBase from app.chain import ChainBase
from app.core import MediaInfo from app.core.context import MediaInfo, TorrentInfo, Context
from app.core import TorrentInfo, Context
from app.core.meta import MetaBase from app.core.meta import MetaBase
from app.helper.torrent import TorrentHelper from app.helper.torrent import TorrentHelper
from app.log import logger from app.log import logger

View File

@ -1,7 +1,7 @@
from typing import Tuple from typing import Tuple
from app.chain import ChainBase from app.chain import ChainBase
from app.core import settings from app.core.config import settings
from app.db.sites import Sites from app.db.sites import Sites
from app.helper.cookiecloud import CookieCloudHelper from app.helper.cookiecloud import CookieCloudHelper
from app.helper.sites import SitesHelper from app.helper.sites import SitesHelper

View File

@ -4,7 +4,9 @@ from typing import Optional
from app.chain import ChainBase from app.chain import ChainBase
from app.chain.common import CommonChain from app.chain.common import CommonChain
from app.chain.search import SearchChain from app.chain.search import SearchChain
from app.core import settings, MetaInfo, MediaInfo from app.core.config import settings
from app.core.meta_info import MetaInfo
from app.core.context import MediaInfo
from app.db.subscribes import Subscribes from app.db.subscribes import Subscribes
from app.helper.rss import RssHelper from app.helper.rss import RssHelper
from app.log import logger from app.log import logger

View File

@ -1,7 +1,8 @@
from typing import Optional from typing import Optional
from app.chain import ChainBase from app.chain import ChainBase
from app.core import Context, MetaInfo, MediaInfo from app.core.meta_info import MetaInfo
from app.core.context import Context, MediaInfo
from app.log import logger from app.log import logger

View File

@ -2,7 +2,9 @@ from typing import Optional, List
from app.chain import ChainBase from app.chain import ChainBase
from app.chain.common import CommonChain from app.chain.common import CommonChain
from app.core import Context, MetaInfo, MediaInfo, TorrentInfo, settings from app.core.context import Context, MediaInfo, TorrentInfo
from app.core.config import settings
from app.core.meta_info import MetaInfo
from app.core.meta import MetaBase from app.core.meta import MetaBase
from app.helper.sites import SitesHelper from app.helper.sites import SitesHelper
from app.log import logger from app.log import logger

View File

@ -3,7 +3,9 @@ from typing import Dict, List, Optional
from app.chain import ChainBase from app.chain import ChainBase
from app.chain.common import CommonChain from app.chain.common import CommonChain
from app.chain.search import SearchChain from app.chain.search import SearchChain
from app.core import MetaInfo, TorrentInfo, Context, MediaInfo, settings from app.core.meta_info import MetaInfo
from app.core.context import TorrentInfo, Context, MediaInfo
from app.core.config import settings
from app.db.subscribes import Subscribes from app.db.subscribes import Subscribes
from app.helper.sites import SitesHelper from app.helper.sites import SitesHelper
from app.log import logger from app.log import logger

View File

@ -1,7 +1,9 @@
from typing import List, Optional from typing import List, Optional
from app.chain import ChainBase from app.chain import ChainBase
from app.core import MetaInfo, MediaInfo, settings from app.core.meta_info import MetaInfo
from app.core.context import MediaInfo
from app.core.config import settings
from app.core.meta import MetaBase from app.core.meta import MetaBase
from app.log import logger from app.log import logger
from app.utils.string import StringUtils from app.utils.string import StringUtils

View File

@ -2,7 +2,9 @@ from typing import Any
from app.chain.common import * from app.chain.common import *
from app.chain.search import SearchChain from app.chain.search import SearchChain
from app.core import MediaInfo, TorrentInfo, MetaInfo, EventManager from app.core.context import MediaInfo, TorrentInfo
from app.core.meta_info import MetaInfo
from app.core.event_manager import EventManager
from app.db.subscribes import Subscribes from app.db.subscribes import Subscribes
from app.log import logger from app.log import logger
from app.utils.types import EventType from app.utils.types import EventType

View File

@ -7,7 +7,8 @@ from app.chain.cookiecloud import CookieCloudChain
from app.chain.douban_sync import DoubanSyncChain from app.chain.douban_sync import DoubanSyncChain
from app.chain.subscribe import SubscribeChain from app.chain.subscribe import SubscribeChain
from app.chain.transfer import TransferChain from app.chain.transfer import TransferChain
from app.core import eventmanager, PluginManager, EventManager from app.core.event_manager import eventmanager, EventManager
from app.core.plugin_manager import PluginManager
from app.core.event_manager import Event as ManagerEvent from app.core.event_manager import Event as ManagerEvent
from app.log import logger from app.log import logger
from app.utils.singleton import Singleton from app.utils.singleton import Singleton

View File

@ -1,6 +0,0 @@
from .config import settings
from .event_manager import eventmanager, EventManager
from .meta_info import MetaInfo
from .module_manager import ModuleManager
from .plugin_manager import PluginManager
from .context import Context, MediaInfo, TorrentInfo

View File

@ -1,8 +1,8 @@
from types import FunctionType from types import FunctionType
from typing import Generator, Optional from typing import Generator, Optional
from app.core import settings from app.core.config import settings
from app.helper import ModuleHelper from app.helper.module import ModuleHelper
from app.log import logger from app.log import logger
from app.utils.singleton import Singleton from app.utils.singleton import Singleton

View File

@ -2,7 +2,7 @@ import traceback
from typing import List, Any from typing import List, Any
from app.db.systemconfigs import SystemConfigs from app.db.systemconfigs import SystemConfigs
from app.helper import ModuleHelper from app.helper.module import ModuleHelper
from app.log import logger from app.log import logger
from app.utils.singleton import Singleton from app.utils.singleton import Singleton

View File

@ -2,7 +2,7 @@ from typing import Tuple, List
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from app.core import MediaInfo from app.core.context import MediaInfo
from app.db import SessionLocal from app.db import SessionLocal
from app.db.models.subscribe import Subscribe from app.db.models.subscribe import Subscribe
from app.utils.types import MediaType from app.utils.types import MediaType

View File

@ -3,7 +3,8 @@ from fastapi import Depends, HTTPException, status
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from app import schemas from app import schemas
from app.core import settings, security from app.core.config import settings
from app.core import security
from app.core.security import reusable_oauth2 from app.core.security import reusable_oauth2
from app.db import get_db from app.db import get_db
from app.db.models.user import User from app.db.models.user import User

View File

@ -1 +0,0 @@
from .module import ModuleHelper

View File

@ -1,12 +1,14 @@
from playwright.sync_api import sync_playwright from playwright.sync_api import sync_playwright
from app.log import logger
class PlaywrightHelper: class PlaywrightHelper:
def __init__(self, browser_type="chromium"): def __init__(self, browser_type="chromium"):
self.browser_type = browser_type self.browser_type = browser_type
def get_page_source(self, url: str, def get_page_source(self, url: str,
cookie: str = None, cookies: str = None,
ua: str = None, ua: str = None,
proxy: dict = None, proxy: dict = None,
headless: bool = True, headless: bool = True,
@ -14,7 +16,7 @@ class PlaywrightHelper:
""" """
获取网页源码 获取网页源码
:param url: 网页地址 :param url: 网页地址
:param cookie: cookie :param cookies: cookies
:param ua: user-agent :param ua: user-agent
:param proxy: 代理 :param proxy: 代理
:param headless: 是否无头模式 :param headless: 是否无头模式
@ -24,11 +26,16 @@ class PlaywrightHelper:
browser = playwright[self.browser_type].launch(headless=headless) browser = playwright[self.browser_type].launch(headless=headless)
context = browser.new_context(user_agent=ua, proxy=proxy) context = browser.new_context(user_agent=ua, proxy=proxy)
page = context.new_page() page = context.new_page()
if cookie: if cookies:
page.set_extra_http_headers({"cookie": cookie}) page.set_extra_http_headers({"cookie": cookies})
try:
page.goto(url) page.goto(url)
page.wait_for_load_state("networkidle", timeout=timeout) page.wait_for_load_state("networkidle", timeout=timeout * 1000)
source = page.content() source = page.content()
except Exception as e:
logger.error(f"获取网页源码失败: {e}")
source = None
finally:
browser.close() browser.close()
return source return source
@ -40,5 +47,5 @@ if __name__ == "__main__":
test_url = "https://www.baidu.com" test_url = "https://www.baidu.com"
test_cookies = "cookie1=value1; cookie2=value2" test_cookies = "cookie1=value1; cookie2=value2"
test_user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36" test_user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36"
source_code = utils.get_page_source(test_url, cookie=test_cookies, ua=test_user_agent) source_code = utils.get_page_source(test_url, cookies=test_cookies, ua=test_user_agent)
print(source_code) print(source_code)

View File

@ -1,7 +1,7 @@
import xml.dom.minidom import xml.dom.minidom
from typing import List from typing import List
from app.core import settings from app.core.config import settings
from app.utils.dom import DomUtils from app.utils.dom import DomUtils
from app.utils.http import RequestUtils from app.utils.http import RequestUtils
from app.utils.string import StringUtils from app.utils.string import StringUtils

View File

@ -6,7 +6,9 @@ from urllib.parse import unquote
from bencode import bdecode from bencode import bdecode
from app.core import settings, Context, MetaInfo from app.core.config import settings
from app.core.context import Context
from app.core.meta_info import MetaInfo
from app.log import logger from app.log import logger
from app.utils.http import RequestUtils from app.utils.http import RequestUtils
from app.utils.string import StringUtils from app.utils.string import StringUtils

View File

@ -1,7 +1,7 @@
import logging import logging
from logging.handlers import RotatingFileHandler from logging.handlers import RotatingFileHandler
from app.core import settings from app.core.config import settings
# logger # logger
logger = logging.getLogger() logger = logging.getLogger()

View File

@ -4,7 +4,9 @@ from uvicorn import Config
from app.api.apiv1 import api_router from app.api.apiv1 import api_router
from app.command import Command from app.command import Command
from app.core import settings, ModuleManager, PluginManager from app.core.config import settings
from app.core.module_manager import ModuleManager
from app.core.plugin_manager import PluginManager
from app.db.init import init_db, update_db from app.db.init import init_db, update_db
from app.helper.sites import SitesHelper from app.helper.sites import SitesHelper
from app.scheduler import Scheduler from app.scheduler import Scheduler

View File

@ -3,7 +3,9 @@ from pathlib import Path
from typing import List, Optional, Tuple, Union from typing import List, Optional, Tuple, Union
from xml.dom import minidom from xml.dom import minidom
from app.core import MediaInfo, settings, MetaInfo from app.core.context import MediaInfo
from app.core.config import settings
from app.core.meta_info import MetaInfo
from app.core.meta import MetaBase from app.core.meta import MetaBase
from app.log import logger from app.log import logger
from app.modules import _ModuleBase from app.modules import _ModuleBase

View File

@ -1,6 +1,6 @@
from typing import Optional, Tuple, Union from typing import Optional, Tuple, Union
from app.core import MediaInfo from app.core.context import MediaInfo
from app.log import logger from app.log import logger
from app.modules import _ModuleBase from app.modules import _ModuleBase
from app.modules.emby.emby import Emby from app.modules.emby.emby import Emby

View File

@ -2,7 +2,7 @@ import re
from pathlib import Path from pathlib import Path
from typing import List, Optional, Union, Dict from typing import List, Optional, Union, Dict
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.utils.http import RequestUtils from app.utils.http import RequestUtils
from app.utils.singleton import Singleton from app.utils.singleton import Singleton

View File

@ -2,7 +2,7 @@ import re
from functools import lru_cache from functools import lru_cache
from typing import Optional, Tuple, Union from typing import Optional, Tuple, Union
from app.core import MediaInfo, settings from app.core.context import MediaInfo, settings
from app.log import logger from app.log import logger
from app.modules import _ModuleBase from app.modules import _ModuleBase
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -5,7 +5,9 @@ from typing import Optional, List, Tuple, Union
from jinja2 import Template from jinja2 import Template
from app.core import MediaInfo, MetaInfo, settings from app.core.context import MediaInfo
from app.core.meta_info import MetaInfo
from app.core.config import settings
from app.core.meta import MetaBase from app.core.meta import MetaBase
from app.log import logger from app.log import logger
from app.modules import _ModuleBase from app.modules import _ModuleBase

View File

@ -1,7 +1,8 @@
import re import re
from typing import List, Tuple, Union, Dict, Optional from typing import List, Tuple, Union, Dict, Optional
from app.core import TorrentInfo, settings from app.core.context import TorrentInfo
from app.core.config import settings
from app.modules import _ModuleBase from app.modules import _ModuleBase
from app.modules.filter.RuleParser import RuleParser from app.modules.filter.RuleParser import RuleParser

View File

@ -4,7 +4,7 @@ from typing import List, Optional, Tuple, Union
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import MediaInfo, TorrentInfo from app.core.context import MediaInfo, TorrentInfo
from app.log import logger from app.log import logger
from app.modules import _ModuleBase from app.modules import _ModuleBase
from app.modules.indexer.spider import TorrentSpider from app.modules.indexer.spider import TorrentSpider

View File

@ -8,8 +8,8 @@ from jinja2 import Template
from pyquery import PyQuery from pyquery import PyQuery
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.helper.playwright import PlaywrightHelper from app.helper.browser import PlaywrightHelper
from app.log import logger from app.log import logger
from app.utils.http import RequestUtils from app.utils.http import RequestUtils
from app.utils.string import StringUtils from app.utils.string import StringUtils
@ -17,6 +17,7 @@ from app.utils.types import MediaType
class TorrentSpider: class TorrentSpider:
# 是否出现错误 # 是否出现错误
is_error: bool = False is_error: bool = False
# 索引器ID # 索引器ID
@ -217,7 +218,7 @@ class TorrentSpider:
if self.render: if self.render:
page_source = PlaywrightHelper().get_page_source( page_source = PlaywrightHelper().get_page_source(
url=searchurl, url=searchurl,
cookie=self.cookie, cookies=self.cookie,
ua=self.ua, ua=self.ua,
proxy=self.proxies proxy=self.proxies
) )

View File

@ -3,7 +3,7 @@ from typing import Tuple, List
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.utils.http import RequestUtils from app.utils.http import RequestUtils
from app.utils.string import StringUtils from app.utils.string import StringUtils

View File

@ -3,7 +3,7 @@ from urllib.parse import quote
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.utils.http import RequestUtils from app.utils.http import RequestUtils
from app.utils.string import StringUtils from app.utils.string import StringUtils

View File

@ -1,6 +1,6 @@
from typing import Optional, Tuple, Union from typing import Optional, Tuple, Union
from app.core import MediaInfo from app.core.context import MediaInfo
from app.log import logger from app.log import logger
from app.modules import _ModuleBase from app.modules import _ModuleBase
from app.modules.jellyfin.jellyfin import Jellyfin from app.modules.jellyfin.jellyfin import Jellyfin

View File

@ -1,7 +1,7 @@
import re import re
from typing import List, Union, Optional, Dict from typing import List, Union, Optional, Dict
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.utils.http import RequestUtils from app.utils.http import RequestUtils
from app.utils.singleton import Singleton from app.utils.singleton import Singleton

View File

@ -1,6 +1,6 @@
from typing import Optional, Tuple, Union from typing import Optional, Tuple, Union
from app.core import MediaInfo from app.core.context import MediaInfo
from app.log import logger from app.log import logger
from app.modules import _ModuleBase from app.modules import _ModuleBase
from app.modules.plex.plex import Plex from app.modules.plex.plex import Plex

View File

@ -5,7 +5,7 @@ from urllib.parse import quote_plus
from plexapi import media from plexapi import media
from plexapi.server import PlexServer from plexapi.server import PlexServer
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.utils.singleton import Singleton from app.utils.singleton import Singleton

View File

@ -1,7 +1,8 @@
from pathlib import Path from pathlib import Path
from typing import Set, Tuple, Optional, Union, List from typing import Set, Tuple, Optional, Union, List
from app.core import settings, MetaInfo from app.core.config import settings
from app.core.meta_info import MetaInfo
from app.modules import _ModuleBase from app.modules import _ModuleBase
from app.modules.qbittorrent.qbittorrent import Qbittorrent from app.modules.qbittorrent.qbittorrent import Qbittorrent
from app.utils.string import StringUtils from app.utils.string import StringUtils

View File

@ -6,7 +6,7 @@ import qbittorrentapi
from qbittorrentapi import TorrentFilesList, TorrentDictionary from qbittorrentapi import TorrentFilesList, TorrentDictionary
from qbittorrentapi.client import Client from qbittorrentapi.client import Client
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.utils.singleton import Singleton from app.utils.singleton import Singleton
from app.utils.string import StringUtils from app.utils.string import StringUtils

View File

@ -1,7 +1,8 @@
import json import json
from typing import Optional, Union, List, Tuple, Any from typing import Optional, Union, List, Tuple, Any
from app.core import MediaInfo, settings, Context from app.core.context import MediaInfo, Context
from app.core.config import settings
from app.log import logger from app.log import logger
from app.modules import _ModuleBase from app.modules import _ModuleBase
from app.modules.telegram.telegram import Telegram from app.modules.telegram.telegram import Telegram

View File

@ -4,11 +4,11 @@ from typing import Optional, List
import telebot import telebot
from app.core import settings, MediaInfo, Context from app.core.config import settings
from app.core.context import MediaInfo, Context
from app.log import logger from app.log import logger
from app.utils.http import RequestUtils from app.utils.http import RequestUtils
from app.utils.singleton import Singleton from app.utils.singleton import Singleton
from app.utils.string import StringUtils
class Telegram(metaclass=Singleton): class Telegram(metaclass=Singleton):
@ -20,6 +20,9 @@ class Telegram(metaclass=Singleton):
""" """
初始化参数 初始化参数
""" """
if settings.MESSAGER != "telegram":
return
# Token # Token
self._telegram_token = settings.TELEGRAM_TOKEN self._telegram_token = settings.TELEGRAM_TOKEN
# Chat Id # Chat Id
@ -72,7 +75,7 @@ class Telegram(metaclass=Singleton):
else: else:
chat_id = self._telegram_chat_id chat_id = self._telegram_chat_id
return self.__send_request(image=image, caption=caption) return self.__send_request(userid=chat_id, image=image, caption=caption)
except Exception as msg_e: except Exception as msg_e:
logger.error(f"发送消息失败:{msg_e}") logger.error(f"发送消息失败:{msg_e}")
@ -110,7 +113,7 @@ class Telegram(metaclass=Singleton):
else: else:
chat_id = self._telegram_chat_id chat_id = self._telegram_chat_id
return self.__send_request(image=image, caption=caption) return self.__send_request(userid=chat_id, image=image, caption=caption)
except Exception as msg_e: except Exception as msg_e:
logger.error(f"发送消息失败:{msg_e}") logger.error(f"发送消息失败:{msg_e}")
@ -140,24 +143,24 @@ class Telegram(metaclass=Singleton):
else: else:
chat_id = self._telegram_chat_id chat_id = self._telegram_chat_id
return self.__send_request(caption=caption) return self.__send_request(userid=chat_id, caption=caption)
except Exception as msg_e: except Exception as msg_e:
logger.error(f"发送消息失败:{msg_e}") logger.error(f"发送消息失败:{msg_e}")
return False return False
def __send_request(self, image="", caption="") -> bool: def __send_request(self, userid: str = None, image="", caption="") -> bool:
""" """
向Telegram发送报文 向Telegram发送报文
""" """
if image: if image:
ret = self._bot.send_photo(chat_id=self._telegram_chat_id, ret = self._bot.send_photo(chat_id=userid or self._telegram_chat_id,
photo=image, photo=image,
caption=caption, caption=caption,
parse_mode="Markdown") parse_mode="Markdown")
else: else:
ret = self._bot.send_message(chat_id=self._telegram_chat_id, ret = self._bot.send_message(chat_id=userid or self._telegram_chat_id,
text=caption, text=caption,
parse_mode="Markdown") parse_mode="Markdown")

View File

@ -3,7 +3,9 @@ from pathlib import Path
from typing import Optional, List, Tuple, Union from typing import Optional, List, Tuple, Union
from xml.dom import minidom from xml.dom import minidom
from app.core import settings, MediaInfo, MetaInfo from app.core.config import settings
from app.core.context import MediaInfo
from app.core.meta_info import MetaInfo
from app.core.meta import MetaBase from app.core.meta import MetaBase
from app.log import logger from app.log import logger
from app.modules import _ModuleBase from app.modules import _ModuleBase

View File

@ -3,7 +3,7 @@ from pathlib import Path
import ruamel.yaml import ruamel.yaml
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.utils.singleton import Singleton from app.utils.singleton import Singleton

View File

@ -6,7 +6,7 @@ from lxml import etree
from tmdbv3api import TMDb, Search, Movie, TV, Season, Episode from tmdbv3api import TMDb, Search, Movie, TV, Season, Episode
from tmdbv3api.exceptions import TMDbException from tmdbv3api.exceptions import TMDbException
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.utils.http import RequestUtils from app.utils.http import RequestUtils
from app.utils.string import StringUtils from app.utils.string import StringUtils

View File

@ -5,7 +5,7 @@ from pathlib import Path
from threading import RLock from threading import RLock
from typing import Optional from typing import Optional
from app.core import settings from app.core.config import settings
from app.core.meta import MetaBase from app.core.meta import MetaBase
from app.utils.singleton import Singleton from app.utils.singleton import Singleton
from app.utils.types import MediaType from app.utils.types import MediaType

View File

@ -1,7 +1,8 @@
from pathlib import Path from pathlib import Path
from typing import Set, Tuple, Optional, Union, List from typing import Set, Tuple, Optional, Union, List
from app.core import settings, MetaInfo from app.core.config import settings
from app.core.meta_info import MetaInfo
from app.modules import _ModuleBase from app.modules import _ModuleBase
from app.modules.transmission.transmission import Transmission from app.modules.transmission.transmission import Transmission
from app.utils.types import TorrentStatus from app.utils.types import TorrentStatus

View File

@ -4,7 +4,7 @@ from typing import Optional, Union, Tuple, List
import transmission_rpc import transmission_rpc
from transmission_rpc import Client, Torrent, File from transmission_rpc import Client, Torrent, File
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.utils.singleton import Singleton from app.utils.singleton import Singleton
from app.utils.string import StringUtils from app.utils.string import StringUtils

View File

@ -1,7 +1,8 @@
import xml.dom.minidom import xml.dom.minidom
from typing import Optional, Union, List, Tuple, Any from typing import Optional, Union, List, Tuple, Any
from app.core import MediaInfo, settings, Context from app.core.context import MediaInfo, Context
from app.core.config import settings
from app.log import logger from app.log import logger
from app.modules import _ModuleBase from app.modules import _ModuleBase
from app.modules.wechat.WXBizMsgCrypt3 import WXBizMsgCrypt from app.modules.wechat.WXBizMsgCrypt3 import WXBizMsgCrypt

View File

@ -3,7 +3,8 @@ import threading
from datetime import datetime from datetime import datetime
from typing import Optional, List from typing import Optional, List
from app.core import settings, MediaInfo, Context from app.core.config import settings
from app.core.context import MediaInfo, Context
from app.log import logger from app.log import logger
from app.utils.http import RequestUtils from app.utils.http import RequestUtils
from app.utils.singleton import Singleton from app.utils.singleton import Singleton

View File

@ -4,7 +4,7 @@ from pathlib import Path
from typing import Any from typing import Any
from app.chain import ChainBase from app.chain import ChainBase
from app.core import settings from app.core.config import settings
from app.db import SessionLocal from app.db import SessionLocal
from app.db.models import Base from app.db.models import Base
from app.db.models.plugin import PluginData from app.db.models.plugin import PluginData

View File

@ -7,8 +7,9 @@ from urllib.parse import urljoin
from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.schedulers.background import BackgroundScheduler
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import EventManager, settings, eventmanager from app.core.event_manager import EventManager, eventmanager
from app.helper import ModuleHelper from app.core.config import settings
from app.helper.module import ModuleHelper
from app.helper.cloudflare import under_challenge from app.helper.cloudflare import under_challenge
from app.helper.sites import SitesHelper from app.helper.sites import SitesHelper
from app.log import logger from app.log import logger

View File

@ -4,7 +4,7 @@ from typing import Tuple
from lxml import etree from lxml import etree
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -2,7 +2,7 @@ from typing import Tuple
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -5,7 +5,7 @@ from typing import Tuple
from lxml import etree from lxml import etree
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -2,7 +2,7 @@ from typing import Tuple
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -3,7 +3,7 @@ from typing import Tuple
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -2,7 +2,7 @@ from typing import Tuple
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -4,7 +4,7 @@ from typing import Tuple
from lxml import etree from lxml import etree
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -2,7 +2,7 @@ from typing import Tuple
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -4,7 +4,7 @@ from typing import Tuple
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.helper.ocr import OcrHelper from app.helper.ocr import OcrHelper
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler

View File

@ -3,7 +3,7 @@ from typing import Tuple
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -5,7 +5,7 @@ from typing import Tuple
from lxml import etree from lxml import etree
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.helper.ocr import OcrHelper from app.helper.ocr import OcrHelper
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler

View File

@ -3,7 +3,7 @@ from typing import Tuple
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -8,7 +8,7 @@ from PIL import Image
from lxml import etree from lxml import etree
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -3,7 +3,7 @@ from typing import Tuple
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -6,7 +6,7 @@ from typing import Tuple
from lxml import etree from lxml import etree
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -4,7 +4,7 @@ from typing import Tuple
from lxml import etree from lxml import etree
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.plugins.autosignin.sites import _ISiteSigninHandler from app.plugins.autosignin.sites import _ISiteSigninHandler
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -7,9 +7,10 @@ import requests
from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.schedulers.background import BackgroundScheduler
from ruamel.yaml import CommentedMap from ruamel.yaml import CommentedMap
from app.core import settings, eventmanager from app.core.config import settings
from app.core.event_manager import eventmanager
from app.core.event_manager import Event from app.core.event_manager import Event
from app.helper import ModuleHelper from app.helper.module import ModuleHelper
from app.helper.sites import SitesHelper from app.helper.sites import SitesHelper
from app.log import logger from app.log import logger
from app.plugins import _PluginBase from app.plugins import _PluginBase

View File

@ -10,7 +10,7 @@ import requests
from lxml import etree from lxml import etree
from requests import Session from requests import Session
from app.core import settings from app.core.config import settings
from app.helper.cloudflare import under_challenge from app.helper.cloudflare import under_challenge
from app.log import logger from app.log import logger
from app.utils.http import RequestUtils from app.utils.http import RequestUtils

View File

@ -9,7 +9,7 @@ from app.chain.cookiecloud import CookieCloudChain
from app.chain.douban_sync import DoubanSyncChain from app.chain.douban_sync import DoubanSyncChain
from app.chain.subscribe import SubscribeChain from app.chain.subscribe import SubscribeChain
from app.chain.transfer import TransferChain from app.chain.transfer import TransferChain
from app.core import settings from app.core.config import settings
from app.log import logger from app.log import logger
from app.utils.singleton import Singleton from app.utils.singleton import Singleton
from app.utils.timer import TimerUtils from app.utils.timer import TimerUtils

View File

@ -2,7 +2,7 @@
from unittest import TestCase from unittest import TestCase
from app.core import TorrentInfo from app.core.context import TorrentInfo
from app.modules.filter import FilterModule from app.modules.filter import FilterModule

View File

@ -2,7 +2,7 @@
from unittest import TestCase from unittest import TestCase
from app.core import MetaInfo from app.core.meta_info import MetaInfo
from tests.cases.meta import meta_cases from tests.cases.meta import meta_cases