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,288,900 | batch_spider.py | demigody_nas-tools/third_party/feapder/feapder/core/spiders/batch_spider.py | # -*- coding: utf-8 -*-
"""
Created on 2020/4/22 12:06 AM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import datetime
import os
import time
import warnings
from collections.abc import Iterable
import feapder.setting as setting
import feapder.utils.tools as tools
from feapder.core.ba... | 49,433 | Python | .py | 1,040 | 26.165385 | 190 | 0.474069 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,901 | spider.py | demigody_nas-tools/third_party/feapder/feapder/core/spiders/spider.py | # -*- coding: utf-8 -*-
"""
Created on 2020/4/22 12:05 AM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import time
import warnings
from collections.abc import Iterable
import feapder.setting as setting
import feapder.utils.tools as tools
from feapder.core.base_parser import BaseParse... | 13,420 | Python | .py | 316 | 26.25 | 125 | 0.549328 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,902 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/core/spiders/__init__.py | # -*- coding: utf-8 -*-
"""
Created on 2020/4/22 12:08 AM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
__all__ = ["AirSpider", "TaskSpider", "Spider", "BatchSpider"]
from feapder.core.spiders.air_spider import AirSpider
from feapder.core.spiders.spider import Spider
from feapder.core... | 417 | Python | .py | 14 | 28.642857 | 62 | 0.738155 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,903 | air_spider.py | demigody_nas-tools/third_party/feapder/feapder/core/spiders/air_spider.py | # -*- coding: utf-8 -*-
"""
Created on 2020/4/22 12:05 AM
---------
@summary: 基于内存队列的爬虫,不支持分布式
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
from threading import Thread
import feapder.setting as setting
import feapder.utils.tools as tools
from feapder.buffer.item_buffer import ItemBuffer
from feapder.bu... | 4,372 | Python | .py | 109 | 26.59633 | 88 | 0.580933 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,904 | cmdline.py | demigody_nas-tools/third_party/feapder/feapder/commands/cmdline.py | # -*- coding: utf-8 -*-
"""
Created on 2020/5/8 2:24 PM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import re
import sys
from os.path import dirname, join
import os
import requests
from feapder.commands import create_builder
from feapder.commands import retry
from feapder.commands ... | 3,824 | Python | .py | 93 | 27.172043 | 86 | 0.517875 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,905 | zip.py | demigody_nas-tools/third_party/feapder/feapder/commands/zip.py | # -*- coding: utf-8 -*-
"""
Created on 2022/2/13 12:59 上午
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import argparse
import os
import re
import zipfile
def is_ignore_file(ignore_files: list, filename):
for ignore_file in ignore_files:
if re.search(ignore_file, filename... | 2,572 | Python | .py | 62 | 31.467742 | 84 | 0.616528 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,906 | create_builder.py | demigody_nas-tools/third_party/feapder/feapder/commands/create_builder.py | # -*- coding: utf-8 -*-
"""
Created on 2021/2/8 11:21 上午
---------
@summary: 生成器
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import argparse
from terminal_layout import Fore
from terminal_layout.extensions.choice import Choice, StringStyle
import feapder.setting as setting
from feapder.commands.create ... | 3,984 | Python | .py | 107 | 28.186916 | 97 | 0.606476 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,907 | retry.py | demigody_nas-tools/third_party/feapder/feapder/commands/retry.py | # -*- coding: utf-8 -*-
"""
Created on 2022/11/18 12:33 PM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import argparse
from feapder.core.handle_failed_items import HandleFailedItems
from feapder.core.handle_failed_requests import HandleFailedRequests
def retry_failed_requests(redis... | 1,354 | Python | .py | 43 | 25.813953 | 87 | 0.6744 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,908 | shell.py | demigody_nas-tools/third_party/feapder/feapder/commands/shell.py | # -*- coding: utf-8 -*-
"""
Created on 2020/5/9 12:37 AM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import argparse
import re
import shlex
import sys
import IPython
import pyperclip
from feapder import Request
from feapder.utils import tools
def parse_curl(curl_str):
parser ... | 5,514 | Python | .py | 176 | 24.261364 | 81 | 0.591191 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,909 | create_project.py | demigody_nas-tools/third_party/feapder/feapder/commands/create/create_project.py | # -*- coding: utf-8 -*-
"""
Created on 2018-08-28 17:38:43
---------
@summary: 创建项目
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import getpass
import os
import shutil
import feapder.utils.tools as tools
def deal_file_info(file):
file = file.replace("{DATE}", tools.get_current_date())
file = ... | 1,360 | Python | .py | 39 | 26.153846 | 81 | 0.579937 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,910 | create_params.py | demigody_nas-tools/third_party/feapder/feapder/commands/create/create_params.py | # -*- coding: utf-8 -*-
"""
Created on 2021/4/25 10:22 上午
---------
@summary: 将浏览器的cookie转为request的cookie
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import sys
from feapder.utils.tools import dumps_json
class CreateParams:
def get_data(self):
"""
@summary: 从控制台读取多行
------... | 1,106 | Python | .py | 40 | 19.125 | 52 | 0.517413 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,911 | create_init.py | demigody_nas-tools/third_party/feapder/feapder/commands/create/create_init.py | # -*- coding: utf-8 -*-
"""
Created on 2018-08-28 17:38:43
---------
@summary: 创建__init__.py
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
from feapder.utils.tools import dumps_json
class CreateInit:
def create(self):
__all__ = []
import os
path = os.getcwd()
for f... | 670 | Python | .py | 23 | 22.434783 | 72 | 0.52044 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,912 | create_spider.py | demigody_nas-tools/third_party/feapder/feapder/commands/create/create_spider.py | # -*- coding: utf-8 -*-
"""
Created on 2018-08-28 17:38:43
---------
@summary: 创建spider
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import getpass
import os
import re
import feapder.utils.tools as tools
from .create_init import CreateInit
def deal_file_info(file):
file = file.replace("{DATE}", t... | 3,648 | Python | .py | 84 | 32.345238 | 104 | 0.580748 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,913 | create_table.py | demigody_nas-tools/third_party/feapder/feapder/commands/create/create_table.py | # -*- coding: utf-8 -*-
"""
Created on 2018-08-28 17:38:43
---------
@summary: 根据json生成表
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import time
import pyperclip
import feapder.setting as setting
import feapder.utils.tools as tools
from feapder.db.mysqldb import MysqlDB
from feapder.utils.tools impor... | 4,288 | Python | .py | 125 | 20.44 | 88 | 0.450843 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,914 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/commands/create/__init__.py | __all__ = [
"CreateProject",
"CreateSpider",
"CreateItem",
"CreateInit",
"CreateJson",
"CreateTable",
"CreateCookies",
"CreateSetting",
"CreateParams",
]
from .create_table import CreateTable
from .create_json import CreateJson
from .create_spider import CreateSpider
from .create_in... | 543 | Python | .py | 20 | 24.3 | 41 | 0.775862 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,915 | create_json.py | demigody_nas-tools/third_party/feapder/feapder/commands/create/create_json.py | # -*- coding: utf-8 -*-
"""
Created on 2018-08-28 17:38:43
---------
@summary: 字符串转json
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import pyperclip
import feapder.utils.tools as tools
class CreateJson:
def get_data(self):
"""
@summary: 从控制台读取多行
---------
--------... | 1,366 | Python | .py | 43 | 21.162791 | 67 | 0.505747 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,916 | create_item.py | demigody_nas-tools/third_party/feapder/feapder/commands/create/create_item.py | # -*- coding: utf-8 -*-
"""
Created on 2018-08-28 17:38:43
---------
@summary: 创建item
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import getpass
import os
import feapder.utils.tools as tools
from feapder import setting
from feapder.db.mysqldb import MysqlDB
from .create_init import CreateInit
def de... | 6,004 | Python | .py | 142 | 30.570423 | 218 | 0.555808 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,917 | create_setting.py | demigody_nas-tools/third_party/feapder/feapder/commands/create/create_setting.py | # -*- coding: utf-8 -*-
"""
Created on 2021/4/23 13:20
---------
@summary: 生成配置文件
---------
@author: mkdir700
@email: mkdir700@gmail.com
"""
import os
import shutil
class CreateSetting:
def create(self):
if os.path.exists("setting.py"):
confirm = input("配置文件已存在 是否覆盖 (y/n). ")
if... | 693 | Python | .py | 23 | 21.391304 | 84 | 0.559603 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,918 | create_cookies.py | demigody_nas-tools/third_party/feapder/feapder/commands/create/create_cookies.py | # -*- coding: utf-8 -*-
"""
Created on 2021/4/25 10:22 上午
---------
@summary: 将浏览器的cookie转为request的cookie
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import json
import pyperclip
from feapder.utils.tools import get_cookies_from_str, print_pretty
class CreateCookies:
def get_data(self):
"... | 975 | Python | .py | 34 | 19.294118 | 66 | 0.562201 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,919 | run.py | demigody_nas-tools/tests/run.py | import unittest
from tests.test_metainfo import MetaInfoTest
if __name__ == '__main__':
suite = unittest.TestSuite()
# 测试名称识别
suite.addTest(MetaInfoTest('test_metainfo'))
# 运行测试
runner = unittest.TextTestRunner()
runner.run(suite)
| 278 | Python | .py | 9 | 24.666667 | 48 | 0.703252 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,920 | tests_utils.py | demigody_nas-tools/tests/tests_utils.py | from lxml import etree
import re
from guessit.jsonutils import GuessitEncoder
from guessit.api import guessit, properties, suggested_expected, GuessitException, default_api
import json
class TestUtils:
@staticmethod
def clear_file_name(name):
if not name:
return None
replacement_d... | 2,689 | Python | .py | 59 | 35.440678 | 247 | 0.635967 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,921 | playground.py | demigody_nas-tools/tests/playground.py | import os
import sys
# # # 获取当前文件所在目录的上层目录,即项目根目录
# project_root = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
# # 将项目根目录添加到模块搜索路径中
# sys.path.append(project_root)
# from app.helper import OcrHelper
# from app.media.meta import MediaItem
from tests_utils import TestUtils
def main():
print("hello ... | 3,773 | Python | .py | 71 | 47.774648 | 211 | 0.68608 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,922 | test_metainfo.py | demigody_nas-tools/tests/test_metainfo.py | # -*- coding: utf-8 -*-
from unittest import TestCase
from app.media.meta import MetaInfo
from tests.cases.meta_cases import meta_cases
class MetaInfoTest(TestCase):
def setUp(self) -> None:
pass
def tearDown(self) -> None:
pass
def test_metainfo(self):
for info in meta_cases:
... | 1,156 | Python | .py | 28 | 29.785714 | 88 | 0.540998 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,923 | meta_cases.py | demigody_nas-tools/tests/cases/meta_cases.py | meta_cases = [{
"title": "The Long Season 2017 2160p WEB-DL H265 AAC-XXX",
"subtitle": "",
"target": {
"type": "电影",
"cn_name": "",
"en_name": "The Long Season",
"year": "2017",
"part": "",
"season": "",
"episode": "",
"restype": "WEB-DL",
... | 25,759 | Python | .py | 945 | 18.372487 | 146 | 0.431356 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,924 | security.py | demigody_nas-tools/web/security.py | import base64
import datetime
import hashlib
import hmac
import json
import os
import log
from functools import wraps, partial
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
from cryptography.fernet import Fernet
from base64 import b64encode
import jwt
from flask import request
from app.utils impor... | 6,323 | Python | .py | 191 | 23.115183 | 96 | 0.599643 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,925 | apiv1.py | demigody_nas-tools/web/apiv1.py | from flask import Blueprint, request
from flask_restx import Api, reqparse, Resource
from app.brushtask import BrushTask
from app.rsschecker import RssChecker
from app.sites import Sites
from app.utils import TokenCache
from config import Config
from web.action import WebAction
from web.backend.pro_user import ProUser... | 85,303 | Python | .py | 1,914 | 35.392894 | 115 | 0.660688 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,926 | action.py | demigody_nas-tools/web/action.py | import base64
import datetime
import importlib
import inspect
import json
import os.path
import re
import shutil
import signal
import sqlite3
import time
from math import floor
from pathlib import Path
from typing import Dict, Optional
from urllib.parse import unquote
import ast
import copy
import cn2an
from flask_log... | 217,841 | Python | .py | 5,117 | 25.413328 | 120 | 0.463176 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,927 | main.py | demigody_nas-tools/web/main.py | import base64
import datetime
import hashlib
import mimetypes
import os.path
import re
import time
import traceback
import urllib
import xml.dom.minidom
from functools import wraps
from math import floor
from pathlib import Path
from threading import Lock
from urllib import parse
from urllib.parse import quote, unquote... | 70,971 | Python | .py | 1,713 | 28.457093 | 252 | 0.557514 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,928 | user.cpython-310-darwin.so | demigody_nas-tools/web/backend/user.cpython-310-darwin.so | Êşº¾ @ ш @ · ... | 1,332,663 | Python | .py | 2,079 | 631.529582 | 129,640 | 0.463119 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,929 | WXBizMsgCrypt3.py | demigody_nas-tools/web/backend/WXBizMsgCrypt3.py | #!/usr/bin/env python
# -*- encoding:utf-8 -*-
""" 对企业微信发送给企业后台的消息加解密示例代码.
@copyright: Copyright (c) 1998-2014 Tencent Inc.
"""
import base64
import hashlib
# ------------------------------------------------------------------------
import logging
import random
import socket
import struct
import time
import xml.etree.... | 11,017 | Python | .py | 263 | 28.13308 | 108 | 0.617936 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,930 | web_utils.py | demigody_nas-tools/web/backend/web_utils.py | from functools import lru_cache
import cn2an
from app.media import Media, Bangumi, DouBan
from app.media.meta import MetaInfo
from app.utils import StringUtils, ExceptionUtils, SystemUtils, RequestUtils, IpUtils
from app.utils.types import MediaType
from config import Config
from version import APP_VERSION
class We... | 8,352 | Python | .py | 197 | 26.492386 | 117 | 0.497737 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,931 | wallpaper.py | demigody_nas-tools/web/backend/wallpaper.py | import base64
import datetime
from functools import lru_cache
import log
from app.media import Media
from app.utils import RequestUtils, ExceptionUtils
from config import Config
def get_login_wallpaper(time_now=None):
"""
获取Base64编码的壁纸图片
"""
if not time_now:
time_now = datetime.datetime.now()... | 2,525 | Python | .py | 68 | 27.823529 | 96 | 0.619508 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,932 | search_torrents.py | demigody_nas-tools/web/backend/search_torrents.py | import os.path
import re
import log
from app.downloader import Downloader
from app.helper import ProgressHelper
from app.helper.openai_helper import OpenAiHelper
from app.indexer import Indexer
from app.media import Media, DouBan
from app.message import Message
from app.searcher import Searcher
from app.sites import S... | 23,342 | Python | .py | 458 | 27.292576 | 119 | 0.459801 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,933 | user.cp310-win_amd64.pyd | demigody_nas-tools/web/backend/user.cp310-win_amd64.pyd | MZ� ÿÿ ¸ @ º ´ Í!¸LÍ!This program cannot be run in DOS mode.
$ Òí�
–Œğ^–Œğ^–Œğ^Ÿôc^”Œğ^Ùğñ_”Œğ^İôñ_”Œğ^Ùğõ_›Œğ^Ùğô_�Œğ^Ùğó_•Œğ^Tùñ_•Œğ^–Œñ^4Œğ^^ğø_—Œğ^^ğğ_—Œğ^^ğ^—Œğ^^ğò_—Œğ^Rich–Œğ^ PE d† ermd ğ " " * ˜ À, € ... | 304,128 | Python | .py | 708 | 416.185028 | 10,690 | 0.412056 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,934 | pro_user.py | demigody_nas-tools/web/backend/pro_user.py | from flask_login import UserMixin
from werkzeug.security import check_password_hash
from operator import itemgetter
import json
import os
from base64 import b64decode
import log
from app.helper import DbHelper
from config import Config
from app.conf import ModuleConf
from app.utils import StringUtils
from app.indexer.... | 47,657 | Python | .py | 332 | 129.542169 | 1,362 | 0.478594 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,935 | sync.py | demigody_nas-tools/app/sync.py | import os
import threading
import traceback
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
from watchdog.observers.polling import PollingObserver
import log
from app.conf import ModuleConf
from app.filetransfer import FileTransfer
from app.helper import DbHelper
from app.ut... | 20,822 | Python | .py | 439 | 25.968109 | 116 | 0.46064 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,936 | filter.py | demigody_nas-tools/app/filter.py | import re
import log
from app.conf import ModuleConf
from app.helper import DbHelper
from app.media.meta import ReleaseGroupsMatcher
from app.utils import StringUtils
from app.utils.commons import singleton
from app.utils.types import MediaType
@singleton
class Filter:
rg_matcher = None
dbhelper = None
_... | 15,667 | Python | .py | 365 | 26.241096 | 142 | 0.507965 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,937 | subscribe.py | demigody_nas-tools/app/subscribe.py | import json
from threading import Lock
import log
from app.conf import SystemConfig
from app.downloader import Downloader
from app.filter import Filter
from app.helper import DbHelper, MetaHelper
from app.indexer import Indexer
from app.media import Media, DouBan
from app.media.meta import MetaInfo
from app.message im... | 49,226 | Python | .py | 994 | 27.28672 | 120 | 0.457321 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,938 | torrentremover.py | demigody_nas-tools/app/torrentremover.py | import json
from threading import Lock
from apscheduler.schedulers.background import BackgroundScheduler
import log
from app.conf import ModuleConf
from app.downloader import Downloader
from app.helper import DbHelper
from app.message import Message
from app.utils import ExceptionUtils
from app.utils.commons import s... | 13,543 | Python | .py | 311 | 27.247588 | 108 | 0.509232 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,939 | scheduler.py | demigody_nas-tools/app/scheduler.py | import datetime
import pytz
from apscheduler.executors.pool import ThreadPoolExecutor
from apscheduler.schedulers.background import BackgroundScheduler
import log
from app.helper import MetaHelper
from app.mediaserver import MediaServer
from app.rss import Rss
from app.sites import SiteUserInfo
from app.subscribe imp... | 7,629 | Python | .py | 148 | 32.601351 | 140 | 0.573399 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,940 | searcher.py | demigody_nas-tools/app/searcher.py | import log
from app.helper import DbHelper
from app.indexer import Indexer
from app.plugins import EventManager
from app.utils.commons import singleton
from config import Config
from app.message import Message
from app.downloader import Downloader
from app.media import Media
from app.helper import ProgressHelper
from a... | 9,359 | Python | .py | 211 | 24.981043 | 108 | 0.49281 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,941 | rsschecker.py | demigody_nas-tools/app/rsschecker.py | import json
import time
import traceback
import jsonpath
from apscheduler.executors.pool import ThreadPoolExecutor
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
from lxml import etree
import log
from app.downloader import Downloader
from app.filter... | 36,183 | Python | .py | 770 | 27.125974 | 119 | 0.47248 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,942 | brushtask.py | demigody_nas-tools/app/brushtask.py | import re
import sys
import time
from datetime import datetime
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
import log
from app.downloader import Downloader
from app.filter import Filter
from app.helper import DbHelper, RssHelper
from ... | 51,154 | Python | .py | 991 | 29.169526 | 118 | 0.469909 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,943 | rss.py | demigody_nas-tools/app/rss.py | import re
from threading import Lock
import log
from app.downloader import Downloader
from app.filter import Filter
from app.helper import DbHelper, RssHelper
from app.media import Media
from app.media.meta import MetaInfo
from app.message import Message
from app.sites import Sites, SiteConf
from app.subscribe import ... | 29,243 | Python | .py | 577 | 24.270364 | 118 | 0.406132 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,944 | filetransfer.py | demigody_nas-tools/app/filetransfer.py | import argparse
import os
import random
import re
import shutil
import traceback
from enum import Enum
from threading import Lock
from time import sleep
import log
from app.conf import ModuleConf
from app.helper import DbHelper, ProgressHelper
from app.helper import ThreadHelper
from app.media import Media, Category, ... | 71,177 | Python | .py | 1,385 | 29.405054 | 124 | 0.489628 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,945 | bangumi.py | demigody_nas-tools/app/media/bangumi.py | from datetime import datetime
from functools import lru_cache
import requests
from app.utils import RequestUtils
from app.utils.types import MediaType
class Bangumi(object):
"""
https://bangumi.github.io/api/
"""
_urls = {
"calendar": "calendar",
"detail": "v0/subjects/%s",
}
... | 2,870 | Python | .py | 93 | 20.935484 | 105 | 0.501287 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,946 | category.py | demigody_nas-tools/app/media/category.py | import os
import shutil
import ruamel.yaml
import log
from app.utils import ExceptionUtils
from config import Config
from app.utils.commons import singleton
@singleton
class Category:
_category_path = None
_categorys = None
_tv_categorys = None
_movie_categorys = None
_anime_categorys = None
... | 5,580 | Python | .py | 156 | 21.929487 | 100 | 0.53251 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,947 | fanart.py | demigody_nas-tools/app/media/fanart.py | from functools import lru_cache
from app.utils import RequestUtils, ExceptionUtils
from app.utils.types import MediaType
from config import Config, FANART_MOVIE_API_URL, FANART_TV_API_URL
class Fanart:
_proxies = Config().get_proxies()
_movie_image_types = ['movieposter',
'hdmovielo... | 8,237 | Python | .py | 202 | 27.470297 | 118 | 0.535359 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,948 | __init__.py | demigody_nas-tools/app/media/__init__.py | from .category import Category
from .media import Media
from .scraper import Scraper
from .douban import DouBan
from .bangumi import Bangumi
| 141 | Python | .py | 5 | 27.2 | 30 | 0.852941 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,949 | media.py | demigody_nas-tools/app/media/media.py | import difflib
import os
import random
import re
import traceback
from functools import lru_cache
import zhconv
from lxml import etree
import log
from app.helper import MetaHelper
from app.helper.openai_helper import OpenAiHelper
from app.media.meta.metainfo import MetaInfo
from app.media.tmdbv3api import TMDb, Searc... | 96,269 | Python | .py | 2,270 | 25.314097 | 540 | 0.4788 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,950 | scraper.py | demigody_nas-tools/app/media/scraper.py | import os.path
import re
import time
from xml.dom import minidom
import zhconv
from requests.exceptions import RequestException
import log
from app.conf import SystemConfig, ModuleConf
from app.helper import FfmpegHelper
from app.media import Media
from app.media.douban import DouBan
from app.media.meta import MetaIn... | 39,157 | Python | .py | 741 | 32.481781 | 118 | 0.489771 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,951 | douban.py | demigody_nas-tools/app/media/douban.py | import random
from threading import Lock
from time import sleep
import zhconv
import log
from app.media.doubanapi import DoubanApi, DoubanWeb
from app.media.meta import MetaInfo
from app.utils import ExceptionUtils, StringUtils
from app.utils import RequestUtils
from app.utils.commons import singleton
from app.utils.... | 18,790 | Python | .py | 434 | 28.085253 | 112 | 0.511774 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,952 | as_obj.py | demigody_nas-tools/app/media/tmdbv3api/as_obj.py | # encoding: utf-8
import sys
from app.media.tmdbv3api.exceptions import TMDbException
class AsObj:
def __init__(self, **entries):
if "success" in entries and entries["success"] is False:
raise TMDbException(entries["status_message"])
for key, value in entries.items():
if i... | 2,217 | Python | .py | 59 | 29.305085 | 93 | 0.572433 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,953 | __init__.py | demigody_nas-tools/app/media/tmdbv3api/__init__.py | from .tmdb import TMDb
from .exceptions import TMDbException
from .objs.movie import Movie
from .objs.search import Search
from .objs.tv import TV
from .objs.person import Person
from .objs.find import Find
from .objs.discover import Discover
from .objs.trending import Trending
from .objs.episode import Episode
from .o... | 343 | Python | .py | 11 | 30.181818 | 37 | 0.840361 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,954 | tmdb.py | demigody_nas-tools/app/media/tmdbv3api/tmdb.py | # -*- coding: utf-8 -*-
import logging
import os
import time
from functools import lru_cache
import requests
import requests.exceptions
from .as_obj import AsObj
from .exceptions import TMDbException
from app.utils.commons import ttl_lru
logger = logging.getLogger(__name__)
class TMDb(object):
TMDB_API_KEY = ... | 6,661 | Python | .py | 172 | 29.930233 | 117 | 0.611266 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,955 | trending.py | demigody_nas-tools/app/media/tmdbv3api/objs/trending.py | from app.media.tmdbv3api.tmdb import TMDb
class Trending(TMDb):
_urls = {"trending": "/trending/%s/%s"}
def _trending(self, media_type="all", time_window="day", page=1):
return self._get_obj(
self._call(
self._urls["trending"] % (media_type, time_window),
"... | 2,052 | Python | .py | 66 | 22.409091 | 81 | 0.542278 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,956 | movie.py | demigody_nas-tools/app/media/tmdbv3api/objs/movie.py | import warnings
from app.media.tmdbv3api.as_obj import AsObj
from app.media.tmdbv3api.tmdb import TMDb
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
class Movie(TMDb):
_ur... | 9,048 | Python | .py | 266 | 24.845865 | 135 | 0.543471 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,957 | person.py | demigody_nas-tools/app/media/tmdbv3api/objs/person.py | from app.media.tmdbv3api.as_obj import AsObj
from app.media.tmdbv3api.tmdb import TMDb
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
class Person(TMDb):
_urls = {
"details": "/person/%s",
"changes": "/person/%s/changes",
"movie_credits": ... | 4,328 | Python | .py | 134 | 22.716418 | 108 | 0.524402 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,958 | search.py | demigody_nas-tools/app/media/tmdbv3api/objs/search.py | from app.media.tmdbv3api.tmdb import TMDb
from app.utils import StringUtils
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
class Search(TMDb):
_urls = {
"companies": "/search/company",
"collections": "/search/collection",
"keywords": "/sea... | 2,532 | Python | .py | 80 | 23.5125 | 86 | 0.573535 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,959 | discover.py | demigody_nas-tools/app/media/tmdbv3api/objs/discover.py | from app.media.tmdbv3api.tmdb import TMDb
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
class Discover(TMDb):
_urls = {
"movies": "/discover/movie",
"tvs": "/discover/tv"
}
def discover_movies(self, params, page=1):
"""
D... | 1,795 | Python | .py | 60 | 20.416667 | 115 | 0.538462 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,960 | tv.py | demigody_nas-tools/app/media/tmdbv3api/objs/tv.py | from app.media.tmdbv3api.as_obj import AsObj
from app.media.tmdbv3api.tmdb import TMDb
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
class TV(TMDb):
_urls = {
"details": "/tv/%s",
"latest": "/tv/latest",
"search_tv": "/search/tv",
"popula... | 7,420 | Python | .py | 217 | 25.37788 | 134 | 0.542694 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,961 | episode.py | demigody_nas-tools/app/media/tmdbv3api/objs/episode.py | from app.media.tmdbv3api.as_obj import AsObj
from app.media.tmdbv3api.tmdb import TMDb
from app.utils import StringUtils
class Episode(TMDb):
_urls = {
"images": "/tv/%s/season/%s/episode/%s/images",
"details": "/tv/%s/season/%s/episode/%s"
}
def images(self, tv_id, season_num, episode_num... | 1,437 | Python | .py | 39 | 25.128205 | 123 | 0.527221 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,962 | genre.py | demigody_nas-tools/app/media/tmdbv3api/objs/genre.py | from app.media.tmdbv3api.tmdb import TMDb
class Genre(TMDb):
_urls = {
"movie_list": "/genre/movie/list",
"tv_list": "/genre/tv/list"
}
def movie_list(self):
"""
Get the list of official genres for movies.
:return:
"""
return self._get_obj(self._cal... | 560 | Python | .py | 18 | 23.666667 | 80 | 0.550186 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,963 | find.py | demigody_nas-tools/app/media/tmdbv3api/objs/find.py | from app.media.tmdbv3api.tmdb import TMDb
class Find(TMDb):
_urls = {
"find": "/find/%s"
}
def find_by_imdbid(self, imdbid):
return self._call(
self._urls["find"] % imdbid,
"external_source=imdb_id")
| 263 | Python | .py | 9 | 21.222222 | 44 | 0.549801 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,964 | apiv2.py | demigody_nas-tools/app/media/doubanapi/apiv2.py | # -*- coding: utf-8 -*-
import base64
import hashlib
import hmac
from datetime import datetime
from functools import lru_cache
from random import choice
from urllib import parse
import json
import re
import requests
from app.utils import RequestUtils, StringUtils
from app.utils.commons import singleton
from app.utils... | 18,758 | Python | .py | 357 | 39.434174 | 293 | 0.571429 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,965 | webapi.py | demigody_nas-tools/app/media/doubanapi/webapi.py | from functools import lru_cache
import requests
from lxml import etree
import datetime
from app.utils import RequestUtils, ExceptionUtils
from app.utils.commons import singleton
@singleton
class DoubanWeb(object):
_session = requests.Session()
_movie_base = "https://movie.douban.com"
_rss_base = "http... | 12,486 | Python | .py | 327 | 26.862385 | 116 | 0.496362 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,966 | metaanime.py | demigody_nas-tools/app/media/meta/metaanime.py | import re
import zhconv
import anitopy
from app.media.meta._base import MetaBase
from app.media.meta.release_groups import ReleaseGroupsMatcher
from app.media.meta.customization import CustomizationMatcher
from app.utils import StringUtils, ExceptionUtils
from app.utils.types import MediaType
class MetaAnime(MetaBa... | 11,233 | Python | .py | 234 | 28.094017 | 128 | 0.444183 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,967 | metavideo.py | demigody_nas-tools/app/media/meta/metavideo.py | import os
import re
from config import RMT_MEDIAEXT
from app.media.meta._base import MetaBase
from app.utils import StringUtils
from app.utils.tokens import Tokens
from app.utils.types import MediaType
from app.media.meta.release_groups import ReleaseGroupsMatcher
from app.media.meta.customization import Customization... | 25,595 | Python | .py | 562 | 28.462633 | 152 | 0.474027 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,968 | metavideov2.py | demigody_nas-tools/app/media/meta/metavideov2.py | import re
import os
from guessit.api import default_api
import cn2an
import log
from config import RMT_MEDIAEXT
from app.media.meta._base import MetaBase
from app.media.meta.release_groups import ReleaseGroupsMatcher
from app.media.meta.customization import CustomizationMatcher
from .mediaItem import MediaItem
from a... | 42,646 | Python | .py | 753 | 41.192563 | 164 | 0.577765 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,969 | metainfo.py | demigody_nas-tools/app/media/meta/metainfo.py | import os.path
import regex as re
import log
from app.helper import WordsHelper
from app.media.meta.metaanime import MetaAnime
from app.media.meta.metavideo import MetaVideo
from app.media.meta.metavideov2 import MetaVideoV2
from app.utils.types import MediaType
from app.utils import StringUtils
from config import Con... | 8,269 | Python | .py | 208 | 29.408654 | 122 | 0.630941 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,970 | __init__.py | demigody_nas-tools/app/media/meta/__init__.py | from .metainfo import MetaInfo
from .metaanime import MetaAnime
from ._base import MetaBase
from .metavideo import MetaVideo
from .metavideov2 import MetaVideoV2
from .release_groups import ReleaseGroupsMatcher
from .mediaItem import MediaMainItem, MediaEpisodeItem, MediaVideoItem,\
MediaAudioItem, MediaLocalizationIte... | 349 | Python | .py | 8 | 42.625 | 72 | 0.876833 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,971 | customization.py | demigody_nas-tools/app/media/meta/customization.py | import regex as re
from app.utils.commons import singleton
@singleton
class CustomizationMatcher(object):
"""
识别自定义占位符
"""
customization = None
custom_separator = None
def __init__(self):
self.customization = None
self.custom_separator = None
def match(self, title=None):
... | 1,454 | Python | .py | 39 | 25.692308 | 106 | 0.604328 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,972 | mediaItem.py | demigody_nas-tools/app/media/meta/mediaItem.py | import json
class MediaMainItem:
def __init__(self,
datas=None,
media_type=None,
title=None,
alternative_title=None,
container=None,
mimetype=None,
date=None,
year=None,
... | 11,156 | Python | .py | 236 | 35.54661 | 115 | 0.573055 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,973 | release_groups.py | demigody_nas-tools/app/media/meta/release_groups.py | import regex as re
from app.utils.commons import singleton
@singleton
class ReleaseGroupsMatcher(object):
"""
识别制作组、字幕组
"""
__release_groups = None
custom_release_groups = None
custom_separator = None
RELEASE_GROUPS = {
"0ff": ['FF(?:(?:A|WE)B|CD|E(?:DU|B)|TV)'],
"1pt": [],... | 4,186 | Python | .py | 106 | 29.207547 | 112 | 0.473162 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,974 | _base.py | demigody_nas-tools/app/media/meta/_base.py | import regex as re
import cn2an
from app.media.fanart import Fanart
from config import ANIME_GENREIDS, DEFAULT_TMDB_IMAGE, Config
from app.media.category import Category
from app.utils import StringUtils, ExceptionUtils
from app.utils.types import MediaType
class MetaBase(object):
"""
媒体信息基类
"""
proxi... | 30,222 | Python | .py | 788 | 24.940355 | 131 | 0.525742 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,975 | models.py | demigody_nas-tools/app/db/models.py | # coding: utf-8
from sqlalchemy import Column, Float, Index, Integer, Text, text, Sequence
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
BaseMedia = declarative_base()
class CONFIGFILTERGROUP(Base):
__tablename__ = 'CONFIG_FILTER_GROUP'
ID = Column(Integer, Sequence('ID')... | 16,025 | Python | .py | 479 | 28.446764 | 79 | 0.66455 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,976 | media_db.py | demigody_nas-tools/app/db/media_db.py | import json
import os
import threading
import time
from cachetools import cached, TTLCache
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.pool import QueuePool
from app.db.models import BaseMedia, MEDIASYNCITEMS, MEDIASYNCSTATISTIC
from app.utils import Ex... | 4,975 | Python | .py | 117 | 29.059829 | 110 | 0.56668 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,977 | main_db.py | demigody_nas-tools/app/db/main_db.py | import os
import threading
from sqlalchemy import create_engine, text
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.pool import QueuePool
from app.db.models import Base
from app.utils import ExceptionUtils, PathUtils
from config import Config
lock = threading.Lock()
_Engine = create_engine(
... | 3,546 | Python | .py | 113 | 20.00885 | 95 | 0.522188 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,978 | __init__.py | demigody_nas-tools/app/db/__init__.py | import os
import log
from config import Config
from .main_db import MainDb
from .main_db import DbPersist
from .media_db import MediaDb
from alembic.config import Config as AlembicConfig
from alembic.command import upgrade as alembic_upgrade
def init_db():
"""
初始化数据库
"""
log.console('开始初始化数据库...')
... | 1,248 | Python | .py | 38 | 24.631579 | 89 | 0.661985 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,979 | message.py | demigody_nas-tools/app/message/message.py | import json
import re
import time
from enum import Enum
import log
from app.conf import ModuleConf
from app.helper import DbHelper, SubmoduleHelper
from app.message.message_center import MessageCenter
from app.utils import StringUtils, ExceptionUtils
from app.utils.commons import singleton
from app.utils.types import ... | 34,060 | Python | .py | 787 | 27.006353 | 132 | 0.521518 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,980 | message_center.py | demigody_nas-tools/app/message/message_center.py | import datetime
import time
from collections import deque
from app.utils.commons import singleton
@singleton
class MessageCenter:
_message_queue = deque(maxlen=50)
_message_index = 0
def __init__(self):
pass
def insert_system_message(self, title, content=None):
"""
新增系统消息
... | 1,606 | Python | .py | 43 | 25.302326 | 118 | 0.527406 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,981 | slack.py | demigody_nas-tools/app/message/client/slack.py | import re
from threading import Lock
import requests
from slack_sdk.errors import SlackApiError
import log
from app.message.client._base import _IMessageClient
from app.utils import ExceptionUtils
from config import Config
from slack_bolt import App
from slack_bolt.adapter.socket_mode import SocketModeHandler
lock =... | 10,034 | Python | .py | 248 | 21.600806 | 104 | 0.409868 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,982 | pushplus.py | demigody_nas-tools/app/message/client/pushplus.py | import time
from urllib.parse import urlencode
from app.message.client._base import _IMessageClient
from app.utils import RequestUtils, ExceptionUtils
class PushPlus(_IMessageClient):
schema = "pushplus"
_token = None
_topic = None
_channel = None
_webhook = None
_client_config = {}
def... | 2,469 | Python | .py | 67 | 24.373134 | 75 | 0.530031 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,983 | gotify.py | demigody_nas-tools/app/message/client/gotify.py | from app.message.client._base import _IMessageClient
from app.utils import RequestUtils, StringUtils, ExceptionUtils
class Gotify(_IMessageClient):
schema = "gotify"
_server = None
_token = None
_priority = None
_client_config = {}
def __init__(self, config):
self._client_config = co... | 2,458 | Python | .py | 63 | 24.714286 | 94 | 0.521798 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,984 | synologychat.py | demigody_nas-tools/app/message/client/synologychat.py | import json
from urllib.parse import quote
from threading import Lock
from app.message.client._base import _IMessageClient
from app.utils import ExceptionUtils, RequestUtils, StringUtils
from config import Config
import log
lock = Lock()
class SynologyChat(_IMessageClient):
schema = "synologychat"
_client_... | 7,175 | Python | .py | 171 | 25.555556 | 97 | 0.471021 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,985 | bark.py | demigody_nas-tools/app/message/client/bark.py | from urllib.parse import quote_plus
from app.message.client._base import _IMessageClient
from app.utils import RequestUtils, StringUtils, ExceptionUtils
class Bark(_IMessageClient):
schema = "bark"
_server = None
_apikey = None
_params = None
_client_config = {}
def __init__(self, config):
... | 2,222 | Python | .py | 56 | 26.946429 | 102 | 0.550517 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,986 | serverchan.py | demigody_nas-tools/app/message/client/serverchan.py | from urllib.parse import urlencode
from app.message.client._base import _IMessageClient
from app.utils import RequestUtils, ExceptionUtils
class ServerChan(_IMessageClient):
schema = "serverchan"
_sckey = None
_client_config = {}
def __init__(self, config):
self._client_config = config
... | 1,891 | Python | .py | 49 | 26.102041 | 116 | 0.553685 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,987 | telegram.py | demigody_nas-tools/app/message/client/telegram.py | from threading import Event, Lock
from urllib.parse import urlencode
import requests
import log
from app.helper import ThreadHelper
from app.message.client._base import _IMessageClient
from app.utils import RequestUtils, ExceptionUtils, StringUtils
from config import Config
lock = Lock()
WEBHOOK_STATUS = False
cla... | 14,636 | Python | .py | 329 | 27.629179 | 107 | 0.488461 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,988 | chanify.py | demigody_nas-tools/app/message/client/chanify.py | from urllib import parse
from app.message.client._base import _IMessageClient
from app.utils import RequestUtils, StringUtils, ExceptionUtils
class Chanify(_IMessageClient):
schema = "chanify"
_server = None
_token = None
_params = None
_client_config = {}
def __init__(self, config):
... | 2,122 | Python | .py | 52 | 28.480769 | 86 | 0.573813 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,989 | pushdeer.py | demigody_nas-tools/app/message/client/pushdeer.py | from pypushdeer import PushDeer
from app.message.client._base import _IMessageClient
from app.utils import StringUtils, ExceptionUtils
class PushDeerClient(_IMessageClient):
schema = "pushdeer"
_server = None
_apikey = None
_client_config = {}
def __init__(self, config):
self._client_co... | 1,641 | Python | .py | 44 | 26 | 86 | 0.58871 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,990 | wechat.py | demigody_nas-tools/app/message/client/wechat.py | import json
import threading
from datetime import datetime
from app.message.client._base import _IMessageClient
from app.utils import RequestUtils, ExceptionUtils, StringUtils
lock = threading.Lock()
class WeChat(_IMessageClient):
schema = "wechat"
_instance = None
_access_token = None
_expires_in ... | 8,575 | Python | .py | 209 | 26.913876 | 118 | 0.524266 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,991 | iyuu.py | demigody_nas-tools/app/message/client/iyuu.py | from urllib.parse import urlencode
from app.message.client._base import _IMessageClient
from app.utils import RequestUtils, ExceptionUtils
class IyuuMsg(_IMessageClient):
schema = "iyuu"
_token = None
_client_config = {}
def __init__(self, config):
self._client_config = config
self.... | 1,876 | Python | .py | 49 | 25.632653 | 106 | 0.548235 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,992 | ntfy.py | demigody_nas-tools/app/message/client/ntfy.py | from app.message.client._base import _IMessageClient
from app.utils import RequestUtils, StringUtils, ExceptionUtils
class Ntfy(_IMessageClient):
schema = "ntfy"
_server = None
_token = None
_topic = None
_priority = None
_tags = None
_client_config = {}
def __init__(self, config):
... | 2,747 | Python | .py | 68 | 26.882353 | 119 | 0.535672 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,993 | _base.py | demigody_nas-tools/app/message/client/_base.py | from abc import ABCMeta, abstractmethod
class _IMessageClient(metaclass=ABCMeta):
@abstractmethod
def match(self, ctype):
"""
匹配实例
"""
pass
@abstractmethod
def send_msg(self, title, text, image, url, user_id):
"""
消息发送入口,支持文本、图片、链接跳转、指定发送对象
:pa... | 1,006 | Python | .py | 30 | 18.366667 | 72 | 0.563249 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,994 | cache_manager.py | demigody_nas-tools/app/utils/cache_manager.py | # -*- coding: utf-8 -*-
import time
from cacheout import CacheManager, LRUCache, Cache
CACHES = {
"tmdb_supply": {'maxsize': 200}
}
cacheman = CacheManager(CACHES, cache_class=LRUCache)
TokenCache = Cache(maxsize=256, ttl=4*3600, timer=time.time, default=None)
ConfigLoadCache = Cache(maxsize=1, ttl=10, timer=t... | 502 | Python | .py | 11 | 43.636364 | 80 | 0.762397 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,995 | episode_format.py | demigody_nas-tools/app/utils/episode_format.py | import re
import parse
from config import SPLIT_CHARS
class EpisodeFormat(object):
_key = ""
def __init__(self, eformat, details: str = None, part: str = None, offset=None, key="ep"):
self._format = eformat
self._start_ep = None
self._end_ep = None
self._part = None
if... | 3,225 | Python | .py | 80 | 29.4 | 116 | 0.529431 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,996 | commons.py | demigody_nas-tools/app/utils/commons.py | # -*- coding: utf-8 -*-
import threading
import time
from collections import OrderedDict
import functools
import collections
# 线程锁
lock = threading.RLock()
# 全局实例
INSTANCES = OrderedDict()
# 单例模式注解
def singleton(cls):
# 创建字典用来保存类的实例对象
global INSTANCES
def _singleton(*args, **kwargs):
# 先判断这个类有没... | 3,313 | Python | .py | 93 | 22.247312 | 76 | 0.534813 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,997 | rsstitle_utils.py | demigody_nas-tools/app/utils/rsstitle_utils.py | import re
from app.utils.exception_utils import ExceptionUtils
class RssTitleUtils:
@staticmethod
def keepfriends_title(title):
"""
处理pt.keepfrds.com的RSS标题
"""
if not title:
return ""
try:
title_search = re.search(r"\[(.*)]", title, re.IGNORECA... | 1,091 | Python | .py | 26 | 28.269231 | 85 | 0.510942 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,998 | http_utils.py | demigody_nas-tools/app/utils/http_utils.py | import requests
import urllib3
from urllib3.exceptions import InsecureRequestWarning
from config import Config
urllib3.disable_warnings(InsecureRequestWarning)
class RequestUtils:
_headers = None
_cookies = None
_apikey = None
_authorization = None
_proxies = None
_timeout = 20
_session =... | 7,548 | Python | .py | 178 | 21.533708 | 116 | 0.420192 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,999 | json_utils.py | demigody_nas-tools/app/utils/json_utils.py | import json
from enum import Enum
class JsonUtils:
@staticmethod
def json_serializable(obj):
"""
将普通对象转化为支持json序列化的对象
@param obj: 待转化的对象
@return: 支持json序列化的对象
"""
def _try(o):
if isinstance(o, Enum):
return o.value
try:
... | 584 | Python | .py | 19 | 17.684211 | 69 | 0.528 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |