예제 #1
0
import time

import lyricsgenius
import requests
import wget
from pyrogram import filters
from pyrogram.types import Message
from tswift import Song
from youtube_dl import YoutubeDL
from youtubesearchpython import SearchVideos

from LaylaRobot.conf import get_str_key
from LaylaRobot.pyrogramee.pluginshelper import get_text, progress
from LaylaRobot import pbot

GENIUS = get_str_key("GENIUS_API_TOKEN", None)


@pbot.on_message(filters.command(["vsong", "video"]))
async def ytmusic(client, message: Message):
    urlissed = get_text(message)

    pablo = await client.send_message(
        message.chat.id,
        f"`Getting {urlissed} From Youtube Servers. Please Wait.`")
    if not urlissed:
        await pablo.edit(
            "Invalid Command Syntax, Please Check Help Menu To Know More!")
        return

    search = SearchVideos(f"{urlissed}", offset=1, mode="dict", max_results=1)
예제 #2
0
from LaylaRobot.pyrogramee.telethonbasics import is_admin
from LaylaRobot.events import register
from LaylaRobot import MONGO_DB_URI 
from pymongo import MongoClient
from LaylaRobot.modules.sql_extended.nsfw_watch_sql import (
    add_nsfwatch,
    get_all_nsfw_enabled_chat,
    is_nsfwatch_indb,
    rmnsfwatch,
)
from LaylaRobot import telethn as tbot

translator = google_translator()
MUTE_RIGHTS = ChatBannedRights(until_date=None, send_messages=False)

MONGO_DB_URI = get_str_key("MONGO_DB_URI")

client = MongoClient()
client = MongoClient(MONGO_DB_URI)
db = client["LaylaRobot"]

async def is_nsfw(event):
    lmao = event
    if not (
        lmao.gif
        or lmao.video
        or lmao.video_note
        or lmao.photo
        or lmao.sticker
        or lmao.media
    ):