Ejemplo n.º 1
0
from pyUltroid.functions.admins import admin_check
from pyUltroid.functions.tools import is_url_ok
from pyUltroid.functions.ytdl import get_videos_link
from pyUltroid._misc import owner_and_sudos, sudoers
from pyUltroid._misc._assistant import in_pattern
from pyUltroid._misc._wrappers import eod, eor
from pyUltroid.version import __version__ as UltVer
from telethon import events
from telethon.tl import functions, types
from telethon.utils import get_display_name

try:
    from yt_dlp import YoutubeDL
except ImportError:
    YoutubeDL = None
    LOGS.error("'yt-dlp' not found!")

try:
    from youtubesearchpython import VideosSearch
except ImportError:
    VideosSearch = None

from strings import get_string

asstUserName = asst.me.username
LOG_CHANNEL = udB.get_key("LOG_CHANNEL")
ACTIVE_CALLS, VC_QUEUE = [], {}
MSGID_CACHE, VIDEO_ON = {}, {}
CLIENTS = {}

Ejemplo n.º 2
0
import sys
from os import listdir, path
from typing import Any, Dict, List, Union

from pyUltroid import udB, LOGS
try:
    from google_trans_new import google_translator
    Trs = google_translator()
except ImportError:
    LOGS.error("'google_trans_new' not installed!")
    Trs = None

try:
    from yaml import safe_load
except ModuleNotFoundError:

    def _get_value(stri):
        try:
            value = eval(stri.strip())
        except Exception as er:
            LOGS.debug(er)
            value = stri.strip()
        return value

    def safe_load(file, *args, **kwargs):
        read = file.readlines()
        out = {}
        for line in read:
            if ":" in line:  # Ignores Empty & Invalid lines
                spli = line.split(":", maxsplit=1)
                key = spli[0].strip()