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,800 | pix_finder_ui.py | AmirMahdaviAM_SCSHub/scshub/view/ui/pix_finder_ui.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'c:\Users\Amir\Desktop\SCSHub\scshub\view\ui\pix_finder_ui.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know wh... | 9,110 | Python | .py | 158 | 49.170886 | 180 | 0.71526 | AmirMahdaviAM/SCSHub | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,801 | pix_hasher_str_ui.py | AmirMahdaviAM_SCSHub/scshub/view/ui/pix_hasher_str_ui.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'c:\Users\Amir\Desktop\SCSHub\scshub\view\ui\pix_hasher_str_ui.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you kno... | 3,942 | Python | .py | 71 | 47.661972 | 119 | 0.726967 | AmirMahdaviAM/SCSHub | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,802 | tobj_editor_ui.py | AmirMahdaviAM_SCSHub/scshub/view/ui/tobj_editor_ui.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'c:\Users\Amir\Desktop\SCSHub\scshub\view\ui\tobj_editor_ui.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know w... | 27,368 | Python | .py | 426 | 55.546948 | 199 | 0.728643 | AmirMahdaviAM/SCSHub | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,803 | pix_converter_widget.py | AmirMahdaviAM_SCSHub/scshub/view/widget/pix_converter_widget.py | import os
import logging
from random import randint
from PyQt5.QtCore import Qt, QProcess, QSize, QEasingCurve, QPropertyAnimation
from PyQt5.QtWidgets import QWidget, QFileDialog, QListWidgetItem
from qfluentwidgets import (
IndeterminateProgressRing,
InfoBarPosition,
FluentIconBase,
ToolTipFilter,
... | 27,924 | Python | .py | 607 | 32.056013 | 100 | 0.558982 | AmirMahdaviAM/SCSHub | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,804 | sxc_packer_widget.py | AmirMahdaviAM_SCSHub/scshub/view/widget/sxc_packer_widget.py | import os
import logging
from sys import platform
from PyQt5.QtCore import Qt, QProcess
from PyQt5.QtWidgets import QWidget, QFileDialog
from qfluentwidgets import (
IndeterminateProgressRing,
InfoBarPosition,
ToolTipFilter,
InfoBarIcon,
FluentIcon,
InfoBar,
)
from ..ui.sxc_packer_ui import S... | 11,303 | Python | .py | 243 | 34.144033 | 100 | 0.590333 | AmirMahdaviAM/SCSHub | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,805 | scs_packer_widget.py | AmirMahdaviAM_SCSHub/scshub/view/widget/scs_packer_widget.py | import os
import logging
from sys import platform
from PyQt5.QtCore import Qt, QProcess
from PyQt5.QtWidgets import QWidget, QFileDialog
from qfluentwidgets import (
IndeterminateProgressRing,
InfoBarPosition,
ToolTipFilter,
InfoBarIcon,
FluentIcon,
InfoBar,
)
from ..ui.scs_packer_ui import S... | 6,867 | Python | .py | 159 | 31.742138 | 100 | 0.596058 | AmirMahdaviAM/SCSHub | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,806 | sxc_finder_widget.py | AmirMahdaviAM_SCSHub/scshub/view/widget/sxc_finder_widget.py | import os
import re
import logging
from sys import platform
from pathlib import Path
from PyQt5.QtCore import Qt, QProcess
from PyQt5.QtWidgets import QWidget, QFileDialog
from qfluentwidgets import (
IndeterminateProgressRing,
InfoBarPosition,
ToolTipFilter,
InfoBarIcon,
FluentIcon,
InfoBar,
... | 20,270 | Python | .py | 466 | 29.706009 | 112 | 0.538692 | AmirMahdaviAM/SCSHub | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,807 | pix_hasher_widget.py | AmirMahdaviAM_SCSHub/scshub/view/widget/pix_hasher_widget.py | import re
import logging
from PyQt5.QtCore import Qt, QProcess, QRegExp
from PyQt5.QtGui import QRegExpValidator
from PyQt5.QtWidgets import QWidget, QFileDialog, QVBoxLayout
from qfluentwidgets import ToolTipFilter, FluentIcon
from ..ui.pix_hasher_fil_ui import PixFileHasherUi
from ..ui.pix_hasher_str_ui import Pix... | 5,015 | Python | .py | 107 | 37.448598 | 97 | 0.646756 | AmirMahdaviAM/SCSHub | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,808 | def_creator_widget.py | AmirMahdaviAM_SCSHub/scshub/view/widget/def_creator_widget.py | import os
import logging
from PyQt5.QtCore import Qt, QRegExp
from PyQt5.QtGui import QRegExpValidator
from PyQt5.QtWidgets import QWidget, QFileDialog
from qfluentwidgets import ToolTipFilter, FluentIcon, Flyout, InfoBarIcon, InfoLevel, setFont
from ..ui.def_creator_ui import DefCreatorUi
from ...common.tool import... | 10,864 | Python | .py | 218 | 34.665138 | 122 | 0.534285 | AmirMahdaviAM/SCSHub | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,809 | pix_finder_widget.py | AmirMahdaviAM_SCSHub/scshub/view/widget/pix_finder_widget.py | import os
import logging
from random import randint
from PyQt5.QtCore import Qt, QProcess
from PyQt5.QtWidgets import QWidget, QFileDialog, QListWidgetItem, QAbstractItemView
from qfluentwidgets import (
FluentIconBase,
ToolTipFilter,
FluentIcon,
InfoLevel,
)
from ..ui.pix_finder_ui import PixFinderU... | 11,379 | Python | .py | 261 | 32.344828 | 100 | 0.59622 | AmirMahdaviAM/SCSHub | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,810 | scs_extractor_wdiget.py | AmirMahdaviAM_SCSHub/scshub/view/widget/scs_extractor_wdiget.py | import os
import logging
from sys import platform
from PyQt5.QtCore import Qt, QProcess
from PyQt5.QtWidgets import QWidget, QFileDialog
from qfluentwidgets import (
IndeterminateProgressRing,
InfoBarPosition,
ToolTipFilter,
InfoBarIcon,
FluentIcon,
InfoBar,
)
from ..ui.scs_extractor_ui impor... | 9,185 | Python | .py | 220 | 30.718182 | 100 | 0.600945 | AmirMahdaviAM/SCSHub | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,811 | tobj_editor_widget.py | AmirMahdaviAM_SCSHub/scshub/view/widget/tobj_editor_widget.py | import os
import logging
import binascii
from io import BytesIO
from PIL import Image, ImageDraw, ImageFont
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QImage
from PyQt5.QtWidgets import QWidget, QFileDialog
from qfluentwidgets import ToolTipFilter, FluentIcon, Flyout, InfoBarIcon
from ..ui.tobj_editor_ui i... | 21,247 | Python | .py | 433 | 36.852194 | 168 | 0.583644 | AmirMahdaviAM/SCSHub | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,812 | bot.py | TechGreyMatters_TG-URL-Shortener-Bot/bot.py | import asyncio
import datetime
import logging
import logging.config
import sys
from pyrogram import *
from pyrogram.errors.exceptions.not_acceptable_406 import *
from config import *
from database import *
from database.users import *
from aiohttps import *
from helpers import *
from pyshortner import *
logging.config.... | 2,991 | Python | .py | 79 | 29.949367 | 97 | 0.479087 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,813 | config.py | TechGreyMatters_TG-URL-Shortener-Bot/config.py | import os
from dotenv import load_dotenv
load_dotenv()
# Mandatory variables for the bot to start
API_ID = int(os.environ.get("API_ID", "")) #API ID from https://my.telegram.org/auth
API_HASH = os.environ.get("API_HASH", "") #API Hash from https://my.telegram.org/auth
BOT_TOKEN = os.environ.get("BOT_TOKEN", "") # Bo... | 2,177 | Python | .py | 33 | 58.727273 | 162 | 0.475946 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,814 | helpers.py | TechGreyMatters_TG-URL-Shortener-Bot/helpers.py | # temp db for banned
import asyncio
import logging
import traceback
import aiohttp
import database
from config import ADMINS
class temp(object): # TrojanZ Idea of Temping
BOT_USERNAME = None
CANCEL = False
FIRST_NAME = None
START_TIME = None
BANNED_USERS = []
class AsyncIter:
def __ini... | 1,896 | Python | .py | 50 | 28.62 | 95 | 0.372004 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,815 | translation.py | TechGreyMatters_TG-URL-Shortener-Bot/translation.py | from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
START_MESSAGE = '''**Hello, {}
I Am Greylinks Official Link Converter. I Can Convert Links Directly From Your GreyMatterslinks.in Account,
1. Go To üëâ https://GreyMatterslinks.in/member/tools/api
2. Than Copy API Key
3. Than Type /set_ap... | 5,393 | Python | .py | 132 | 36.393939 | 121 | 0.624514 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,816 | users.py | TechGreyMatters_TG-URL-Shortener-Bot/database/users.py | from motor.motor_asyncio import *
from config import *
from domainers import *
client = AsyncIOMotorClient(DATABASE_URL)
db = client[DATABASE_NAME]
col = db["users"]
async def get_user(user_id):
user_id = int(user_id)
user = await col.find_one({"user_id": user_id})
if not user:
res = {
... | 2,494 | Python | .py | 62 | 31.225806 | 95 | 0.413708 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,817 | __init__.py | TechGreyMatters_TG-URL-Shortener-Bot/database/__init__.py | from .database import db
from .users import get_all_users, delete_user, get_user, update_user_info, total_users_count
"""
_____ __ __ _ _ _ _______ _
/ ____| | \/ | | | | | ( ) |__ __| | |
| | ... | 1,000 | Python | .py | 15 | 52.2 | 95 | 0.180711 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,818 | database.py | TechGreyMatters_TG-URL-Shortener-Bot/database/database.py | from config import *
from motor.motor_asyncio import *
import helpers
class Database:
def __init__(self, uri, database_name):
self._client = AsyncIOMotorClient(uri)
self.db = self._client[database_name]
self.method = self.db['methods']
self.stats = self.db['stats']
self.use... | 2,232 | Python | .py | 44 | 40.204545 | 102 | 0.412874 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,819 | broadcast.py | TechGreyMatters_TG-URL-Shortener-Bot/plugins/broadcast.py | import asyncio
import datetime
import logging
import random
import string
import time
import traceback
import aiofiles
import aiofiles.os
from config import *
from database import *
from pyrogram import *
from pyrogram.errors import *
from pyrogram.types import *
broadcast_ids = {}
@Client.on_message(filters.comman... | 4,259 | Python | .py | 95 | 36.315789 | 209 | 0.539258 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,820 | callback.py | TechGreyMatters_TG-URL-Shortener-Bot/plugins/callback.py | import asyncio
import contextlib
import logging
import os
import re
import sys
from config import *
from database import *
from database.users import *
from helpers import *
from pyrogram import *
from pyrogram.errors import *
from pyrogram.types import *
from translation import *
from bot import *
logger = logging.g... | 5,888 | Python | .py | 116 | 41.568966 | 171 | 0.569889 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,821 | contact.py | TechGreyMatters_TG-URL-Shortener-Bot/plugins/contact.py | import asyncio, traceback
from config import OWNER_ID
from pyrogram import filters, Client as app
from pyrogram.errors.exceptions.bad_request_400 import UserIsBlocked
@app.on_message(filters.command("contact"))
async def contactAdmin(bot, message):
try:
user = "@" + message.from_user.username if message.fr... | 3,186 | Python | .py | 62 | 39.33871 | 157 | 0.46861 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,822 | private.py | TechGreyMatters_TG-URL-Shortener-Bot/plugins/private.py | import logging
from config import *
import asyncio
from database.users import *
from pyrogram import *
from pyrogram.types import *
from bot import *
from pyrogram.errors.exceptions.bad_request_400 import *
import shortener
from shortener import *
from pyshortner import *
logger = logging.getLogger(__name__)
channel =... | 3,177 | Python | .py | 72 | 34.125 | 97 | 0.48476 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,823 | commands.py | TechGreyMatters_TG-URL-Shortener-Bot/plugins/commands.py | import contextlib
import datetime
import logging
from validators import *
from config import *
from database import *
from database.users import *
from helpers import *
from pyrogram import *
from pyrogram.types import *
from translation import *
from bot import *
logger = logging.getLogger(__name__)
user_commands =... | 10,427 | Python | .py | 203 | 41.931034 | 176 | 0.584961 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,824 | contact.py | TechGreyMatters_TG-URL-Shortener-Bot/plugins/contact.py | import asyncio, traceback
from config import OWNER_ID
from pyrogram import filters, Client as app
from pyrogram.errors.exceptions.bad_request_400 import UserIsBlocked
@app.on_message(filters.command("contact"))
async def contactAdmin(bot, message):
try:
user = "@" + message.from_user.username if message.fr... | 3,186 | Python | .tac | 62 | 39.33871 | 157 | 0.46861 | TechGreyMatters/TG-URL-Shortener-Bot | 8 | 19 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,825 | FreeC.py | StarrySky-skyler_FreeC/FreeC.py | import os
import shutil
import threading
# 获取系统变量
systemDrive = os.environ.get('systemdrive')
winDir = os.environ.get('windir')
userProfile = os.environ.get('userprofile')
systemDrive += '\\'
# 删除文件字典
filesDict = {
systemDrive:['.tmp', '._mp', '.log', '.gid',
'.chk', '.old'],
winDir:['.bak']... | 2,696 | Python | .py | 82 | 22.585366 | 71 | 0.588781 | StarrySky-skyler/FreeC | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,826 | roon_integration.py | RamXX_FridayMusic/roon_integration.py | from roonapi import RoonApi, RoonDiscovery
from pydantic import StrictBool, StrictStr
from typing import List
from configparser import ConfigParser
from time import time, sleep
def play_music(config: ConfigParser, bands: List[StrictStr]) -> StrictBool:
"""Plays a random selection of the bands in the list for a pre... | 1,846 | Python | .py | 43 | 35.697674 | 130 | 0.64442 | RamXX/FridayMusic | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,827 | config.py | RamXX_FridayMusic/config.py | from enum import Enum
class Mood(Enum):
HAPPY = 1
EXCITED = 2
CONTENT = 3
RELAXED = 4
BORED = 5
TIRED = 6
STRESSED = 7
ANXIOUS = 8
FRUSTRATED = 9
ANGRY = 10
SAD = 11
DEPRESSED = 12
HOPEFUL = 13
MOTIVATED = 14
INSPIRED = 15
CONFUSED = 16
SURPRISED = 17... | 2,442 | Python | .py | 59 | 36.542373 | 95 | 0.619908 | RamXX/FridayMusic | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,828 | obsidian.py | RamXX_FridayMusic/obsidian.py | import os
import re
import dspy
from pydantic import BaseModel, StrictStr, StrictInt
from typing import Tuple, List
from collections import defaultdict
from datetime import datetime, timedelta
from config import Mood, day_weights
#
# Pydantic classes first
#
class DailyNote(BaseModel):
date: StrictStr
dow: S... | 3,642 | Python | .py | 77 | 38.597403 | 190 | 0.636952 | RamXX/FridayMusic | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,829 | fridaymusic.py | RamXX_FridayMusic/fridaymusic.py | import dspy
import traceback
from rich.console import Console
from rich import print
from rich.traceback import install as install_traceback
from dotenv import load_dotenv
from configparser import ConfigParser
from config import mood_music
from roon_integration import play_music
from drinks import recommend_drink
fro... | 1,922 | Python | .py | 37 | 46.675676 | 123 | 0.704971 | RamXX/FridayMusic | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,830 | drinks.py | RamXX_FridayMusic/drinks.py | import dspy
from configparser import ConfigParser
from typing import Tuple, Optional, List
from pydantic import BaseModel, StrictStr
from config import Mood
#
# Pydantic classes first
#
class Liquor(BaseModel):
name: StrictStr
category: StrictStr # e.g., "whiskey", "vodka", "gin", "rum", etc.
brand: Opti... | 3,382 | Python | .py | 70 | 42.557143 | 160 | 0.702089 | RamXX/FridayMusic | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,831 | bot.py | LISA-KOREA_4GB-URL-UPLOADER-BOT/bot.py | import os
import logging
from logging.handlers import RotatingFileHandler
from pyrogram import Client
from pyrogram import idle
from plugins.config import *
# Prepare bot client
bot = Client(
"botclient",
bot_token=BOT_TOKEN,
api_id=API_ID,
api_hash=API_HASH,
sleep_threshold=30
)
# Prepare use... | 1,048 | Python | .py | 42 | 19.690476 | 52 | 0.674872 | LISA-KOREA/4GB-URL-UPLOADER-BOT | 8 | 11 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,832 | config.py | LISA-KOREA_4GB-URL-UPLOADER-BOT/plugins/config.py | import os, time, datetime, pytz
class Config(object):
BOT_TOKEN = os.environ.get("BOT_TOKEN", "")
API_ID = int(os.environ.get("API_ID", ""))
API_HASH = os.environ.get("API_HASH", "")
DOWNLOAD_LOCATION = "./DOWNLOADS"
SESSION_STRING = os.environ.get("SESSION_STRING", "")
... | 731 | Python | .py | 13 | 47.692308 | 88 | 0.649096 | LISA-KOREA/4GB-URL-UPLOADER-BOT | 8 | 11 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,833 | script.py | LISA-KOREA_4GB-URL-UPLOADER-BOT/plugins/script.py | from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
class Translation(object):
START_TEXT = """ Hello bro donete me tg premium to start
Contact me @LISA_FAN_LK
"""
HELP_TEXT = """ donete tg premium 👌�
"""
| 242 | Python | .py | 7 | 31.714286 | 69 | 0.754386 | LISA-KOREA/4GB-URL-UPLOADER-BOT | 8 | 11 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,834 | config.py | demigody_nas-tools/config.py | import os
import shutil
import sys
from threading import Lock
import ruamel.yaml
import re
# 种子名/文件名要素分隔字符
SPLIT_CHARS = r"\.|\s+|\(|\)|\[|]|-|\+|【|】|/|~|;|&|\||#|_|「|」|~"
# 默认User-Agent
DEFAULT_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36"
#... | 9,050 | Python | .py | 209 | 31.330144 | 130 | 0.598504 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,835 | run.py | demigody_nas-tools/run.py | import os
import signal
import sys
import warnings
warnings.filterwarnings('ignore')
# 运行环境判断
is_executable = getattr(sys, 'frozen', False)
is_windows_exe = is_executable and (os.name == "nt")
if is_windows_exe:
# 托盘相关库
import threading
from package.trayicon import TrayIcon, NullWriter
if is_executable:
... | 3,849 | Python | .py | 114 | 25.587719 | 114 | 0.628224 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,836 | dbscript_gen.py | demigody_nas-tools/dbscript_gen.py | import os
from config import Config
from alembic.config import Config as AlembicConfig
from alembic.command import revision as alembic_revision
db_version = input("请输入版本号:")
db_location = os.path.join(Config().get_config_path(), 'user.db').replace('\\', '/')
script_location = os.path.join(os.path.dirname(__file__), 's... | 578 | Python | .py | 11 | 50.181818 | 87 | 0.751812 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,837 | log.py | demigody_nas-tools/log.py | import logging
import os
import re
import threading
import time
from collections import deque
from html import escape
from logging.handlers import RotatingFileHandler
from config import Config
logging.getLogger('werkzeug').setLevel(logging.ERROR)
lock = threading.Lock()
LOG_QUEUE = deque(maxlen=200)
LOG_INDEX = 0
... | 3,948 | Python | .py | 94 | 30.882979 | 108 | 0.577713 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,838 | initializer.py | demigody_nas-tools/initializer.py | import json
import os
import time
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
from werkzeug.security import generate_password_hash
import log
from app.conf import SystemConfig
from app.helper import DbHelper, PluginHelper, ProgressHelper
from app.plugins import PluginMan... | 17,201 | Python | .py | 395 | 28.564557 | 112 | 0.54211 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,839 | setup.py | demigody_nas-tools/third_party/feapder/setup.py | # -*- coding: utf-8 -*-
"""
Created on 2020/4/22 10:45 PM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
from os.path import dirname, join
from sys import version_info
import setuptools
if version_info < (3, 6, 0):
raise SystemExit("Sorry! feapder requires python 3.6.0 or later.")... | 2,085 | Python | .py | 72 | 24.208333 | 85 | 0.645095 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,840 | setting.py | demigody_nas-tools/third_party/feapder/feapder/setting.py | # -*- coding: utf-8 -*-
"""爬虫配置文件"""
import os
# redis 表名
# 任务表模版
TAB_REQUESTS = "{redis_key}:z_requests"
# 任务失败模板
TAB_FAILED_REQUESTS = "{redis_key}:z_failed_requests"
# 数据保存失败模板
TAB_FAILED_ITEMS = "{redis_key}:s_failed_items"
# 爬虫状态表模版
TAB_SPIDER_STATUS = "{redis_key}:h_spider_status"
# 用户池
TAB_USER_POOL = "{redis_k... | 10,870 | Python | .py | 209 | 36.889952 | 143 | 0.733848 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,841 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/__init__.py | # -*- coding: utf-8 -*-
"""
Created on 2020/4/21 10:41 PM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import os
import re
import sys
sys.path.insert(0, re.sub(r"([\\/]items$)|([\\/]spiders$)", "", os.getcwd()))
__all__ = [
"AirSpider",
"Spider",
"TaskSpider",
"BatchS... | 815 | Python | .py | 33 | 22.151515 | 77 | 0.702182 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,842 | item_buffer.py | demigody_nas-tools/third_party/feapder/feapder/buffer/item_buffer.py | # -*- coding: utf-8 -*-
"""
Created on 2018-06-19 17:17
---------
@summary: item 管理器, 负责缓冲添加到数据库中的item, 由该manager统一添加。防止多线程同时访问数据库
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import threading
from queue import Queue
import feapder.utils.tools as tools
from feapder import setting
from feapder.db.redisdb... | 14,141 | Python | .py | 338 | 26.245562 | 102 | 0.515357 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,843 | request_buffer.py | demigody_nas-tools/third_party/feapder/feapder/buffer/request_buffer.py | # -*- coding: utf-8 -*-
"""
Created on 2018-06-19 17:17
---------
@summary: request 管理器, 负责缓冲添加到数据库中的request
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import collections
import threading
import feapder.setting as setting
import feapder.utils.tools as tools
from feapder.db.memorydb import MemoryDB
fro... | 5,356 | Python | .py | 136 | 26.985294 | 83 | 0.580171 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,844 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/buffer/__init__.py | # -*- coding: utf-8 -*-
'''
Created on 2020/4/23 12:09 AM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
''' | 136 | Python | .py | 9 | 14.222222 | 29 | 0.570313 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,845 | redisdb.py | demigody_nas-tools/third_party/feapder/feapder/db/redisdb.py | # -*- coding: utf-8 -*-
"""
Created on 2016-11-16 16:25
---------
@summary: 操作redis数据库
---------
@author: Boris
"""
import os
import time
import redis
from redis.connection import Encoder as _Encoder
from redis.exceptions import ConnectionError, TimeoutError
from redis.exceptions import DataError
from redis.sentinel i... | 29,545 | Python | .py | 776 | 23.069588 | 114 | 0.503166 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,846 | memorydb.py | demigody_nas-tools/third_party/feapder/feapder/db/memorydb.py | # -*- coding: utf-8 -*-
"""
Created on 2020/4/21 11:42 PM
---------
@summary: 基于内存的队列,代替redis
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
from queue import PriorityQueue
from feapder import setting
class MemoryDB:
def __init__(self):
self.priority_queue = PriorityQueue(maxsize=setting.TASK... | 1,117 | Python | .py | 38 | 19.763158 | 81 | 0.588418 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,847 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/db/__init__.py | # -*- coding: utf-8 -*-
"""
Created on 2020/4/23 12:09 AM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
""" | 136 | Python | .py | 9 | 14.222222 | 29 | 0.570313 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,848 | mongodb.py | demigody_nas-tools/third_party/feapder/feapder/db/mongodb.py | # -*- coding: utf-8 -*-
"""
Created on 2021-04-18 14:12:21
---------
@summary: 操作mongo数据库
---------
@author: Mkdir700
@email: mkdir700@gmail.com
"""
import re
from typing import List, Dict, Optional
from urllib import parse
import pymongo
from pymongo import MongoClient
from pymongo.collection import Collection
from ... | 13,606 | Python | .py | 365 | 22.287671 | 158 | 0.497794 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,849 | mysqldb.py | demigody_nas-tools/third_party/feapder/feapder/db/mysqldb.py | # -*- coding: utf-8 -*-
"""
Created on 2016-11-16 16:25
---------
@summary: 操作mysql数据库
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import datetime
import json
from urllib import parse
from typing import List, Dict
import pymysql
from dbutils.pooled_db import PooledDB
from pymysql import cursors
from pym... | 10,799 | Python | .py | 339 | 18.743363 | 99 | 0.474504 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,850 | bitarray.py | demigody_nas-tools/third_party/feapder/feapder/dedup/bitarray.py | # -*- coding: utf-8 -*-
"""
Created on 2018/12/14 1:05 PM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
from __future__ import absolute_import
from feapder.db.redisdb import RedisDB
class BitArray:
def setall(self, value):
pass
def __repr__(self):
raise Imp... | 4,133 | Python | .py | 111 | 24.900901 | 147 | 0.589326 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,851 | basefilter.py | demigody_nas-tools/third_party/feapder/feapder/dedup/basefilter.py | # -*- coding: utf-8 -*-
"""
Created on 2022/9/21 11:17 AM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import abc
from typing import List, Union
class BaseFilter:
@abc.abstractmethod
def add(
self, keys: Union[List[str], str], *args, **kwargs
) -> Union[List[bool]... | 901 | Python | .py | 35 | 15.942857 | 74 | 0.513405 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,852 | bloomfilter.py | demigody_nas-tools/third_party/feapder/feapder/dedup/bloomfilter.py | # -*- coding: utf-8 -*-
"""
Created on 2018/12/13 4:11 PM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import hashlib
import math
import threading
import time
from struct import unpack, pack
from feapder.dedup.basefilter import BaseFilter
from feapder.utils.redis_lock import RedisLoc... | 12,518 | Python | .py | 310 | 27.170968 | 87 | 0.548258 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,853 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/dedup/__init__.py | # -*- coding: utf-8 -*-
"""
Created on 2018-12-13 21:08
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import copy
from typing import Any, List, Union, Optional, Tuple, Callable
from feapder.utils.tools import get_md5
from .bloomfilter import BloomFilter, ScalableBloomFilter
from .expi... | 6,616 | Python | .py | 155 | 26.677419 | 163 | 0.560069 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,854 | expirefilter.py | demigody_nas-tools/third_party/feapder/feapder/dedup/expirefilter.py | # -*- coding: utf-8 -*-
"""
Created on 2018/12/13 9:44 PM
---------
@summary: 带有有效期的去重集合
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import time
from feapder.db.redisdb import RedisDB
from feapder.dedup.basefilter import BaseFilter
class ExpireFilter(BaseFilter):
redis_db = None
def __init__... | 2,309 | Python | .py | 64 | 26.40625 | 86 | 0.593663 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,855 | litefilter.py | demigody_nas-tools/third_party/feapder/feapder/dedup/litefilter.py | # -*- coding: utf-8 -*-
"""
Created on 2022/9/21 11:28 AM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
from typing import List, Union, Set
from feapder.dedup.basefilter import BaseFilter
class LiteFilter(BaseFilter):
def __init__(self):
self.datas: Set[str] = set()
... | 1,854 | Python | .py | 61 | 17.508197 | 72 | 0.462195 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,856 | custom_argparse.py | demigody_nas-tools/third_party/feapder/feapder/utils/custom_argparse.py | # -*- coding: utf-8 -*-
"""
Created on 2018-10-15 14:32:12
---------
@summary: 封装ArgumentParser, 使其支持function, 调用start自动执行
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import argparse
class ArgumentParser(argparse.ArgumentParser):
def __init__(self, *args, **kwargs):
self.functions = {}
... | 1,959 | Python | .py | 47 | 30.765957 | 83 | 0.577558 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,857 | perfect_dict.py | demigody_nas-tools/third_party/feapder/feapder/utils/perfect_dict.py | # -*- coding: utf-8 -*-
"""
Created on 2021/4/8 11:32 上午
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
def ensure_value(value):
if isinstance(value, (list, tuple)):
_value = []
for v in value:
_value.append(ensure_value(v))
if isinstance(value,... | 2,123 | Python | .py | 81 | 19.716049 | 79 | 0.488889 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,858 | email_sender.py | demigody_nas-tools/third_party/feapder/feapder/utils/email_sender.py | # -*- coding: utf-8 -*-
"""
Created on 2020/2/19 12:57 PM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import os
import smtplib
from email.header import Header
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import formataddr
from ... | 2,537 | Python | .py | 78 | 22.589744 | 77 | 0.582825 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,859 | metrics.py | demigody_nas-tools/third_party/feapder/feapder/utils/metrics.py | import concurrent.futures
import json
import os
import queue
import random
import socket
import string
import threading
import time
from collections import Counter
from typing import Any
from influxdb import InfluxDBClient
from feapder import setting
from feapder.utils.log import log
from feapder.utils.tools import a... | 16,820 | Python | .py | 487 | 22.648871 | 103 | 0.586921 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,860 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/utils/__init__.py | # -*- coding: utf-8 -*-
'''
Created on 2019/11/5 4:41 PM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
''' | 135 | Python | .py | 9 | 14.111111 | 29 | 0.566929 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,861 | redis_lock.py | demigody_nas-tools/third_party/feapder/feapder/utils/redis_lock.py | # -*- coding: utf-8 -*-
"""
Created on 2019/11/5 5:25 PM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import threading
import time
from feapder.db.redisdb import RedisDB
from feapder.utils.log import log
class RedisLock:
redis_cli = None
def __init__(
self, key, *, ... | 3,670 | Python | .py | 105 | 22.219048 | 88 | 0.536781 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,862 | log.py | demigody_nas-tools/third_party/feapder/feapder/utils/log.py | # -*- coding: utf-8 -*-
"""
Created on 2018-12-08 16:50
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import logging
import os
import sys
from logging.handlers import BaseRotatingHandler
import loguru
from better_exceptions import format_exception
import feapder.setting as setting
... | 8,483 | Python | .py | 234 | 27.452991 | 102 | 0.628582 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,863 | tools.py | demigody_nas-tools/third_party/feapder/feapder/utils/tools.py | # -*- coding: utf-8 -*-
"""
Created on 2018-09-06 14:21
---------
@summary: 工具
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import asyncio
import base64
import calendar
import codecs
import configparser # 读配置文件的
import datetime
import functools
import hashlib
import html
import importlib
import json
impo... | 73,707 | Python | .py | 2,222 | 23.959046 | 143 | 0.563226 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,864 | webdriver_pool.py | demigody_nas-tools/third_party/feapder/feapder/utils/webdriver/webdriver_pool.py | # -*- coding: utf-8 -*-
"""
Created on 2021/3/18 4:59 下午
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import queue
import threading
from feapder.utils.log import log
from feapder.utils.tools import Singleton
from feapder.utils.webdriver.selenium_driver import SeleniumDriver
@Single... | 3,282 | Python | .py | 97 | 23.103093 | 145 | 0.572423 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,865 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/utils/webdriver/__init__.py | # -*- coding: utf-8 -*-
"""
Created on 2022/9/7 4:39 PM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
from .selenium_driver import SeleniumDriver
from .webdirver import InterceptRequest, InterceptResponse
from .webdriver_pool import WebDriverPool
# 为了兼容老代码
WebDriver = SeleniumDriver
| 332 | Python | .py | 14 | 21.642857 | 58 | 0.749175 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,866 | selenium_driver.py | demigody_nas-tools/third_party/feapder/feapder/utils/webdriver/selenium_driver.py | # -*- coding: utf-8 -*-
"""
Created on 2021/3/18 4:59 下午
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import json
import logging
import os
from typing import Optional, Union, List
import requests
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities impor... | 10,939 | Python | .py | 280 | 27.560714 | 99 | 0.575573 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,867 | webdirver.py | demigody_nas-tools/third_party/feapder/feapder/utils/webdriver/webdirver.py | # -*- coding: utf-8 -*-
"""
Created on 2022/9/7 4:27 PM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import abc
from feapder import setting
class InterceptRequest:
def __init__(self, url, data, headers):
self.url = url
self.data = data
self.headers = head... | 2,407 | Python | .py | 70 | 23.1 | 87 | 0.604117 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,868 | item.py | demigody_nas-tools/third_party/feapder/feapder/network/item.py | # -*- coding: utf-8 -*-
"""
Created on 2018-07-26 22:28:10
---------
@summary: 定义实体
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import re
import feapder.utils.tools as tools
class ItemMetaclass(type):
def __new__(cls, name, bases, attrs):
attrs.setdefault("__name__", None)
attrs.... | 4,341 | Python | .py | 127 | 25.149606 | 87 | 0.540224 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,869 | proxy_pool_old.py | demigody_nas-tools/third_party/feapder/feapder/network/proxy_pool_old.py | # coding:utf8
"""
代理池
"""
import datetime
import json
import os
import random
import socket
import time
from urllib import parse
import redis
import requests
from feapder import setting
from feapder.utils import tools
from feapder.utils.log import log
# 建立本地缓存代理文件夹
proxy_path = os.path.join(os.path.dirname(__file__)... | 23,025 | Python | .py | 641 | 22.436817 | 87 | 0.516261 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,870 | response.py | demigody_nas-tools/third_party/feapder/feapder/network/response.py | # -*- coding: utf-8 -*-
"""
Created on 2018-07-26 11:40:28
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import datetime
import os
import re
import tempfile
import webbrowser
from urllib.parse import urlparse, urlunparse, urljoin
from bs4 import UnicodeDammit, BeautifulSoup
from requ... | 12,743 | Python | .py | 319 | 28.087774 | 209 | 0.577328 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,871 | request.py | demigody_nas-tools/third_party/feapder/feapder/network/request.py | # -*- coding: utf-8 -*-
"""
Created on 2018-07-25 11:49:08
---------
@summary: 请求结构体
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import copy
import os
import re
import requests
from requests.cookies import RequestsCookieJar
from requests.packages.urllib3.exceptions import InsecureRequestWarning
impor... | 17,760 | Python | .py | 459 | 25.213508 | 106 | 0.564002 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,872 | selector.py | demigody_nas-tools/third_party/feapder/feapder/network/selector.py | # -*- coding: utf-8 -*-
"""
Created on 2018-10-08 15:33:37
---------
@summary: 重新定义 selector
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import re
import parsel
import six
from lxml import etree
from parsel import Selector as ParselSelector
from parsel import SelectorList as ParselSelectorList
from par... | 5,661 | Python | .py | 126 | 37.253968 | 99 | 0.65215 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,873 | user_agent.py | demigody_nas-tools/third_party/feapder/feapder/network/user_agent.py | # -*- coding: utf-8 -*-
"""
Created on 2016-12-28 17:55
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import random
USER_AGENTS = {
"chrome": [
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36",
"Mozilla/5.0 (Mac... | 130,399 | Python | .py | 1,061 | 114.048068 | 231 | 0.678821 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,874 | proxy_pool.py | demigody_nas-tools/third_party/feapder/feapder/network/proxy_pool/proxy_pool.py | # -*- coding: utf-8 -*-
"""
Created on 2022/10/19 10:40 AM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
from queue import Queue
import requests
import feapder.setting as setting
from feapder.network.proxy_pool.base import BaseProxyPool
from feapder.utils import metrics
from feapder.u... | 2,033 | Python | .py | 57 | 26 | 70 | 0.595676 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,875 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/network/proxy_pool/__init__.py | # -*- coding: utf-8 -*-
"""
Created on 2023/7/25 10:16
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
from .base import BaseProxyPool
from .proxy_pool import ProxyPool
| 200 | Python | .py | 11 | 17.181818 | 33 | 0.666667 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,876 | base.py | demigody_nas-tools/third_party/feapder/feapder/network/proxy_pool/base.py | # -*- coding: utf-8 -*-
"""
Created on 2023/7/25 10:03
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import abc
from feapder.utils.log import log
class BaseProxyPool:
@abc.abstractmethod
def get_proxy(self):
"""
获取代理
Returns:
{"http": "xxx... | 797 | Python | .py | 37 | 14.324324 | 43 | 0.514006 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,877 | guest_user_pool.py | demigody_nas-tools/third_party/feapder/feapder/network/user_pool/guest_user_pool.py | # -*- coding: utf-8 -*-
"""
Created on 2018/12/27 11:32 AM
---------
@summary: 访客用户池 不需要登陆
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import random
from typing import Optional
import feapder.utils.tools as tools
from feapder import setting
from feapder.db.redisdb import RedisDB
from feapder.network.u... | 5,293 | Python | .py | 139 | 23.165468 | 81 | 0.522881 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,878 | gold_user_pool.py | demigody_nas-tools/third_party/feapder/feapder/network/user_pool/gold_user_pool.py | # -*- coding: utf-8 -*-
"""
Created on 2018/12/27 11:32 AM
---------
@summary: 账号昂贵、限制查询次数及使用时间的用户UserPool
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import os
import random
import time
from enum import Enum, unique
from typing import Optional, List
from feapder import setting
from feapder.db.redisdb... | 10,762 | Python | .py | 249 | 23.97992 | 101 | 0.463521 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,879 | normal_user_pool.py | demigody_nas-tools/third_party/feapder/feapder/network/user_pool/normal_user_pool.py | # -*- coding: utf-8 -*-
"""
Created on 2018/12/27 11:32 AM
---------
@summary: 普通用户池,适用于账号成本低且大量的场景
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import os
import random
from typing import Iterable, Optional
import feapder.utils.tools as tools
from feapder import setting
from feapder.db.mysqldb import M... | 8,648 | Python | .py | 211 | 25.265403 | 142 | 0.504181 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,880 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/network/user_pool/__init__.py | __all__ = [
"GuestUserPool",
"GuestUser",
"NormalUserPool",
"NormalUser",
"GoldUserPool",
"GoldUser",
"GoldUserStatus",
]
from .gold_user_pool import GoldUserPool, GoldUser, GoldUserStatus
from .guest_user_pool import GuestUserPool, GuestUser
from .normal_user_pool import NormalUserPool, No... | 329 | Python | .py | 12 | 24 | 66 | 0.734177 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,881 | base_user_pool.py | demigody_nas-tools/third_party/feapder/feapder/network/user_pool/base_user_pool.py | import abc
import json
import random
import time
from datetime import datetime
from feapder.db.redisdb import RedisDB
from feapder.utils.log import log
from feapder.utils.tools import get_md5, timestamp_to_date
class GuestUser:
def __init__(self, user_agent=None, proxies=None, cookies=None, **kwargs):
se... | 6,397 | Python | .py | 182 | 24.824176 | 85 | 0.579362 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,882 | _requests.py | demigody_nas-tools/third_party/feapder/feapder/network/downloader/_requests.py | # -*- coding: utf-8 -*-
"""
Created on 2022/4/10 5:57 下午
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import requests
from requests.adapters import HTTPAdapter
from feapder.network.downloader.base import Downloader
from feapder.network.response import Response
class RequestsDownloa... | 1,440 | Python | .py | 37 | 29.405405 | 80 | 0.673742 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,883 | _selenium.py | demigody_nas-tools/third_party/feapder/feapder/network/downloader/_selenium.py | # -*- coding: utf-8 -*-
"""
Created on 2022/7/26 4:28 下午
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import feapder.setting as setting
import feapder.utils.tools as tools
from feapder.network.downloader.base import RenderDownloader
from feapder.network.response import Response
from f... | 3,098 | Python | .py | 87 | 24.183908 | 81 | 0.56044 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,884 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/network/downloader/__init__.py | from ._requests import RequestsDownloader
from ._requests import RequestsSessionDownloader
# 下面是非必要依赖
try:
from ._selenium import SeleniumDownloader
except ModuleNotFoundError:
pass
| 207 | Python | .py | 7 | 25 | 48 | 0.846995 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,885 | base.py | demigody_nas-tools/third_party/feapder/feapder/network/downloader/base.py | import abc
from abc import ABC
from feapder.network.response import Response
class Downloader:
@abc.abstractmethod
def download(self, request) -> Response:
"""
Args:
request: feapder.Request
Returns: feapder.Response
"""
raise NotImplementedError
de... | 694 | Python | .py | 30 | 14.5 | 45 | 0.565854 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,886 | setting.py | demigody_nas-tools/third_party/feapder/feapder/templates/project_template/setting.py | # -*- coding: utf-8 -*-
"""爬虫配置文件"""
# import os
# import sys
#
# # MYSQL
# MYSQL_IP = "localhost"
# MYSQL_PORT = 3306
# MYSQL_DB = ""
# MYSQL_USER_NAME = ""
# MYSQL_USER_PASS = ""
#
# # MONGODB
# MONGO_IP = "localhost"
# MONGO_PORT = 27017
# MONGO_DB = ""
# MONGO_USER_NAME = ""
# MONGO_USER_PASS = ""
#
# # REDIS
# # i... | 8,869 | Python | .py | 183 | 34.830601 | 145 | 0.696894 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,887 | main.py | demigody_nas-tools/third_party/feapder/feapder/templates/project_template/main.py | # -*- coding: utf-8 -*-
"""
Created on {DATE}
---------
@summary: 爬虫入口
---------
@author: {USER}
"""
from feapder import ArgumentParser
from spiders import *
def crawl_xxx():
"""
AirSpider爬虫
"""
spider = xxx.XXXSpider()
spider.start()
def crawl_xxx():
"""
Spider爬虫
"""
spider = xx... | 2,089 | Python | .py | 66 | 21.151515 | 76 | 0.596659 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,888 | mysql_pipeline.py | demigody_nas-tools/third_party/feapder/feapder/pipelines/mysql_pipeline.py | # -*- coding: utf-8 -*-
"""
Created on 2018-07-29 22:48:30
---------
@summary: 导出数据
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
from typing import Dict, List, Tuple
import feapder.utils.tools as tools
from feapder.db.mysqldb import MysqlDB
from feapder.pipelines import BasePipeline
from feapder.utils.l... | 2,088 | Python | .py | 59 | 23.59322 | 88 | 0.54928 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,889 | console_pipeline.py | demigody_nas-tools/third_party/feapder/feapder/pipelines/console_pipeline.py | # -*- coding: utf-8 -*-
"""
Created on 2021/3/18 12:39 上午
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
from feapder.pipelines import BasePipeline
from typing import Dict, List, Tuple
from feapder.utils.log import log
class ConsolePipeline(BasePipeline):
"""
pipeline 是单线程的,批量... | 1,392 | Python | .py | 39 | 21.384615 | 80 | 0.554717 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,890 | mongo_pipeline.py | demigody_nas-tools/third_party/feapder/feapder/pipelines/mongo_pipeline.py | # -*- coding: utf-8 -*-
"""
Created on 2021-04-18 14:12:21
---------
@summary: 导出数据
---------
@author: Mkdir700
@email: mkdir700@gmail.com
"""
from typing import Dict, List, Tuple
from feapder.db.mongodb import MongoDB
from feapder.pipelines import BasePipeline
from feapder.utils.log import log
class MongoPipeline(... | 2,405 | Python | .py | 72 | 20.236111 | 80 | 0.500716 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,891 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/pipelines/__init__.py | # -*- coding: utf-8 -*-
"""
Created on 2021/3/17 10:57 下午
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import abc
from typing import Dict, List, Tuple
class BasePipeline(metaclass=abc.ABCMeta):
"""
pipeline 是单线程的,批量保存数据的操作,不建议在这里写网络请求代码,如下载图片等
"""
@abc.abstractmetho... | 1,382 | Python | .py | 43 | 17.953488 | 80 | 0.541748 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,892 | handle_failed_requests.py | demigody_nas-tools/third_party/feapder/feapder/core/handle_failed_requests.py | # -*- coding: utf-8 -*-
"""
Created on 2018-08-13 11:43:01
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import feapder.setting as setting
from feapder.buffer.request_buffer import RequestBuffer
from feapder.db.redisdb import RedisDB
from feapder.network.request import Request
from fea... | 1,733 | Python | .py | 44 | 29.977273 | 86 | 0.625379 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,893 | handle_failed_items.py | demigody_nas-tools/third_party/feapder/feapder/core/handle_failed_items.py | # -*- coding: utf-8 -*-
"""
Created on 2022/11/18 11:33 AM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import feapder.setting as setting
from feapder.buffer.item_buffer import ItemBuffer
from feapder.db.redisdb import RedisDB
from feapder.network.item import Item, UpdateItem
from feap... | 2,808 | Python | .py | 67 | 27 | 87 | 0.511053 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,894 | parser_control.py | demigody_nas-tools/third_party/feapder/feapder/core/parser_control.py | # -*- coding: utf-8 -*-
"""
Created on 2017-01-03 16:06
---------
@summary: parser 控制类
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import inspect
import random
import threading
import time
from collections.abc import Iterable
import feapder.setting as setting
import feapder.utils.tools as tools
from fea... | 32,962 | Python | .py | 648 | 24.248457 | 121 | 0.39649 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,895 | collector.py | demigody_nas-tools/third_party/feapder/feapder/core/collector.py | # -*- coding: utf-8 -*-
"""
Created on 2016-12-23 11:24
---------
@summary: request 管理
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import threading
import time
from queue import Queue, Empty
import feapder.setting as setting
import feapder.utils.tools as tools
from feapder.db.redisdb import RedisDB
fro... | 3,256 | Python | .py | 96 | 23.458333 | 87 | 0.56039 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,896 | __init__.py | demigody_nas-tools/third_party/feapder/feapder/core/__init__.py | # -*- coding: utf-8 -*-
'''
Created on 2020/4/23 12:09 AM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
''' | 136 | Python | .py | 9 | 14.222222 | 29 | 0.570313 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,897 | scheduler.py | demigody_nas-tools/third_party/feapder/feapder/core/scheduler.py | # -*- coding: utf-8 -*-
"""
Created on 2017-01-09 10:38
---------
@summary: 组装parser、 parser_control 和 collector
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import threading
import time
from collections.abc import Iterable
import feapder.setting as setting
import feapder.utils.tools as tools
from feapde... | 21,525 | Python | .py | 503 | 26.749503 | 129 | 0.547337 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,898 | base_parser.py | demigody_nas-tools/third_party/feapder/feapder/core/base_parser.py | # -*- coding: utf-8 -*-
"""
Created on 2018-07-25 11:41:57
---------
@summary: parser 的基类
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import os
import feapder.utils.tools as tools
from feapder.db.mysqldb import MysqlDB
from feapder.network.item import UpdateItem
from feapder.utils.log import log
clas... | 6,240 | Python | .py | 189 | 20.793651 | 126 | 0.526126 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,899 | task_spider.py | demigody_nas-tools/third_party/feapder/feapder/core/spiders/task_spider.py | # -*- coding: utf-8 -*-
"""
Created on 2020/4/22 12:06 AM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import os
import time
import warnings
from collections.abc import Iterable
from typing import List, Tuple, Dict, Union
import feapder.setting as setting
import feapder.utils.tools a... | 27,875 | Python | .py | 631 | 25.302694 | 139 | 0.496886 | demigody/nas-tools | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |