fix plugin
This commit is contained in:
parent
0bcae45fd6
commit
95de1b81e7
@ -2,6 +2,7 @@
|
|||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
from abc import ABCMeta, abstractmethod
|
from abc import ABCMeta, abstractmethod
|
||||||
|
from enum import Enum
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from urllib.parse import urljoin, urlsplit
|
from urllib.parse import urljoin, urlsplit
|
||||||
|
|
||||||
@ -13,11 +14,25 @@ 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
|
||||||
from app.utils.site import SiteUtils
|
from app.utils.site import SiteUtils
|
||||||
from app.schemas.types import SiteSchema
|
|
||||||
|
|
||||||
SITE_BASE_ORDER = 1000
|
SITE_BASE_ORDER = 1000
|
||||||
|
|
||||||
|
|
||||||
|
# 站点框架
|
||||||
|
class SiteSchema(Enum):
|
||||||
|
DiscuzX = "Discuz!"
|
||||||
|
Gazelle = "Gazelle"
|
||||||
|
Ipt = "IPTorrents"
|
||||||
|
NexusPhp = "NexusPhp"
|
||||||
|
NexusProject = "NexusProject"
|
||||||
|
NexusRabbit = "NexusRabbit"
|
||||||
|
SmallHorse = "Small Horse"
|
||||||
|
Unit3d = "Unit3d"
|
||||||
|
TorrentLeech = "TorrentLeech"
|
||||||
|
FileList = "FileList"
|
||||||
|
TNode = "TNode"
|
||||||
|
|
||||||
|
|
||||||
class ISiteUserInfo(metaclass=ABCMeta):
|
class ISiteUserInfo(metaclass=ABCMeta):
|
||||||
# 站点模版
|
# 站点模版
|
||||||
schema = SiteSchema.NexusPhp
|
schema = SiteSchema.NexusPhp
|
||||||
|
@ -4,9 +4,8 @@ from typing import Optional
|
|||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER
|
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER, SiteSchema
|
||||||
from app.utils.string import StringUtils
|
from app.utils.string import StringUtils
|
||||||
from app.schemas.types import SiteSchema
|
|
||||||
|
|
||||||
|
|
||||||
class DiscuzUserInfo(ISiteUserInfo):
|
class DiscuzUserInfo(ISiteUserInfo):
|
||||||
|
@ -4,9 +4,8 @@ from typing import Optional
|
|||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER
|
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER, SiteSchema
|
||||||
from app.utils.string import StringUtils
|
from app.utils.string import StringUtils
|
||||||
from app.schemas.types import SiteSchema
|
|
||||||
|
|
||||||
|
|
||||||
class FileListSiteUserInfo(ISiteUserInfo):
|
class FileListSiteUserInfo(ISiteUserInfo):
|
||||||
|
@ -4,9 +4,8 @@ from typing import Optional
|
|||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER
|
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER, SiteSchema
|
||||||
from app.utils.string import StringUtils
|
from app.utils.string import StringUtils
|
||||||
from app.schemas.types import SiteSchema
|
|
||||||
|
|
||||||
|
|
||||||
class GazelleSiteUserInfo(ISiteUserInfo):
|
class GazelleSiteUserInfo(ISiteUserInfo):
|
||||||
|
@ -4,9 +4,8 @@ from typing import Optional
|
|||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER
|
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER, SiteSchema
|
||||||
from app.utils.string import StringUtils
|
from app.utils.string import StringUtils
|
||||||
from app.schemas.types import SiteSchema
|
|
||||||
|
|
||||||
|
|
||||||
class IptSiteUserInfo(ISiteUserInfo):
|
class IptSiteUserInfo(ISiteUserInfo):
|
||||||
|
@ -5,9 +5,8 @@ from typing import Optional
|
|||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
from app.log import logger
|
from app.log import logger
|
||||||
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER
|
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER, SiteSchema
|
||||||
from app.utils.string import StringUtils
|
from app.utils.string import StringUtils
|
||||||
from app.schemas.types import SiteSchema
|
|
||||||
|
|
||||||
|
|
||||||
class NexusPhpSiteUserInfo(ISiteUserInfo):
|
class NexusPhpSiteUserInfo(ISiteUserInfo):
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from app.plugins.sitestatistic.siteuserinfo import SITE_BASE_ORDER
|
from app.plugins.sitestatistic.siteuserinfo import SITE_BASE_ORDER, SiteSchema
|
||||||
from app.plugins.sitestatistic.siteuserinfo.nexus_php import NexusPhpSiteUserInfo
|
from app.plugins.sitestatistic.siteuserinfo.nexus_php import NexusPhpSiteUserInfo
|
||||||
from app.schemas.types import SiteSchema
|
|
||||||
|
|
||||||
|
|
||||||
class NexusProjectSiteUserInfo(NexusPhpSiteUserInfo):
|
class NexusProjectSiteUserInfo(NexusPhpSiteUserInfo):
|
||||||
|
@ -5,9 +5,8 @@ from typing import Optional
|
|||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
from app.log import logger
|
from app.log import logger
|
||||||
from app.plugins.sitestatistic.siteuserinfo import SITE_BASE_ORDER
|
from app.plugins.sitestatistic.siteuserinfo import SITE_BASE_ORDER, SiteSchema
|
||||||
from app.plugins.sitestatistic.siteuserinfo.nexus_php import NexusPhpSiteUserInfo
|
from app.plugins.sitestatistic.siteuserinfo.nexus_php import NexusPhpSiteUserInfo
|
||||||
from app.schemas.types import SiteSchema
|
|
||||||
|
|
||||||
|
|
||||||
class NexusRabbitSiteUserInfo(NexusPhpSiteUserInfo):
|
class NexusRabbitSiteUserInfo(NexusPhpSiteUserInfo):
|
||||||
|
@ -4,9 +4,8 @@ from typing import Optional
|
|||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER
|
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER, SiteSchema
|
||||||
from app.utils.string import StringUtils
|
from app.utils.string import StringUtils
|
||||||
from app.schemas.types import SiteSchema
|
|
||||||
|
|
||||||
|
|
||||||
class SmallHorseSiteUserInfo(ISiteUserInfo):
|
class SmallHorseSiteUserInfo(ISiteUserInfo):
|
||||||
|
@ -3,9 +3,8 @@ import json
|
|||||||
import re
|
import re
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER
|
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER, SiteSchema
|
||||||
from app.utils.string import StringUtils
|
from app.utils.string import StringUtils
|
||||||
from app.schemas.types import SiteSchema
|
|
||||||
|
|
||||||
|
|
||||||
class TNodeSiteUserInfo(ISiteUserInfo):
|
class TNodeSiteUserInfo(ISiteUserInfo):
|
||||||
|
@ -4,9 +4,8 @@ from typing import Optional
|
|||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER
|
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER, SiteSchema
|
||||||
from app.utils.string import StringUtils
|
from app.utils.string import StringUtils
|
||||||
from app.schemas.types import SiteSchema
|
|
||||||
|
|
||||||
|
|
||||||
class TorrentLeechSiteUserInfo(ISiteUserInfo):
|
class TorrentLeechSiteUserInfo(ISiteUserInfo):
|
||||||
|
@ -4,9 +4,8 @@ from typing import Optional
|
|||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER
|
from app.plugins.sitestatistic.siteuserinfo import ISiteUserInfo, SITE_BASE_ORDER, SiteSchema
|
||||||
from app.utils.string import StringUtils
|
from app.utils.string import StringUtils
|
||||||
from app.schemas.types import SiteSchema
|
|
||||||
|
|
||||||
|
|
||||||
class Unit3dSiteUserInfo(ISiteUserInfo):
|
class Unit3dSiteUserInfo(ISiteUserInfo):
|
||||||
|
@ -54,21 +54,6 @@ class SystemConfigKey(Enum):
|
|||||||
FilterRules2 = "FilterRules2"
|
FilterRules2 = "FilterRules2"
|
||||||
|
|
||||||
|
|
||||||
# 站点框架
|
|
||||||
class SiteSchema(Enum):
|
|
||||||
DiscuzX = "Discuz!"
|
|
||||||
Gazelle = "Gazelle"
|
|
||||||
Ipt = "IPTorrents"
|
|
||||||
NexusPhp = "NexusPhp"
|
|
||||||
NexusProject = "NexusProject"
|
|
||||||
NexusRabbit = "NexusRabbit"
|
|
||||||
SmallHorse = "Small Horse"
|
|
||||||
Unit3d = "Unit3d"
|
|
||||||
TorrentLeech = "TorrentLeech"
|
|
||||||
FileList = "FileList"
|
|
||||||
TNode = "TNode"
|
|
||||||
|
|
||||||
|
|
||||||
# 处理进度Key字典
|
# 处理进度Key字典
|
||||||
class ProgressKey(Enum):
|
class ProgressKey(Enum):
|
||||||
# 搜索
|
# 搜索
|
||||||
|
Loading…
x
Reference in New Issue
Block a user