id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,289,000 | tokens.py | demigody_nas-tools/app/utils/tokens.py | import re
from config import SPLIT_CHARS
class Tokens:
_text = ""
_index = 0
_tokens = []
def __init__(self, text):
self._text = text
self._tokens = []
self.load_text(text)
def load_text(self, text):
splited_text = re.split(r'%s' % SPLIT_CHARS, text)
for ... | 893 | Python | .py | 32 | 19.28125 | 58 | 0.526377 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,001 | string_utils.py | demigody_nas-tools/app/utils/string_utils.py | import bisect
import datetime
import hashlib
import random
import re
import os
from urllib import parse
import cn2an
import dateparser
import dateutil.parser
import zhconv
from app.utils.exception_utils import ExceptionUtils
from app.utils.types import MediaType
from config import Config
class StringUtils:
@st... | 20,621 | Python | .py | 615 | 20.484553 | 103 | 0.493656 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,002 | system_utils.py | demigody_nas-tools/app/utils/system_utils.py | import datetime
import os
import platform
import shutil
import subprocess
import psutil
from app.utils.exception_utils import ExceptionUtils
from app.utils.path_utils import PathUtils
from app.utils.types import OsType
from config import Config, WEBDRIVER_PATH
from math import ceil
class SystemUtils:
@staticmet... | 15,510 | Python | .py | 408 | 23.215686 | 125 | 0.4953 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,003 | image_utils.py | demigody_nas-tools/app/utils/image_utils.py | from PIL import Image
from collections import Counter
class ImageUtils:
@staticmethod
def calculate_theme_color(image_path):
# 打开图片并转换为RGB模式
img = Image.open(image_path).convert('RGB')
# 缩小图片尺寸以加快计算速度
img = img.resize((100, 100), resample=Image.BILINEAR)
# 获取所有像素颜色值
... | 794 | Python | .py | 19 | 25.894737 | 67 | 0.632353 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,004 | ip_utils.py | demigody_nas-tools/app/utils/ip_utils.py | import ipaddress
import socket
from urllib.parse import urlparse
class IpUtils:
@staticmethod
def is_ipv4(ip):
"""
判断是不是ipv4
"""
try:
socket.inet_pton(socket.AF_INET, ip)
except AttributeError: # no inet_pton here,sorry
try:
soc... | 1,969 | Python | .py | 72 | 16.305556 | 66 | 0.534778 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,005 | scheduler_utils.py | demigody_nas-tools/app/utils/scheduler_utils.py | import datetime
import random
from apscheduler.triggers.cron import CronTrigger
from apscheduler.util import undefined
import math
import log
class SchedulerUtils:
@staticmethod
def start_job(scheduler, func, func_desc, cron, next_run_time=undefined):
"""
解析任务的定时规则,启动定时服务
:param fun... | 5,313 | Python | .py | 102 | 28.019608 | 116 | 0.445218 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,006 | __init__.py | demigody_nas-tools/app/utils/__init__.py | from .dom_utils import DomUtils
from .episode_format import EpisodeFormat
from .http_utils import RequestUtils
from .json_utils import JsonUtils
from .number_utils import NumberUtils
from .path_utils import PathUtils
from .string_utils import StringUtils
from .system_utils import SystemUtils
from .tokens import Tokens
... | 682 | Python | .py | 17 | 39.176471 | 103 | 0.863363 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,007 | path_utils.py | demigody_nas-tools/app/utils/path_utils.py | import os
class PathUtils:
@staticmethod
def get_dir_files(in_path, exts="", filesize=0, episode_format=None):
"""
获得目录下的媒体文件列表List ,按后缀、大小、格式过滤
"""
if not in_path:
return []
if not os.path.exists(in_path):
return []
ret_list = []
... | 5,746 | Python | .py | 146 | 23.760274 | 112 | 0.495863 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,008 | torrent.py | demigody_nas-tools/app/utils/torrent.py | import base64
import datetime
import json
import os.path
import time
import re
import tempfile
import hashlib
from typing import Optional, Dict
from urllib.parse import unquote, urlencode, urlparse
from bencode import bencode, bdecode
import log
from app.utils import StringUtils
from app.utils.http_utils import Reque... | 20,568 | Python | .py | 463 | 26.066955 | 120 | 0.506382 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,009 | nfo_reader.py | demigody_nas-tools/app/utils/nfo_reader.py | import xml.etree.ElementTree as ET
class NfoReader:
def __init__(self, xml_file_path):
self.xml_file_path = xml_file_path
self.tree = ET.parse(xml_file_path)
self.root = self.tree.getroot()
def get_element_value(self, element_path):
element = self.root.find(element_path)
... | 376 | Python | .py | 9 | 35.111111 | 60 | 0.675824 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,010 | number_utils.py | demigody_nas-tools/app/utils/number_utils.py | class NumberUtils:
@staticmethod
def max_ele(a, b):
"""
返回非空最大值
"""
if not a:
return b
if not b:
return a
return max(int(a), int(b))
@staticmethod
def get_size_gb(size):
"""
将字节转换为GB
"""
if not size... | 419 | Python | .py | 19 | 12.210526 | 47 | 0.454301 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,011 | dom_utils.py | demigody_nas-tools/app/utils/dom_utils.py | class DomUtils:
@staticmethod
def tag_value(tag_item, tag_name, attname="", default=None):
"""
解析XML标签值
"""
tagNames = tag_item.getElementsByTagName(tag_name)
if tagNames:
if attname:
attvalue = tagNames[0].getAttribute(attname)
... | 877 | Python | .py | 28 | 19.75 | 64 | 0.541818 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,012 | exception_utils.py | demigody_nas-tools/app/utils/exception_utils.py | # -*- coding: utf-8 -*-
import traceback
class ExceptionUtils:
@classmethod
def exception_traceback(cls, e):
print(f"\nException: {str(e)}\nCallstack:\n{traceback.format_exc()}\n")
| 199 | Python | .py | 6 | 29.166667 | 79 | 0.680628 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,013 | types.py | demigody_nas-tools/app/utils/types.py | from enum import Enum
class MyMediaLibraryType(Enum):
MINE = '我的媒体库'
WATCHING = '正在观看'
NEWESTADD = '最新入库'
class MediaType(Enum):
TV = '电视剧'
MOVIE = '电影'
ANIME = '动漫'
UNKNOWN = '未知'
class DownloaderType(Enum):
QB = 'Qbittorrent'
TR = 'Transmission'
UT = 'uTorrent'
PAN115 =... | 4,866 | Python | .py | 172 | 19.639535 | 61 | 0.664477 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,014 | sites.py | demigody_nas-tools/app/sites/sites.py | import json
from datetime import datetime
import log
from app.conf import SystemConfig
from app.helper import ChromeHelper, SiteHelper, DbHelper
from app.message import Message
from app.sites.mt import MtFunc
from app.sites.site_limiter import SiteRateLimiter
from app.utils import RequestUtils, StringUtils
from app.ut... | 15,969 | Python | .py | 404 | 24.205446 | 120 | 0.496186 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,015 | __init__.py | demigody_nas-tools/app/sites/__init__.py | from app.sites.site_userinfo import SiteUserInfo
from .sites import Sites
from .site_cookie import SiteCookie
from .site_subtitle import SiteSubtitle
from .siteconf import SiteConf
from .site_limiter import SiteRateLimiter
| 223 | Python | .py | 6 | 36.166667 | 48 | 0.866359 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,016 | site_cookie.py | demigody_nas-tools/app/sites/site_cookie.py | import base64
import time
from lxml import etree
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as es
from selenium.webdriver.support.wait import WebDriverWait
import log
from app.helper import ChromeHelper, ProgressHelper, OcrHelper, SiteHelper
from app.sites.s... | 13,251 | Python | .py | 296 | 25.101351 | 103 | 0.480137 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,017 | site_limiter.py | demigody_nas-tools/app/sites/site_limiter.py | import time
class SiteRateLimiter:
def __init__(self, limit_interval: int, limit_count: int, limit_seconds: int):
"""
限制访问频率
:param limit_interval: 单位时间(秒)
:param limit_count: 单位时间内访问次数
:param limit_seconds: 访问间隔(秒)
"""
self.limit_count = limit_count
... | 2,205 | Python | .py | 49 | 27.346939 | 113 | 0.553751 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,018 | siteconf.py | demigody_nas-tools/app/sites/siteconf.py | import json
import random
import re
import time
from functools import lru_cache
from urllib.parse import urlsplit
from lxml import etree
from app.helper import ChromeHelper
from app.sites.mt import MtFunc
from app.utils import ExceptionUtils, StringUtils, RequestUtils
from app.utils.commons import singleton
from conf... | 8,012 | Python | .py | 199 | 25.346734 | 114 | 0.480419 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,019 | mt.py | demigody_nas-tools/app/sites/mt.py | import base64
import json
from app.media.tmdbv3api.tmdb import logger
from app.utils import RequestUtils
from config import Config
class MtFunc(object):
signin_url = "%s/api/member/updateLastBrowse"
api_key_url = "%s/api/apikey/getKeyList"
download_url = "%s/api/torrent/genDlToken"
torrent_detail_url... | 4,298 | Python | .py | 99 | 29.373737 | 114 | 0.5378 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,020 | site_userinfo.py | demigody_nas-tools/app/sites/site_userinfo.py | import json
from datetime import datetime
from multiprocessing.dummy import Pool as ThreadPool
from threading import Lock
import re
import json
from urllib.parse import urlparse, urlunparse
import requests
import log
from app.helper import ChromeHelper, SubmoduleHelper, DbHelper
from app.message import Message
from a... | 19,565 | Python | .py | 413 | 29.917676 | 119 | 0.521437 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,021 | site_subtitle.py | demigody_nas-tools/app/sites/site_subtitle.py | import os
import shutil
from lxml import etree
import log
from app.sites.sites import Sites
from app.sites.siteconf import SiteConf
from app.helper import SiteHelper
from app.utils import RequestUtils, StringUtils, PathUtils, ExceptionUtils
from config import Config, RMT_SUBEXT
class SiteSubtitle:
siteconf = N... | 5,466 | Python | .py | 110 | 28.436364 | 113 | 0.483623 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,022 | ipt_project.py | demigody_nas-tools/app/sites/siteuserinfo/ipt_project.py | # -*- coding: utf-8 -*-
import re
from lxml import etree
from app.sites.siteuserinfo._base import _ISiteUserInfo, SITE_BASE_ORDER
from app.utils import StringUtils
from app.utils.types import SiteSchema
class IptSiteUserInfo(_ISiteUserInfo):
schema = SiteSchema.Ipt
order = SITE_BASE_ORDER + 35
@classme... | 3,640 | Python | .py | 75 | 38.76 | 117 | 0.587454 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,023 | nexus_project.py | demigody_nas-tools/app/sites/siteuserinfo/nexus_project.py | # -*- coding: utf-8 -*-
import re
from app.sites.siteuserinfo._base import SITE_BASE_ORDER
from app.sites.siteuserinfo.nexus_php import NexusPhpSiteUserInfo
from app.utils.types import SiteSchema
class NexusProjectSiteUserInfo(NexusPhpSiteUserInfo):
schema = SiteSchema.NexusProject
order = SITE_BASE_ORDER + ... | 861 | Python | .py | 18 | 41.777778 | 90 | 0.703349 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,024 | nexus_rabbit.py | demigody_nas-tools/app/sites/siteuserinfo/nexus_rabbit.py | # -*- coding: utf-8 -*-
import json
from lxml import etree
from app.sites.siteuserinfo._base import SITE_BASE_ORDER
from app.sites.siteuserinfo.nexus_php import NexusPhpSiteUserInfo
from app.utils.exception_utils import ExceptionUtils
from app.utils.types import SiteSchema
class NexusRabbitSiteUserInfo(NexusPhpSite... | 1,844 | Python | .py | 44 | 33.159091 | 118 | 0.649573 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,025 | unit3d.py | demigody_nas-tools/app/sites/siteuserinfo/unit3d.py | # -*- coding: utf-8 -*-
import re
from lxml import etree
from app.sites.siteuserinfo._base import _ISiteUserInfo, SITE_BASE_ORDER
from app.utils import StringUtils
from app.utils.types import SiteSchema
class Unit3dSiteUserInfo(_ISiteUserInfo):
schema = SiteSchema.Unit3d
order = SITE_BASE_ORDER + 15
@c... | 5,476 | Python | .py | 107 | 38.878505 | 120 | 0.57798 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,026 | file_list.py | demigody_nas-tools/app/sites/siteuserinfo/file_list.py | # -*- coding: utf-8 -*-
import re
from lxml import etree
from app.sites.siteuserinfo._base import _ISiteUserInfo, SITE_BASE_ORDER
from app.utils import StringUtils
from app.utils.types import SiteSchema
class FileListSiteUserInfo(_ISiteUserInfo):
schema = SiteSchema.FileList
order = SITE_BASE_ORDER + 50
... | 4,166 | Python | .py | 90 | 36.377778 | 109 | 0.613236 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,027 | tnode.py | demigody_nas-tools/app/sites/siteuserinfo/tnode.py | # -*- coding: utf-8 -*-
import json
import re
from app.sites.siteuserinfo._base import _ISiteUserInfo, SITE_BASE_ORDER
from app.utils import StringUtils
from app.utils.types import SiteSchema
class TNodeSiteUserInfo(_ISiteUserInfo):
schema = SiteSchema.TNode
order = SITE_BASE_ORDER + 60
tnNodeLimitPageS... | 3,782 | Python | .py | 86 | 33.918605 | 190 | 0.619893 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,028 | discuz.py | demigody_nas-tools/app/sites/siteuserinfo/discuz.py | # -*- coding: utf-8 -*-
import re
from lxml import etree
from app.sites.siteuserinfo._base import _ISiteUserInfo, SITE_BASE_ORDER
from app.utils import StringUtils
from app.utils.types import SiteSchema
class DiscuzUserInfo(_ISiteUserInfo):
schema = SiteSchema.DiscuzX
order = SITE_BASE_ORDER + 10
@clas... | 5,152 | Python | .py | 112 | 34.339286 | 106 | 0.565531 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,029 | nexus_php.py | demigody_nas-tools/app/sites/siteuserinfo/nexus_php.py | # -*- coding: utf-8 -*-
import re
from lxml import etree
import log
from app.sites.siteuserinfo._base import _ISiteUserInfo, SITE_BASE_ORDER
from app.utils import StringUtils
from app.utils.exception_utils import ExceptionUtils
from app.utils.types import SiteSchema
class NexusPhpSiteUserInfo(_ISiteUserInfo):
s... | 21,022 | Python | .py | 384 | 40.153646 | 134 | 0.552069 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,030 | small_horse.py | demigody_nas-tools/app/sites/siteuserinfo/small_horse.py | # -*- coding: utf-8 -*-
import re
from lxml import etree
from app.sites.siteuserinfo._base import _ISiteUserInfo, SITE_BASE_ORDER
from app.utils import StringUtils
from app.utils.types import SiteSchema
class SmallHorseSiteUserInfo(_ISiteUserInfo):
schema = SiteSchema.SmallHorse
order = SITE_BASE_ORDER + 30... | 4,524 | Python | .py | 90 | 39.611111 | 122 | 0.584371 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,031 | gazelle.py | demigody_nas-tools/app/sites/siteuserinfo/gazelle.py | # -*- coding: utf-8 -*-
import re
from lxml import etree
from app.sites.siteuserinfo._base import _ISiteUserInfo, SITE_BASE_ORDER
from app.utils import StringUtils
from app.utils.types import SiteSchema
class GazelleSiteUserInfo(_ISiteUserInfo):
schema = SiteSchema.Gazelle
order = SITE_BASE_ORDER
@clas... | 6,115 | Python | .py | 135 | 33.674074 | 117 | 0.567846 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,032 | mt.py | demigody_nas-tools/app/sites/siteuserinfo/mt.py | from collections import namedtuple
from typing import Tuple
import requests
from app.utils import RequestUtils, StringUtils
from config import Config
class MtUserInfo:
"""
mt站获取用户信息
"""
_user_info_url = "%s/api/member/profile"
_user_torrent_list_url = "%s/api/member/getUserTorrentList"
_peer... | 43,942 | Python | .py | 158 | 265.968354 | 37,064 | 0.856946 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,033 | torrent_leech.py | demigody_nas-tools/app/sites/siteuserinfo/torrent_leech.py | # -*- coding: utf-8 -*-
import re
from lxml import etree
from app.sites.siteuserinfo._base import _ISiteUserInfo, SITE_BASE_ORDER
from app.utils import StringUtils
from app.utils.types import SiteSchema
class TorrentLeechSiteUserInfo(_ISiteUserInfo):
schema = SiteSchema.TorrentLeech
order = SITE_BASE_ORDER ... | 4,000 | Python | .py | 86 | 36 | 101 | 0.607602 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,034 | _base.py | demigody_nas-tools/app/sites/siteuserinfo/_base.py | # -*- coding: utf-8 -*-
import base64
import json
import re
from abc import ABCMeta, abstractmethod
from urllib.parse import urljoin, urlsplit
import requests
from lxml import etree
import log
from app.helper import SiteHelper, ChromeHelper
from app.helper.cloudflare_helper import under_challenge
from app.utils impor... | 11,369 | Python | .py | 292 | 25.59589 | 120 | 0.55535 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,035 | media_server.py | demigody_nas-tools/app/mediaserver/media_server.py | import json
import threading
import log
from app.conf import SystemConfig
from app.db import MediaDb
from app.helper import ProgressHelper, SubmoduleHelper
from app.media import Media
from app.message import Message
from app.utils import ExceptionUtils
from app.utils.commons import singleton
from app.utils.types impor... | 14,273 | Python | .py | 360 | 23.236111 | 111 | 0.522281 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,036 | jellyfin.py | demigody_nas-tools/app/mediaserver/client/jellyfin.py | import re
from urllib.parse import quote
import log
from app.mediaserver.client._base import _IMediaClient
from app.utils import RequestUtils, SystemUtils, ExceptionUtils, IpUtils
from app.utils.types import MediaServerType, MediaType
from config import Config
class Jellyfin(_IMediaClient):
# 媒体服务器ID
client_... | 28,389 | Python | .py | 636 | 27.971698 | 124 | 0.504297 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,037 | plex.py | demigody_nas-tools/app/mediaserver/client/plex.py | import os
from urllib.parse import quote
from functools import lru_cache
from urllib.parse import quote_plus
import log
from app.mediaserver.client._base import _IMediaClient
from app.utils import ExceptionUtils
from app.utils.types import MediaServerType, MediaType
from config import Config
from plexapi import media
f... | 24,168 | Python | .py | 574 | 26.440767 | 120 | 0.510678 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,038 | emby.py | demigody_nas-tools/app/mediaserver/client/emby.py | import os
import re
from urllib.parse import quote
import log
from app.mediaserver.client._base import _IMediaClient
from app.utils import RequestUtils, SystemUtils, ExceptionUtils, IpUtils
from app.utils.types import MediaType, MediaServerType
from config import Config
class Emby(_IMediaClient):
# 媒体服务器ID
c... | 35,712 | Python | .py | 776 | 29.118557 | 169 | 0.504236 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,039 | _base.py | demigody_nas-tools/app/mediaserver/client/_base.py | from abc import ABCMeta, abstractmethod
from urllib.parse import quote
from config import Config
class _IMediaClient(metaclass=ABCMeta):
# 媒体服务器ID
client_id = ""
# 媒体服务器类型
client_type = ""
# 媒体服务器名称
client_name = ""
@abstractmethod
def match(self, ctype):
"""
匹配实例
... | 4,476 | Python | .py | 157 | 15.121019 | 93 | 0.53904 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,040 | downloader.py | demigody_nas-tools/app/downloader/downloader.py | import os
from threading import Lock
from enum import Enum
import json
from apscheduler.schedulers.background import BackgroundScheduler
import log
from app.conf import ModuleConf
from app.conf import SystemConfig
from app.filetransfer import FileTransfer
from app.helper import DbHelper, ThreadHelper, SubmoduleHelper... | 65,338 | Python | .py | 1,414 | 26.399576 | 119 | 0.487483 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,041 | aria2.py | demigody_nas-tools/app/downloader/client/aria2.py | import os
import re
import log
from app.utils import RequestUtils, ExceptionUtils, StringUtils
from app.utils.types import DownloaderType
from config import Config
from app.downloader.client._base import _IDownloadClient
from app.downloader.client._pyaria2 import PyAria2
class Aria2(_IDownloadClient):
schema = ... | 7,482 | Python | .py | 182 | 29.357143 | 116 | 0.57669 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,042 | transmission.py | demigody_nas-tools/app/downloader/client/transmission.py | import os.path
import re
import time
from datetime import datetime
import transmission_rpc
import log
from app.utils import ExceptionUtils, StringUtils
from app.utils.types import DownloaderType
from app.downloader.client._base import _IDownloadClient
class Transmission(_IDownloadClient):
# 下载器ID
client_id ... | 22,593 | Python | .py | 549 | 25.825137 | 125 | 0.526057 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,043 | pikpak.py | demigody_nas-tools/app/downloader/client/pikpak.py | import asyncio
from pikpakapi import PikPakApi, DownloadStatus
import log
from app.downloader.client._base import _IDownloadClient
from app.utils.types import DownloaderType
from config import Config
class PikPak(_IDownloadClient):
schema = "pikpak"
# 下载器ID
client_id = "pikpak"
client_type = Do... | 4,535 | Python | .py | 134 | 23.373134 | 92 | 0.561679 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,044 | qbittorrent.py | demigody_nas-tools/app/downloader/client/qbittorrent.py | import os
import re
import time
from datetime import datetime
import log
import qbittorrentapi
from app.downloader.client._base import _IDownloadClient
from app.utils import ExceptionUtils, StringUtils
from app.utils.types import DownloaderType
class Qbittorrent(_IDownloadClient):
# 下载器ID
client_id = "qbitto... | 26,016 | Python | .py | 627 | 25.443381 | 117 | 0.52043 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,045 | _pypan115.py | demigody_nas-tools/app/downloader/client/_pypan115.py | # -*- coding: utf-8 -*-
import re
import time
from urllib import parse
import requests
import log
from app.utils import RequestUtils, ExceptionUtils
class PyPan115:
cookie = None
user_agent = None
req = None
space_info = None
err = None
def __init__(self, cookie):
self.cookie = coo... | 6,562 | Python | .py | 149 | 29.067114 | 247 | 0.512762 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,046 | _pyaria2.py | demigody_nas-tools/app/downloader/client/_pyaria2.py | # -*- coding: utf-8 -*-
import json
import requests
import xmlrpc.client
from base64 import b64encode
import log
from app.utils import Torrent
DEFAULT_HOST = 'localhost'
DEFAULT_PORT = 6800
SERVER_URI_FORMAT = '%s:%s/jsonrpc'
class PyAria2(object):
_secret = None
_server_uri = None
_headers = {}
_i... | 12,981 | Python | .py | 307 | 33.478827 | 166 | 0.634051 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,047 | pan115.py | demigody_nas-tools/app/downloader/client/pan115.py | import log
from app.utils import StringUtils
from app.utils.types import DownloaderType
from config import Config
from app.downloader.client._base import _IDownloadClient
from app.downloader.client._pypan115 import PyPan115
class Pan115(_IDownloadClient):
schema = "pan115"
# 下载器ID
client_id = "pan115"
... | 4,686 | Python | .py | 131 | 25.19084 | 92 | 0.573822 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,048 | _base.py | demigody_nas-tools/app/downloader/client/_base.py | import os.path
from abc import ABCMeta, abstractmethod
from app.utils import PathUtils
class _IDownloadClient(metaclass=ABCMeta):
# 下载器ID
client_id = ""
# 下载器类型
client_type = ""
# 下载器名称
client_name = ""
@abstractmethod
def match(self, ctype):
"""
匹配实例
"""
... | 4,241 | Python | .py | 163 | 14.300613 | 68 | 0.521702 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,049 | meta_helper.py | demigody_nas-tools/app/helper/meta_helper.py | import os
import pickle
import random
import time
from enum import Enum
from threading import RLock
from app.utils import ExceptionUtils
from app.utils.commons import singleton
from config import Config
lock = RLock()
CACHE_EXPIRE_TIMESTAMP_STR = "cache_expire_timestamp"
EXPIRE_TIMESTAMP = 7 * 24 * 3600
@singleton... | 7,397 | Python | .py | 204 | 23.5 | 105 | 0.507053 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,050 | redis_helper.py | demigody_nas-tools/app/helper/redis_helper.py | from app.utils import SystemUtils
class RedisHelper:
@staticmethod
def is_valid():
"""
判斷redis是否有效
"""
if SystemUtils.is_docker():
return True if SystemUtils.execute("which redis-server") else False
else:
return False
| 305 | Python | .py | 11 | 18.818182 | 79 | 0.605735 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,051 | rss_helper.py | demigody_nas-tools/app/helper/rss_helper.py | import re
import xml.dom.minidom
from app.db import MainDb, DbPersist
from app.db.models import RSSTORRENTS
from app.utils import RssTitleUtils, StringUtils, RequestUtils, ExceptionUtils, DomUtils
from config import Config
from third_party.feapder.feapder.utils.log import log
class RssHelper:
_db = MainDb()
... | 7,308 | Python | .py | 171 | 24.245614 | 103 | 0.477094 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,052 | ffmpeg_helper.py | demigody_nas-tools/app/helper/ffmpeg_helper.py | import json
import subprocess
from app.utils import SystemUtils
class FfmpegHelper:
@staticmethod
def get_thumb_image_from_video(video_path, image_path, frames="00:03:01"):
"""
使用ffmpeg从视频文件中截取缩略图
"""
if not video_path or not image_path:
return False
cmd =... | 2,925 | Python | .py | 69 | 28.057971 | 119 | 0.51184 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,053 | submodule_helper.py | demigody_nas-tools/app/helper/submodule_helper.py | # -*- coding: utf-8 -*-
import importlib
import pkgutil
class SubmoduleHelper:
@classmethod
def import_submodules(cls, package, filter_func=lambda name, obj: True):
"""
导入子模块
:param package: 父包名
:param filter_func: 子模块过滤函数,入参为模块名和模块对象,返回True则导入,否则不导入
:return:
""... | 1,021 | Python | .py | 25 | 27.6 | 76 | 0.584245 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,054 | security_helper.py | demigody_nas-tools/app/helper/security_helper.py | import ipaddress
from app.utils import ExceptionUtils
from config import Config
class SecurityHelper:
media_server_webhook_allow_ip = {}
telegram_webhook_allow_ip = {}
synology_webhook_allow_ip = {}
def __init__(self):
security = Config().get_config('security')
if security:
... | 2,417 | Python | .py | 56 | 30.642857 | 100 | 0.568966 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,055 | site_helper.py | demigody_nas-tools/app/helper/site_helper.py | # -*- coding: utf-8 -*-
from datetime import datetime
import os
import re
from lxml import etree
from app.utils import SystemUtils
from config import RMT_SUBEXT
class SiteHelper:
@classmethod
def is_logged_in(cls, html_text):
"""
判断站点是否已经登陆
:param html_text:
:return:
... | 2,121 | Python | .py | 60 | 23.883333 | 104 | 0.534956 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,056 | thread_helper.py | demigody_nas-tools/app/helper/thread_helper.py | from concurrent.futures import ThreadPoolExecutor
from app.utils.commons import singleton
@singleton
class ThreadHelper:
_thread_num = 100
executor = None
def __init__(self):
self.executor = ThreadPoolExecutor(max_workers=self._thread_num)
def init_config(self):
pass
def start_... | 392 | Python | .py | 12 | 27.5 | 72 | 0.721925 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,057 | __init__.py | demigody_nas-tools/app/helper/__init__.py | from .chrome_helper import ChromeHelper, init_chrome
from .meta_helper import MetaHelper
from .progress_helper import ProgressHelper
from .security_helper import SecurityHelper
from .thread_helper import ThreadHelper
from .db_helper import DbHelper
from .dict_helper import DictHelper
from .display_helper import Display... | 633 | Python | .py | 16 | 38.5625 | 52 | 0.865478 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,058 | db_helper.py | demigody_nas-tools/app/helper/db_helper.py | import datetime
import os.path
import time
import json
from enum import Enum
from sqlalchemy import cast, func, and_, case
from app.db import MainDb, DbPersist
from app.db.models import *
from app.utils import StringUtils
from app.utils.types import MediaType, RmtMode
class DbHelper:
_db = MainDb()
@DbPersi... | 97,998 | Python | .py | 2,535 | 23.853649 | 120 | 0.499435 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,059 | progress_helper.py | demigody_nas-tools/app/helper/progress_helper.py | from enum import Enum
from app.utils.commons import singleton
from app.utils.types import ProgressKey
@singleton
class ProgressHelper(object):
_process_detail = {}
def __init__(self):
self._process_detail = {}
def init_config(self):
pass
def __reset(self, ptype=ProgressKey.Search):... | 1,500 | Python | .py | 42 | 26.904762 | 70 | 0.599861 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,060 | ocr_helper.py | demigody_nas-tools/app/helper/ocr_helper.py | import requests
import json
from base64 import b64encode
from urllib.parse import urlencode
import log
from config import Config
from app.utils import RequestUtils, StringUtils
class OcrHelper:
_ocr_b64_url = "https://ocr.ddsrem.com/captcha/base64"
_baiduocr_api_key = None
_baiduocr_secret_key = None
... | 4,145 | Python | .py | 96 | 30.614583 | 141 | 0.577638 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,061 | plugin_helper.py | demigody_nas-tools/app/helper/plugin_helper.py | from cachetools import cached, TTLCache
from app.utils import RequestUtils
# 2023年08月30日 nastool原作者服务已失效
class PluginHelper:
@staticmethod
def install(plugin_id):
"""
插件安装统计计数
"""
# return RequestUtils(timeout=5).get(f"https://nastool.org/plugin/{plugin_id}/install")
... | 1,616 | Python | .py | 42 | 28.809524 | 95 | 0.405787 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,062 | display_helper.py | demigody_nas-tools/app/helper/display_helper.py | import os
from pyvirtualdisplay import Display
from app.utils.commons import singleton
from app.utils import ExceptionUtils
from config import XVFB_PATH
@singleton
class DisplayHelper(object):
_display = None
def __init__(self):
self.init_config()
def init_config(self):
self.stop_servi... | 1,031 | Python | .py | 33 | 22.909091 | 72 | 0.606275 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,063 | chrome_helper.py | demigody_nas-tools/app/helper/chrome_helper.py | import json
import os.path
import tempfile
from functools import reduce
from threading import Lock
import requests
import undetected_chromedriver as uc
from webdriver_manager.chrome import ChromeDriverManager
import log
import app.helper.cloudflare_helper as CloudflareHelper
from app.utils import SystemUtils, Request... | 8,562 | Python | .py | 222 | 27.738739 | 99 | 0.58646 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,064 | cloudflare_helper.py | demigody_nas-tools/app/helper/cloudflare_helper.py | import time
import os
from func_timeout import func_timeout, FunctionTimedOut
from pyquery import PyQuery
from selenium.common import TimeoutException
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdrive... | 6,803 | Python | .py | 170 | 32.305882 | 118 | 0.657008 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,065 | openai_helper.py | demigody_nas-tools/app/helper/openai_helper.py | import json
import openai
from app.utils import OpenAISessionCache
from app.utils.commons import singleton
from config import Config
@singleton
class OpenAiHelper:
_api_key = None
_api_url = None
def __init__(self):
self.init_config()
def init_config(self):
self._api_key = Config()... | 7,074 | Python | .py | 196 | 21.005102 | 173 | 0.490362 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,066 | words_helper.py | demigody_nas-tools/app/helper/words_helper.py | import regex as re
import cn2an
from app.helper.db_helper import DbHelper
from app.utils.commons import singleton
from app.utils.exception_utils import ExceptionUtils
@singleton
class WordsHelper:
dbhelper = None
# 识别词
words_info = []
def __init__(self):
self.init_config()
def init_conf... | 10,990 | Python | .py | 226 | 29.181416 | 120 | 0.491607 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,067 | dict_helper.py | demigody_nas-tools/app/helper/dict_helper.py | from app.db import MainDb, DbPersist
from app.db.models import SYSTEMDICT
class DictHelper:
_db = MainDb()
@DbPersist(_db)
def set(self, dtype, key, value, note=""):
"""
设置字典值
:param dtype: 字典类型
:param key: 字典Key
:param value: 字典值
:param note: 备注
... | 2,482 | Python | .py | 79 | 17.78481 | 84 | 0.464459 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,068 | indexer.py | demigody_nas-tools/app/indexer/indexer.py | import datetime
from concurrent.futures import ThreadPoolExecutor, as_completed
import log
from app.helper import ProgressHelper, SubmoduleHelper, DbHelper
from app.utils import ExceptionUtils, StringUtils
from app.utils.commons import singleton
from app.utils.types import SearchType, IndexerType, ProgressKey
from app... | 7,914 | Python | .py | 186 | 25.860215 | 107 | 0.517496 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,069 | indexerConf.py | demigody_nas-tools/app/indexer/indexerConf.py | import json
class IndexerConf(object):
def __init__(self,
datas=None,
siteid=None,
cookie=None,
name=None,
rule=None,
public=None,
proxy=False,
parser=None,
ua=N... | 2,875 | Python | .py | 81 | 22.333333 | 82 | 0.495811 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,070 | _torrentleech.py | demigody_nas-tools/app/indexer/client/_torrentleech.py | from urllib.parse import quote
import log
from app.utils import RequestUtils, StringUtils
from config import Config
class TorrentLeech(object):
_indexer = None
_proxy = None
_size = 100
_searchurl = "%storrents/browse/list/query/%s"
_browseurl = "%storrents/browse/list/page/2%s"
_downloadurl ... | 2,486 | Python | .py | 54 | 33.62963 | 119 | 0.559244 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,071 | _mt_spider.py | demigody_nas-tools/app/indexer/client/_mt_spider.py | import re
from typing import Tuple, List
from app.helper import DbHelper
from app.media.tmdbv3api.tmdb import logger
from app.sites import Sites
from app.sites.mt import MtFunc
from app.utils import RequestUtils
from app.utils.types import MediaType
from config import Config
class MTorrentSpider:
"""
mTorren... | 5,736 | Python | .py | 157 | 24.840764 | 119 | 0.5081 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,072 | _tnode.py | demigody_nas-tools/app/indexer/client/_tnode.py | import re
import log
from app.utils import RequestUtils, StringUtils
from config import Config
class TNodeSpider(object):
_indexerid = None
_domain = None
_name = ""
_proxy = None
_cookie = None
_ua = None
_token = None
_size = 100
_searchurl = "%sapi/torrent/advancedSearch"
_... | 3,692 | Python | .py | 90 | 28.422222 | 108 | 0.515727 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,073 | builtin.py | demigody_nas-tools/app/indexer/client/builtin.py | import copy
import datetime
import time
import log
from app.conf import SystemConfig
from app.helper import ProgressHelper, ChromeHelper, DbHelper
from app.indexer.client._base import _IIndexClient
from app.indexer.client._mt_spider import MTorrentSpider
from app.indexer.client._render_spider import RenderSpider
from ... | 13,103 | Python | .py | 283 | 27.756184 | 109 | 0.50741 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,074 | _spider.py | demigody_nas-tools/app/indexer/client/_spider.py | import copy
import datetime
import re
from urllib.parse import quote
from jinja2 import Template
from pyquery import PyQuery
import feapder
import log
from app.helper import RedisHelper
from app.utils import StringUtils, SystemUtils, RequestUtils
from app.utils.exception_utils import ExceptionUtils
from app.utils.typ... | 27,794 | Python | .py | 626 | 30.439297 | 118 | 0.54184 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,075 | _plugins.py | demigody_nas-tools/app/indexer/client/_plugins.py |
from app.plugins import PluginManager
from config import Config
class PluginsSpider(object):
# 私有方法
_level = 99
_plugin = {}
_proxy = None
_indexer = None
def __int__(self, indexer):
self._indexer = indexer
if indexer.proxy:
self._proxy = Config().get_proxies()
... | 1,503 | Python | .py | 39 | 28.153846 | 142 | 0.587586 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,076 | _render_spider.py | demigody_nas-tools/app/indexer/client/_render_spider.py | # coding: utf-8
import copy
import time
from urllib.parse import quote
from pyquery import PyQuery
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as es
from selenium.webdriver.support.wait import WebDriverWait
from app.helper import ChromeHelper
from app.indexer... | 5,260 | Python | .py | 126 | 26.02381 | 107 | 0.518625 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,077 | _base.py | demigody_nas-tools/app/indexer/client/_base.py | import datetime
from abc import ABCMeta, abstractmethod
import log
from app.filter import Filter
from app.helper import ProgressHelper
from app.media import Media
from app.media.meta import MetaInfo
from app.utils.types import MediaType, SearchType, ProgressKey
from config import Config
class _IIndexClient(metaclass... | 14,281 | Python | .py | 275 | 27.472727 | 125 | 0.43825 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,078 | plugin_manager.py | demigody_nas-tools/app/plugins/plugin_manager.py | import os.path
import traceback
from threading import Thread
import log
from app.conf import SystemConfig
from app.helper import SubmoduleHelper
from app.plugins.event_manager import EventManager
from app.utils import SystemUtils, PathUtils, ImageUtils
from app.utils.commons import singleton
from app.utils.types impor... | 11,188 | Python | .py | 310 | 23.122581 | 102 | 0.528211 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,079 | event_manager.py | demigody_nas-tools/app/plugins/event_manager.py | from queue import Queue, Empty
import log
from app.utils.commons import singleton
from app.utils.types import EventType
@singleton
class EventManager:
"""
事件管理器
"""
# 事件队列
_eventQueue = None
# 事件响应函数字典
_handlers = {}
def __init__(self):
# 事件队列
self._eventQueue = Queu... | 2,771 | Python | .py | 89 | 19.651685 | 63 | 0.543346 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,080 | __init__.py | demigody_nas-tools/app/plugins/__init__.py | from .event_manager import EventManager, EventHandler, Event
from .plugin_manager import PluginManager
| 103 | Python | .py | 2 | 50.5 | 60 | 0.861386 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,081 | autosignin.py | demigody_nas-tools/app/plugins/modules/autosignin.py | import re
import time
from datetime import datetime, timedelta
from multiprocessing.dummy import Pool as ThreadPool
from multiprocessing.pool import ThreadPool
from threading import Event
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.date import DateTrigger
fro... | 35,365 | Python | .py | 728 | 26.175824 | 172 | 0.450065 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,082 | torrenttransfer.py | demigody_nas-tools/app/plugins/modules/torrenttransfer.py | import os.path
from copy import deepcopy
from datetime import datetime, timedelta
from threading import Event
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
from bencode import bdecode, bencode
from app.downloader import Downloader
from ... | 29,855 | Python | .py | 650 | 22.34 | 187 | 0.423361 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,083 | webhook.py | demigody_nas-tools/app/plugins/modules/webhook.py | from app.plugins import EventHandler
from app.plugins.modules._base import _IPluginModule
from app.utils import RequestUtils
from app.utils.types import EventType
class Webhook(_IPluginModule):
# 插件名称
module_name = "Webhook"
# 插件描述
module_desc = "事件发生时向第三方地址发送请求。"
# 插件图标
module_icon = "webhook... | 3,469 | Python | .py | 98 | 17.744898 | 108 | 0.410315 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,084 | doubansync.py | demigody_nas-tools/app/plugins/modules/doubansync.py | import random
from datetime import datetime, timedelta
from threading import Event, Lock
from time import sleep
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
from jinja2 import Template
from app.downloader import Downloader
from app.media import DouBan
from app.media.meta import MetaIn... | 33,938 | Python | .py | 702 | 22.7849 | 138 | 0.379621 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,085 | synctimer.py | demigody_nas-tools/app/plugins/modules/synctimer.py | from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
from app.plugins.modules._base import _IPluginModule
from app.sync import Sync
from config import Config
class SyncTimer(_IPluginModule):
# 插件名称
module_name = "定时目录同步"
# 插件描述
module_des... | 3,168 | Python | .py | 92 | 18.108696 | 119 | 0.472494 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,086 | autobackup.py | demigody_nas-tools/app/plugins/modules/autobackup.py | import glob
import os
import time
from datetime import datetime, timedelta
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
from threading import Event
from app.plugins.modules._base import _IPluginModule
from app.utils import SystemUtils
... | 9,382 | Python | .py | 233 | 19.004292 | 117 | 0.385846 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,087 | media_library_archive.py | demigody_nas-tools/app/plugins/modules/media_library_archive.py | import os
from app.plugins.modules._base import _IPluginModule
from threading import Event
from app.utils import SystemUtils
from config import Config
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
import pytz
from datetime import datetime, timedelta
... | 25,692 | Python | .py | 557 | 30.039497 | 4,877 | 0.564892 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,088 | cookiecloud.py | demigody_nas-tools/app/plugins/modules/cookiecloud.py | from collections import defaultdict
from datetime import datetime, timedelta
from threading import Event
from datetime import datetime
from jinja2 import Template
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
from app.plugins.modules._b... | 19,754 | Python | .py | 464 | 22.390086 | 186 | 0.424386 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,089 | customreleasegroups.py | demigody_nas-tools/app/plugins/modules/customreleasegroups.py | from app.media.meta.release_groups import ReleaseGroupsMatcher
from app.plugins.modules._base import _IPluginModule
class CustomReleaseGroups(_IPluginModule):
# 插件名称
module_name = "自定义制作组/字幕组"
# 插件描述
module_desc = "添加无法识别的制作组/字幕组,自定义多个组间分隔符"
# 插件图标
module_icon = "teamwork.png"
# 主题色
mo... | 3,882 | Python | .py | 93 | 21.344086 | 100 | 0.449445 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,090 | diskspacesaver.py | demigody_nas-tools/app/plugins/modules/diskspacesaver.py | import copy
import datetime
import hashlib
import json
import os
from app.plugins.modules._base import _IPluginModule
from app.utils import SystemUtils
class DiskSpaceSaver(_IPluginModule):
# 插件名称
module_name = "磁盘空间释放"
# 插件描述
module_desc = "计算文件SHA1,同磁盘下相同SHA1的文件只保留一个,其他的用硬链接替换。"
# 插件图标
modu... | 15,051 | Python | .py | 316 | 24.009494 | 103 | 0.438784 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,091 | cloudflarespeedtest.py | demigody_nas-tools/app/plugins/modules/cloudflarespeedtest.py | import os
from datetime import datetime, timedelta
from pathlib import Path
from threading import Event
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
from app.plugins import EventManager, EventHandler
from app.plugins.modules._base impo... | 22,342 | Python | .py | 498 | 29.022088 | 264 | 0.44371 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,092 | doubanrank.py | demigody_nas-tools/app/plugins/modules/doubanrank.py | import re
import xml.dom.minidom
from datetime import datetime, timedelta
from threading import Event
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
from jinja2 import Template
from app.helper import RssHelper
from app.media import Media... | 23,499 | Python | .py | 516 | 22.672481 | 136 | 0.39392 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,093 | movierandom.py | demigody_nas-tools/app/plugins/modules/movierandom.py | import random
from datetime import datetime, timedelta
from threading import Event
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
from jinja2 import Template
import log
from app.conf import ModuleConf
from app.helper import RssHelper
fro... | 19,240 | Python | .py | 455 | 22.037363 | 139 | 0.416585 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,094 | torrentremover.py | demigody_nas-tools/app/plugins/modules/torrentremover.py | import os
from app.downloader import Downloader
from app.plugins import EventHandler
from app.plugins.modules._base import _IPluginModule
from app.utils.types import EventType
from config import Config
class TorrentRemover(_IPluginModule):
# 插件名称
module_name = "下载任务联动删除"
# 插件描述
module_desc = "历史记录中源文... | 8,254 | Python | .py | 186 | 24.569892 | 152 | 0.501969 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,095 | movielike.py | demigody_nas-tools/app/plugins/modules/movielike.py | import os
from app.filetransfer import FileTransfer
from app.media import Category
from app.mediaserver import MediaServer
from app.plugins import EventHandler
from app.plugins.modules._base import _IPluginModule
from app.utils import SystemUtils
from app.utils.types import EventType, MediaServerType, MediaType
from c... | 8,803 | Python | .py | 218 | 20.724771 | 157 | 0.427359 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,096 | iyuuautoseed.py | demigody_nas-tools/app/plugins/modules/iyuuautoseed.py | import re
from copy import deepcopy
from datetime import datetime, timedelta
from threading import Event
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
from jinja2 import Template
from lxml import etree
from app.downloader import Downloa... | 36,010 | Python | .py | 827 | 23.350665 | 164 | 0.451978 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,097 | mediasyncdel.py | demigody_nas-tools/app/plugins/modules/mediasyncdel.py | import os
import time
from app.filetransfer import FileTransfer
from app.media import Media
from app.plugins import EventHandler
from app.plugins.modules._base import _IPluginModule
from app.utils.types import EventType, MediaType
from web.action import WebAction
class MediaSyncDel(_IPluginModule):
# 插件名称
mo... | 9,519 | Python | .py | 222 | 23.810811 | 139 | 0.476833 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,098 | libraryrefresh.py | demigody_nas-tools/app/plugins/modules/libraryrefresh.py | from app.mediaserver import MediaServer
from app.plugins import EventHandler
from app.plugins.modules._base import _IPluginModule
from app.utils.types import EventType
from datetime import datetime, timedelta
from app.utils import ExceptionUtils
from apscheduler.schedulers.background import BackgroundScheduler
from co... | 5,744 | Python | .py | 148 | 21.547297 | 120 | 0.486383 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,289,099 | chinesesubfinder.py | demigody_nas-tools/app/plugins/modules/chinesesubfinder.py | import os.path
from functools import lru_cache
from app.plugins import EventHandler
from app.plugins.modules._base import _IPluginModule
from app.utils import RequestUtils
from app.utils.types import MediaType, EventType
from config import Config
class ChineseSubFinder(_IPluginModule):
# 插件名称
module_name = "... | 8,891 | Python | .py | 215 | 21.539535 | 99 | 0.410389 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |