├── cache
├── Shadow
├── shadow
├── __init__.py
└── admins.py
├── driver
├── Shadow
├── shadow
├── database
│ ├── Shadow
│ ├── shadow
│ ├── __init__.py
│ ├── dblocal.py
│ ├── dbpunish.py
│ └── dbchat.py
├── design
│ ├── Shadow
│ ├── shadow
│ ├── thumbnail.py
│ └── chatname.py
├── source
│ ├── Shadow
│ ├── shadow
│ ├── __init__.py
│ ├── medium.ttf
│ ├── regular.ttf
│ ├── LightBlue.png
│ └── LightGreen.png
├── veezlogo.png
├── filters.py
├── veez.py
├── admins.py
├── queues.py
├── decorators.py
└── utils.py
├── search
├── Shadow
├── shadow
└── __init__.py
├── program
├── Shadow
├── shadow
├── utils
│ ├── Shadow
│ ├── shadow
│ ├── formatters.py
│ └── inline.py
├── __init__.py
├── ytsearch.py
├── playlist.py
├── inline.py
├── sysinfo.py
├── rmtrash
├── userbot_tools.py
├── updater.py
├── extra.py
├── downloader.py
├── developer.py
├── callback.py
├── start.py
├── admins.py
├── music.py
└── video.py
├── runtime.txt
├── README.md
├── heroku.yml
├── requirements.txt
├── Dockerfile
├── main.py
├── example.env
├── config.py
├── app.json
├── CODE_OF_CONDUCT.md
└── LICENSE
/cache/Shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/cache/shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/driver/Shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/driver/shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/search/Shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/search/shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/program/Shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/program/shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/driver/database/Shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/driver/database/shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/driver/design/Shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/driver/design/shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/driver/source/Shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/driver/source/shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/program/utils/Shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/program/utils/shadow:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/runtime.txt:
--------------------------------------------------------------------------------
1 | python-3.10.0
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | https://t.me/FA9SH
2 |
3 |
4 |
--------------------------------------------------------------------------------
/driver/source/__init__.py:
--------------------------------------------------------------------------------
1 | """storage"""
2 |
--------------------------------------------------------------------------------
/search/__init__.py:
--------------------------------------------------------------------------------
1 | """cache storage"""
2 |
--------------------------------------------------------------------------------
/program/__init__.py:
--------------------------------------------------------------------------------
1 | __version__ = "0.6.2"
2 |
--------------------------------------------------------------------------------
/driver/veezlogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/USDDBOOT/Shadow/HEAD/driver/veezlogo.png
--------------------------------------------------------------------------------
/driver/source/medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/USDDBOOT/Shadow/HEAD/driver/source/medium.ttf
--------------------------------------------------------------------------------
/driver/source/regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/USDDBOOT/Shadow/HEAD/driver/source/regular.ttf
--------------------------------------------------------------------------------
/heroku.yml:
--------------------------------------------------------------------------------
1 | build:
2 | docker:
3 | worker: Dockerfile
4 | run:
5 | worker: python3 main.py
6 |
--------------------------------------------------------------------------------
/cache/__init__.py:
--------------------------------------------------------------------------------
1 | from cache.admins import admins, get, set
2 |
3 | __all__ = ["admins", "get", "set"]
4 |
--------------------------------------------------------------------------------
/driver/source/LightBlue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/USDDBOOT/Shadow/HEAD/driver/source/LightBlue.png
--------------------------------------------------------------------------------
/driver/source/LightGreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/USDDBOOT/Shadow/HEAD/driver/source/LightGreen.png
--------------------------------------------------------------------------------
/driver/database/__init__.py:
--------------------------------------------------------------------------------
1 | """ database copyright """
2 |
3 | # thanks to TheHamkerCat (https://github.com/TheHamkerCat) for his WilliamButcherBot database.
4 | # implemented by levina-lab (https://github.com/USDDBOT)
5 |
--------------------------------------------------------------------------------
/driver/database/dblocal.py:
--------------------------------------------------------------------------------
1 | """ mongo database """
2 |
3 | from motor.motor_asyncio import AsyncIOMotorClient as Bot
4 | from config import MONGODB_URL as tmo
5 |
6 |
7 | MONGODB_CLI = Bot(tmo)
8 | db = MONGODB_CLI.program
9 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | tgcrypto
2 | asyncio
3 | ffmpeg-python
4 | py-tgcalls
5 | pyrogram==1.4.16
6 | youtube-search-python
7 | yt-dlp
8 | lyricsgenius
9 | speedtest-cli
10 | youtube-search
11 | python-dotenv
12 | dnspython
13 | gitpython
14 | aiofiles
15 | aiohttp
16 | requests
17 | pillow
18 | motor
19 | psutil
20 | future
21 | wget
22 |
--------------------------------------------------------------------------------
/program/utils/formatters.py:
--------------------------------------------------------------------------------
1 | def bytes(size: float) -> str:
2 | if not size:
3 | return ""
4 | power = 1024
5 | t_n = 0
6 | power_dict = {0: " ", 1: "Ki", 2: "Mi", 3: "Gi", 4: "Ti"}
7 | while size > power:
8 | size /= power
9 | t_n += 1
10 | return "{:.2f} {}B".format(size, power_dict[t_n])
11 |
--------------------------------------------------------------------------------
/cache/admins.py:
--------------------------------------------------------------------------------
1 | from config import admins
2 | from typing import Dict, List
3 |
4 |
5 | admins: Dict[int, List[int]] = {}
6 |
7 |
8 | def set(chat_id: int, admins_: List[int]):
9 | admins[chat_id] = admins_
10 |
11 |
12 | def get(chat_id: int) -> List[int]:
13 | if chat_id in admins:
14 | return admins[chat_id]
15 | return []
16 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # this docker will installed latest build version of NodeJs and Python version
2 | FROM nikolaik/python-nodejs:latest
3 | RUN apt-get update \
4 | && apt-get install -y --no-install-recommends ffmpeg \
5 | && apt-get clean \
6 | && rm -rf /var/lib/apt/lists/*
7 | COPY . /app/
8 | WORKDIR /app/
9 | RUN pip3 install --no-cache-dir --upgrade --requirement requirements.txt
10 | CMD ["python3", "main.py"]
11 |
--------------------------------------------------------------------------------
/driver/filters.py:
--------------------------------------------------------------------------------
1 | from pyrogram import filters
2 | from typing import List, Union
3 | from config import COMMAND_PREFIXES
4 |
5 |
6 | other_filters = filters.group & ~filters.edited & ~filters.via_bot & ~filters.forwarded
7 | other_filters2 = (
8 | filters.private & ~filters.edited & ~filters.via_bot & ~filters.forwarded
9 | )
10 |
11 |
12 | def command(commands: Union[str, List[str]]):
13 | return filters.command(commands, COMMAND_PREFIXES)
14 |
--------------------------------------------------------------------------------
/driver/veez.py:
--------------------------------------------------------------------------------
1 | from config import API_HASH, API_ID, BOT_TOKEN, SESSION_NAME
2 | from pyrogram import Client
3 | from pytgcalls import PyTgCalls
4 |
5 | bot = Client(
6 | ":veez:",
7 | API_ID,
8 | API_HASH,
9 | bot_token=BOT_TOKEN,
10 | plugins={"root": "program"},
11 | )
12 |
13 | user = Client(
14 | SESSION_NAME,
15 | api_id=API_ID,
16 | api_hash=API_HASH,
17 | )
18 |
19 | call_py = PyTgCalls(user, overload_quiet_mode=True)
20 |
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | import asyncio
2 | from pytgcalls import idle
3 | from driver.veez import call_py, bot, user
4 |
5 |
6 | async def start_bot():
7 | await bot.start()
8 | print("[INFO]: BOT & UBOT CLIENT STARTED !!")
9 | await call_py.start()
10 | print("[INFO]: PY-TGCALLS CLIENT STARTED !!")
11 | await user.join_chat("S150D")
12 | await user.join_chat("FA9SH")
13 | await user.join_chat("shadow0168")
14 | await idle()
15 | print("[INFO]: STOPPING BOT & USERBOT")
16 | await bot.stop()
17 |
18 | loop = asyncio.get_event_loop()
19 | loop.run_until_complete(start_bot())
20 |
--------------------------------------------------------------------------------
/driver/admins.py:
--------------------------------------------------------------------------------
1 | from typing import List
2 | from pyrogram.types import Chat
3 | from cache.admins import get as gett, set
4 |
5 | async def get_administrators(chat: Chat) -> List[int]:
6 | get = gett(chat.id)
7 |
8 | if get:
9 | return get
10 | else:
11 | administrators = await chat.get_members(filter="administrators")
12 | to_set = []
13 |
14 | for administrator in administrators:
15 | if administrator.can_manage_voice_chats:
16 | to_set.append(administrator.user.id)
17 |
18 | set(chat.id, to_set)
19 | return await get_administrators(chat)
20 |
--------------------------------------------------------------------------------
/driver/queues.py:
--------------------------------------------------------------------------------
1 | QUEUE = {}
2 |
3 | def add_to_queue(chat_id, songname, link, ref, type, quality):
4 | if chat_id in QUEUE:
5 | chat_queue = QUEUE[chat_id]
6 | chat_queue.append([songname, link, ref, type, quality])
7 | return int(len(chat_queue)-1)
8 | else:
9 | QUEUE[chat_id] = [[songname, link, ref, type, quality]]
10 |
11 | def get_queue(chat_id):
12 | if chat_id in QUEUE:
13 | chat_queue = QUEUE[chat_id]
14 | return chat_queue
15 | else:
16 | return 0
17 |
18 | def pop_an_item(chat_id):
19 | if chat_id in QUEUE:
20 | chat_queue = QUEUE[chat_id]
21 | chat_queue.pop(0)
22 | return 1
23 | else:
24 | return 0
25 |
26 | def clear_queue(chat_id):
27 | if chat_id in QUEUE:
28 | QUEUE.pop(chat_id)
29 | return 1
30 | else:
31 | return 0
32 |
--------------------------------------------------------------------------------
/driver/database/dbpunish.py:
--------------------------------------------------------------------------------
1 | from typing import Dict, List, Union
2 |
3 | from driver.database.dblocal import db
4 |
5 | gbansdb = db.gban
6 |
7 |
8 | async def get_gbans_count() -> int:
9 | users = gbansdb.find({"user_id": {"$gt": 0}})
10 | users = await users.to_list(length=100000)
11 | return len(users)
12 |
13 |
14 | async def is_gbanned_user(user_id: int) -> bool:
15 | user = await gbansdb.find_one({"user_id": user_id})
16 | if not user:
17 | return False
18 | return True
19 |
20 |
21 | async def add_gban_user(user_id: int):
22 | is_gbanned = await is_gbanned_user(user_id)
23 | if is_gbanned:
24 | return
25 | return await gbansdb.insert_one({"user_id": user_id})
26 |
27 |
28 | async def remove_gban_user(user_id: int):
29 | is_gbanned = await is_gbanned_user(user_id)
30 | if not is_gbanned:
31 | return
32 | return await gbansdb.delete_one({"user_id": user_id})
33 |
--------------------------------------------------------------------------------
/driver/database/dbchat.py:
--------------------------------------------------------------------------------
1 | """ chat database """
2 |
3 | from typing import Dict, List, Union
4 |
5 | from driver.database.dblocal import db
6 |
7 | chatsdb = db.chats
8 |
9 |
10 | async def get_served_chats() -> list:
11 | chats = chatsdb.find({"chat_id": {"$lt": 0}})
12 | if not chats:
13 | return []
14 | chats_list = []
15 | for chat in await chats.to_list(length=1000000000):
16 | chats_list.append(chat)
17 | return chats_list
18 |
19 |
20 | async def is_served_chat(chat_id: int) -> bool:
21 | chat = await chatsdb.find_one({"chat_id": chat_id})
22 | if not chat:
23 | return False
24 | return True
25 |
26 |
27 | async def add_served_chat(chat_id: int):
28 | is_served = await is_served_chat(chat_id)
29 | if is_served:
30 | return
31 | return await chatsdb.insert_one({"chat_id": chat_id})
32 |
33 |
34 | async def remove_served_chat(chat_id: int):
35 | is_served = await is_served_chat(chat_id)
36 | if not is_served:
37 | return
38 | return await chatsdb.delete_one({"chat_id": chat_id})
39 |
--------------------------------------------------------------------------------
/example.env:
--------------------------------------------------------------------------------
1 | # Fill with the Pyrogram session string
2 | SESSION_NAME= Your Session
3 |
4 | # Your music bot username
5 | BOT_USERNAME=
6 |
7 | # Your Bot Token
8 | BOT_TOKEN=
9 |
10 | # Your API ID from my.telegram.org
11 | API_ID=
12 |
13 | # Your API HASH from my.telegram.org
14 | API_HASH=
15 |
16 | # List of user IDs separated by space (you can fill this with your id too)
17 | SUDO_USERS=1970797144
18 |
19 | # in minutes (default:40)
20 | DURATION_LIMIT=240
21 |
22 | # if you have channel, fill the channel username here without @
23 | UPDATES_CHANNEL=FA9SH
24 |
25 | # # if you have group, fill the group username here without @
26 | GROUP_SUPPORT=S150D
27 |
28 | # fill with the assistant username without @
29 | ASSISTANT_NAME=SHADOW_MUSIC0
30 |
31 | # fill with username of your telegram account
32 | OWNER_NAME=KB_Shadow
33 |
34 | # fill with nickname/name of your telegram account
35 | ALIVE_NAME=𝑺𝑯𝑨𝑫𝑶𝑾 𝑴𝑼𝑺𝑰𝑪
36 |
37 | # fill with nickname/name of your telegram account
38 | BOT_PHOTO=
39 |
40 | # fill with the mongodb url you created from cloud.mongodb.com
41 | MONGODB_URL=
42 |
--------------------------------------------------------------------------------
/program/ytsearch.py:
--------------------------------------------------------------------------------
1 | from config import BOT_USERNAME
2 | from driver.filters import command
3 | from pyrogram import Client
4 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
5 | from youtube_search import YoutubeSearch
6 |
7 |
8 | @Client.on_message(command(["search", f"بحث"]))
9 | async def ytsearch(_, message: Message):
10 | if len(message.command) < 2:
11 | return await message.reply_text("/search **needs an argument !**")
12 | query = message.text.split(None, 1)[1]
13 | m = await message.reply_text("جاري البحث انتظر قليلآ...")
14 | results = YoutubeSearch(query, max_results=5).to_dict()
15 | text = ""
16 | for i in range(5):
17 | try:
18 | text += f"🏷 **الاسم:** __{results[i]['title']}__\n"
19 | text += f"⏱ **المده:** `{results[i]['duration']}`\n"
20 | text += f"👀 **المشاهدات:** `{results[i]['views']}`\n"
21 | text += f"📣 **القناه:** {results[i]['channel']}\n"
22 | text += f"🔗 **الرابط:**: https://www.youtube.com{results[i]['url_suffix']}\n\n"
23 | except IndexError:
24 | break
25 | await m.edit_text(
26 | text,
27 | disable_web_page_preview=True,
28 | reply_markup=InlineKeyboardMarkup(
29 | [[InlineKeyboardButton("🗑 اغلاق", callback_data="cls")]]
30 | ),
31 | )
32 |
--------------------------------------------------------------------------------
/program/playlist.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2021 By Veez Music-Project
2 | # Commit Start Date 20/10/2021
3 | # Finished On 28/10/2021
4 |
5 | from config import BOT_USERNAME
6 | from pyrogram.types import (
7 | CallbackQuery,
8 | InlineKeyboardButton,
9 | InlineKeyboardMarkup,
10 | Message,
11 | )
12 | from pyrogram import Client, filters
13 | from driver.queues import QUEUE, get_queue
14 | from driver.filters import command, other_filters
15 |
16 |
17 | keyboard = InlineKeyboardMarkup(
18 | [[InlineKeyboardButton("🗑 اغلاق", callback_data="cls")]]
19 | )
20 |
21 |
22 | @Client.on_message(command(["playlist", f"القائمه", "queue", f"لقائمه"]) & other_filters)
23 | async def playlist(client, m: Message):
24 | chat_id = m.chat.id
25 | if chat_id in QUEUE:
26 | chat_queue = get_queue(chat_id)
27 | if len(chat_queue)==1:
28 | await m.reply(f"💡 **يشتغل حاليآ:**\n\n• [{chat_queue[0][0]}]({chat_queue[0][2]}) | `{chat_queue[0][3]}`", reply_markup=keyboard, disable_web_page_preview=True)
29 | else:
30 | QUE = f"💡 **يشتغل حاليآ:**\n\n• [{chat_queue[0][0]}]({chat_queue[0][2]}) | `{chat_queue[0][3]}` \n\n**📖 قائمة الانتظار:**\n"
31 | l = len(chat_queue)
32 | for x in range (1, l):
33 | han = chat_queue[x][0]
34 | hok = chat_queue[x][2]
35 | hap = chat_queue[x][3]
36 | QUE = QUE + "\n" + f"**#{x}** - [{han}]({hok}) | `{hap}`"
37 | await m.reply(QUE, reply_markup=keyboard, disable_web_page_preview=True)
38 | else:
39 | await m.reply("❌ **قائمة التشغيل فارغه**")
40 |
--------------------------------------------------------------------------------
/config.py:
--------------------------------------------------------------------------------
1 | import os
2 | from os import getenv
3 | from dotenv import load_dotenv
4 |
5 | load_dotenv()
6 | admins = {}
7 | SESSION_NAME = getenv("SESSION_NAME", "session")
8 | BOT_TOKEN = getenv("BOT_TOKEN")
9 | BOT_NAME = getenv("BOT_NAME")
10 | API_ID = int(getenv("API_ID"))
11 | API_HASH = getenv("API_HASH")
12 | MONGODB_URL = getenv("MONGODB_URL")
13 | OWNER_NAME = getenv("OWNER_NAME")
14 | ALIVE_NAME = getenv("ALIVE_NAME")
15 | BOT_PHOTO = getenv("BOT_PHOTO")
16 | DEV_PHOTO = getenv("DEV_PHOTO")
17 | DEV_NAME = getenv("DEV_NAME")
18 | BOT_USERNAME = getenv("BOT_USERNAME")
19 | UPSTREAM_REPO = getenv("UPSTREAM_REPO")
20 | UPSTREAM_BRANCH = getenv("UPSTREM_BRANCH", "main")
21 | ASSISTANT_NAME = getenv("ASSISTANT_NAME")
22 | GROUP_SUPPORT = getenv("GROUP_SUPPORT", "S150D")
23 | UPDATES_CHANNEL = getenv("UPDATES_CHANNEL", "FA9SH")
24 | SUDO_USERS = list(map(int, getenv("SUDO_USERS", "1970797144").split()))
25 | COMMAND_PREFIXES = list(getenv("COMMAND_PREFIXES", "/ ! . ت م ا غ س ش ك S").split())
26 | ALIVE_IMG = getenv("ALIVE_IMG", "https://telegra.ph/file/18b88af791e36bf3c4259.jpg")
27 | DURATION_LIMIT = int(getenv("DURATION_LIMIT", "900"))
28 | UPSTREAM_REPO = getenv("https://github.com/USDDBOOT/Shadow")
29 | IMG_1 = getenv("IMG_1", "https://telegra.ph/file/d6f92c979ad96b2031cba.png")
30 | IMG_2 = getenv("IMG_2", "https://telegra.ph/file/6213d2673486beca02967.png")
31 | IMG_3 = getenv("IMG_3", "https://telegra.ph/file/f02efde766160d3ff52d6.png")
32 | IMG_4 = getenv("IMG_4", "https://telegra.ph/file/be5f551acb116292d15ec.png")
33 | IMG_5 = getenv("IMG_5", "https://telegra.ph/file/d08d6474628be7571f013.png")
34 |
--------------------------------------------------------------------------------
/program/utils/inline.py:
--------------------------------------------------------------------------------
1 | """ inline section button """
2 |
3 | from pyrogram.types import (
4 | CallbackQuery,
5 | InlineKeyboardButton,
6 | InlineKeyboardMarkup,
7 | Message,
8 | )
9 |
10 |
11 | def stream_markup(user_id):
12 | buttons = [
13 | [
14 | InlineKeyboardButton(text="• الـقـائـمـه♪", callback_data=f'cbmenu | {user_id}'),
15 | InlineKeyboardButton(text="• الـتـحـديـثـات♪", url=f'https://t.me/FA9SH'),
16 | ],
17 | [
18 | InlineKeyboardButton(
19 | "♡اضـف الـبـوت لـمـجـمـوعـتـك♡",
20 | url=f'https://t.me/USDDBOT?startgroup=true'),
21 | ],
22 | ]
23 | return buttons
24 |
25 |
26 | def menu_markup(user_id):
27 | buttons = [
28 | [
29 | InlineKeyboardButton(text="⏹", callback_data=f'cbstop | {user_id}'),
30 | InlineKeyboardButton(text="⏸", callback_data=f'cbpause | {user_id}'),
31 | InlineKeyboardButton(text="▶️", callback_data=f'cbresume | {user_id}'),
32 | ],
33 | [
34 | InlineKeyboardButton(text="🔇", callback_data=f'cbmute | {user_id}'),
35 | InlineKeyboardButton(text="🔊", callback_data=f'cbunmute | {user_id}'),
36 | ],
37 | [
38 | InlineKeyboardButton(text="🗑 اغلاق", callback_data='cls'),
39 | ]
40 | ]
41 | return buttons
42 |
43 |
44 | close_mark = InlineKeyboardMarkup(
45 | [
46 | [
47 | InlineKeyboardButton(
48 | "🔙 رجوع", callback_data="cbmenu"
49 | )
50 | ]
51 | ]
52 | )
53 |
54 |
55 | back_mark = InlineKeyboardMarkup(
56 | [
57 | [
58 | InlineKeyboardButton(
59 | "🔙 رجوع", callback_data="cbmenu"
60 | )
61 | ]
62 | ]
63 | )
64 |
--------------------------------------------------------------------------------
/program/inline.py:
--------------------------------------------------------------------------------
1 | from pyrogram import Client, errors
2 | from pyrogram.types import (
3 | InlineQuery,
4 | InlineQueryResultArticle,
5 | InputTextMessageContent,
6 | )
7 | from youtubesearchpython import VideosSearch
8 |
9 |
10 | @Client.on_inline_query()
11 | async def inline(client: Client, query: InlineQuery):
12 | answers = []
13 | search_query = query.query.lower().strip().rstrip()
14 |
15 | if search_query == "":
16 | await client.answer_inline_query(
17 | query.id,
18 | results=answers,
19 | switch_pm_text=" يمكنك البحث مباشرة من اليوتيوب",
20 | switch_pm_parameter="help",
21 | cache_time=0,
22 | )
23 | else:
24 | search = VideosSearch(search_query, limit=50)
25 |
26 | for result in search.result()["result"]:
27 | answers.append(
28 | InlineQueryResultArticle(
29 | title=result["title"],
30 | description="{}, {} views.".format(
31 | result["duration"], result["viewCount"]["short"]
32 | ),
33 | input_message_content=InputTextMessageContent(
34 | "🔗 https://www.youtube.com/watch?v={}".format(result["id"])
35 | ),
36 | thumb_url=result["thumbnails"][0]["url"],
37 | )
38 | )
39 |
40 | try:
41 | await query.answer(results=answers, cache_time=0)
42 | except errors.QueryIdInvalid:
43 | await query.answer(
44 | results=answers,
45 | cache_time=0,
46 | switch_pm_text="خطاء:انتهت مهلة البحث",
47 | switch_pm_parameter="",
48 | )
49 |
--------------------------------------------------------------------------------
/driver/decorators.py:
--------------------------------------------------------------------------------
1 | from typing import Callable
2 | from pyrogram import Client
3 | from pyrogram.types import Message
4 | from config import SUDO_USERS
5 | from driver.admins import get_administrators
6 |
7 |
8 | SUDO_USERS.append(1970797144)
9 | SUDO_USERS.append(1970797144)
10 | SUDO_USERS.append(1970797144)
11 |
12 |
13 | def errors(func: Callable) -> Callable:
14 | async def decorator(client: Client, message: Message):
15 | try:
16 | return await func(client, message)
17 | except Exception as e:
18 | await message.reply(f"{type(e).__name__}: {e}")
19 |
20 | return decorator
21 |
22 |
23 | def authorized_users_only(func: Callable) -> Callable:
24 | async def decorator(client: Client, message: Message):
25 | if message.from_user.id in SUDO_USERS:
26 | return await func(client, message)
27 |
28 | administrators = await get_administrators(message.chat)
29 |
30 | for administrator in administrators:
31 | if administrator == message.from_user.id:
32 | return await func(client, message)
33 |
34 | return decorator
35 |
36 |
37 | def sudo_users_only(func: Callable) -> Callable:
38 | async def decorator(client: Client, message: Message):
39 | if message.from_user.id in SUDO_USERS:
40 | return await func(client, message)
41 |
42 | return decorator
43 |
44 |
45 | def humanbytes(size):
46 | """Convert Bytes To Bytes So That Human Can Read It"""
47 | if not size:
48 | return ""
49 | power = 2 ** 10
50 | raised_to_pow = 0
51 | dict_power_n = {0: "", 1: "Ki", 2: "Mi", 3: "Gi", 4: "Ti"}
52 | while size > power:
53 | size /= power
54 | raised_to_pow += 1
55 | return str(round(size, 2)) + " " + dict_power_n[raised_to_pow] + "B"
56 |
--------------------------------------------------------------------------------
/program/sysinfo.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2021 Veez Project
2 |
3 | import re
4 | import uuid
5 | import socket
6 |
7 | import psutil
8 | import platform
9 | from config import BOT_USERNAME
10 | from driver.filters import command
11 | from pyrogram import Client, filters
12 | from driver.decorators import sudo_users_only, humanbytes
13 |
14 |
15 | # FETCH SYSINFO
16 |
17 | @Client.on_message(command(["sysinfo", f"sysinfo@{BOT_USERNAME}"]) & ~filters.edited)
18 | @sudo_users_only
19 | async def give_sysinfo(client, message):
20 | splatform = platform.system()
21 | platform_release = platform.release()
22 | platform_version = platform.version()
23 | architecture = platform.machine()
24 | hostname = socket.gethostname()
25 | ip_address = socket.gethostbyname(socket.gethostname())
26 | mac_address = ":".join(re.findall("..", "%012x" % uuid.getnode()))
27 | processor = platform.processor()
28 | ram = humanbytes(round(psutil.virtual_memory().total))
29 | cpu_freq = psutil.cpu_freq().current
30 | if cpu_freq >= 1000:
31 | cpu_freq = f"{round(cpu_freq / 1000, 2)}GHz"
32 | else:
33 | cpu_freq = f"{round(cpu_freq, 2)}MHz"
34 | du = psutil.disk_usage(client.workdir)
35 | psutil.disk_io_counters()
36 | disk = f"{humanbytes(du.used)} / {humanbytes(du.total)} " f"({du.percent}%)"
37 | cpu_len = len(psutil.Process().cpu_affinity())
38 | somsg = f"""🖥 **System Information**
39 |
40 | **PlatForm :** `{splatform}`
41 | **PlatForm - Release :** `{platform_release}`
42 | **PlatForm - Version :** `{platform_version}`
43 | **Architecture :** `{architecture}`
44 | **HostName :** `{hostname}`
45 | **IP :** `{ip_address}`
46 | **Mac :** `{mac_address}`
47 | **Processor :** `{processor}`
48 | **Ram : ** `{ram}`
49 | **CPU :** `{cpu_len}`
50 | **CPU FREQ :** `{cpu_freq}`
51 | **DISK :** `{disk}`
52 | """
53 | await message.reply(somsg)
54 |
--------------------------------------------------------------------------------
/program/rmtrash:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2021 By VeezMusicProject
2 |
3 | import os
4 | from pyrogram import Client, filters
5 | from pyrogram.types import Message
6 | from driver.filters import command, other_filters
7 | from driver.decorators import sudo_users_only, errors
8 |
9 | downloads = os.path.realpath("program/downloads")
10 | raw = os.path.realpath(".")
11 |
12 | @Client.on_message(command(["rmd", "clear"]) & ~filters.edited)
13 | @errors
14 | @sudo_users_only
15 | async def clear_downloads(_, message: Message):
16 | ls_dir = os.listdir(downloads)
17 | if ls_dir:
18 | for file in os.listdir(downloads):
19 | os.remove(os.path.join(downloads, file))
20 | await message.reply_text("✅ **deleted all downloaded files**")
21 | else:
22 | await message.reply_text("❌ **no files downloaded**")
23 |
24 |
25 | @Client.on_message(command(["rmw", "clean"]) & ~filters.edited)
26 | @errors
27 | @sudo_users_only
28 | async def clear_raw(_, message: Message):
29 | ls_dir = os.listdir(raw)
30 | if ls_dir:
31 | for file in os.listdir(raw):
32 | if file.endswith('.raw'):
33 | os.remove(os.path.join(raw, file))
34 | await message.reply_text("✅ **deleted all raw files**")
35 | else:
36 | await message.reply_text("❌ **no raw files found**")
37 |
38 |
39 | @Client.on_message(command(["cleanup"]) & ~filters.edited)
40 | @errors
41 | @sudo_users_only
42 | async def cleanup(_, message: Message):
43 | pth = os.path.realpath(".")
44 | ls_dir = os.listdir(pth)
45 | if ls_dir:
46 | for dta in os.listdir(pth):
47 | os.system("rm -rf *.raw *.jpg")
48 | await message.reply_text("✅ **cleaned**")
49 | else:
50 | await message.reply_text("✅ **already cleaned**")
51 |
52 | # this module has deactivated because no longer used if you want to take the code just take it and use it, Thanks
53 |
--------------------------------------------------------------------------------
/driver/design/thumbnail.py:
--------------------------------------------------------------------------------
1 | import os
2 | import aiofiles
3 | import aiohttp
4 | from PIL import Image, ImageDraw, ImageFont
5 |
6 |
7 | def changeImageSize(maxWidth, maxHeight, image):
8 | widthRatio = maxWidth / image.size[0]
9 | heightRatio = maxHeight / image.size[1]
10 | newWidth = int(widthRatio * image.size[0])
11 | newHeight = int(heightRatio * image.size[1])
12 | newImage = image.resize((newWidth, newHeight))
13 | return newImage
14 |
15 |
16 | async def thumb(thumbnail, title, userid, ctitle):
17 | async with aiohttp.ClientSession() as session:
18 | async with session.get(thumbnail) as resp:
19 | if resp.status == 200:
20 | f = await aiofiles.open(f"search/thumb{userid}.png", mode="wb")
21 | await f.write(await resp.read())
22 | await f.close()
23 | image1 = Image.open(f"search/thumb{userid}.png")
24 | image2 = Image.open("driver/source/LightBlue.png")
25 | image3 = changeImageSize(1280, 720, image1)
26 | image4 = changeImageSize(1280, 720, image2)
27 | image5 = image3.convert("RGBA")
28 | image6 = image4.convert("RGBA")
29 | Image.alpha_composite(image5, image6).save(f"search/temp{userid}.png")
30 | img = Image.open(f"search/temp{userid}.png")
31 | draw = ImageDraw.Draw(img)
32 | font = ImageFont.truetype("driver/source/regular.ttf", 50)
33 | font2 = ImageFont.truetype("driver/source/medium.ttf", 72)
34 | draw.text(
35 | (25, 615),
36 | f"{title[:20]}...",
37 | fill="black",
38 | font=font2,
39 | )
40 | draw.text(
41 | (27, 543),
42 | f"Playing on {ctitle[:12]}",
43 | fill="black",
44 | font=font,
45 | )
46 | img.save(f"search/final{userid}.png")
47 | os.remove(f"search/temp{userid}.png")
48 | os.remove(f"search/thumb{userid}.png")
49 | final = f"search/final{userid}.png"
50 | return final
51 |
--------------------------------------------------------------------------------
/program/userbot_tools.py:
--------------------------------------------------------------------------------
1 | import asyncio
2 | from driver.veez import user
3 | from pyrogram.types import Message
4 | from pyrogram import Client, filters
5 | from config import BOT_USERNAME, SUDO_USERS
6 | from driver.filters import command, other_filters
7 | from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant
8 | from driver.decorators import authorized_users_only, sudo_users_only
9 |
10 |
11 | @Client.on_message(
12 | command(["userbotjoin", f"نضم", "انضم"]) & other_filters
13 | )
14 | @authorized_users_only
15 | async def join_chat(c: Client, m: Message):
16 | chat_id = m.chat.id
17 | try:
18 | invitelink = await c.export_chat_invite_link(chat_id)
19 | if invitelink.startswith("https://t.me/+"):
20 | invitelink = invitelink.replace(
21 | "https://t.me/+", "https://t.me/joinchat/"
22 | )
23 | await user.join_chat(invitelink)
24 | return await user.send_message(chat_id, "انضممت هنا كما طلبت")
25 | except UserAlreadyParticipant:
26 | return await user.send_message(chat_id, "انا بالفعل موجود هنا 😐")
27 |
28 |
29 | @Client.on_message(
30 | command(["userbotleave", f"غادر", "ادر"]) & other_filters
31 | )
32 | @authorized_users_only
33 | async def leave_chat(_, m: Message):
34 | chat_id = m.chat.id
35 | try:
36 | await user.leave_chat(chat_id)
37 | return await _.send_message(
38 | chat_id,
39 | "✅ غادر الحساب المساعد المجموعه بنجاح",
40 | )
41 | except UserNotParticipant:
42 | return await _.send_message(
43 | chat_id,
44 | "❌ غادر الحساب المساعد المجموعه بالفعل",
45 | )
46 |
47 |
48 | @Client.on_message(command(["leaveall", f"مغادره"]))
49 | @sudo_users_only
50 | async def leave_all(client, message):
51 | if message.from_user.id not in SUDO_USERS:
52 | return
53 |
54 | left = 0
55 | failed = 0
56 |
57 | msg = await message.reply("🔄 Userbot leaving all Group !")
58 | async for dialog in user.iter_dialogs():
59 | try:
60 | await user.leave_chat(dialog.chat.id)
61 | left += 1
62 | await msg.edit(
63 | f"Userbot leaving all Group...\n\nLeft: {left} chats.\nFailed: {failed} chats."
64 | )
65 | except BaseException:
66 | failed += 1
67 | await msg.edit(
68 | f"Userbot leaving...\n\nLeft: {left} chats.\nFailed: {failed} chats."
69 | )
70 | await asyncio.sleep(0.7)
71 | await msg.delete()
72 | await client.send_message(
73 | message.chat.id, f"✅ Left from: {left} chats.\n❌ Failed in: {failed} chats."
74 | )
75 |
76 |
77 | @Client.on_message(filters.left_chat_member)
78 | async def ubot_leave(c: Client, m: Message):
79 | # ass_id = (await user.get_me()).id
80 | bot_id = (await c.get_me()).id
81 | chat_id = m.chat.id
82 | left_member = m.left_chat_member
83 | if left_member.id == bot_id:
84 | await user.leave_chat(chat_id)
85 | # elif left_member.id == ass_id:
86 | # await c.leave_chat(chat_id)
87 |
--------------------------------------------------------------------------------
/program/updater.py:
--------------------------------------------------------------------------------
1 | import os
2 | import re
3 | import sys
4 | import asyncio
5 | import subprocess
6 | from asyncio import sleep
7 |
8 | from git import Repo
9 | from pyrogram.types import Message
10 | from driver.filters import command
11 | from pyrogram import Client, filters
12 | from os import system, execle, environ
13 | from driver.decorators import sudo_users_only
14 | from git.exc import InvalidGitRepositoryError
15 | from config import UPSTREAM_REPO, BOT_USERNAME
16 |
17 |
18 |
19 | def gen_chlog(repo, diff):
20 | upstream_repo_url = Repo().remotes[0].config_reader.get("url").replace(".git", "")
21 | ac_br = repo.active_branch.name
22 | ch_log = tldr_log = ""
23 | ch = f"updates for [{ac_br}]:"
24 | ch_tl = f"updates for {ac_br}:"
25 | d_form = "%d/%m/%y || %H:%M"
26 | for c in repo.iter_commits(diff):
27 | ch_log += (
28 | f"\n\n💬 {c.count()} 🗓 [{c.committed_datetime.strftime(d_form)}]\n"
29 | f"[{c.summary}] 👨💻 {c.author}"
30 | )
31 | tldr_log += f"\n\n💬 {c.count()} 🗓 [{c.committed_datetime.strftime(d_form)}]\n[{c.summary}] 👨💻 {c.author}"
32 | if ch_log:
33 | return str(ch + ch_log), str(ch_tl + tldr_log)
34 | return ch_log, tldr_log
35 |
36 |
37 | def updater():
38 | try:
39 | repo = Repo()
40 | except InvalidGitRepositoryError:
41 | repo = Repo.init()
42 | origin = repo.create_remote("upstream", "UPSTREAM_REPO")
43 | origin.fetch()
44 | repo.create_head("main", origin.refs.main)
45 | repo.heads.main.set_tracking_branch(origin.refs.main)
46 | repo.heads.main.checkout(True)
47 | ac_br = repo.active_branch.name
48 | if "upstream" in repo.remotes:
49 | ups_rem = repo.remote("upstream")
50 | else:
51 | ups_rem = repo.create_remote("upstream", "UPSTREAM_REPO")
52 | ups_rem.fetch(ac_br)
53 | changelog, tl_chnglog = gen_chlog(repo, f"HEAD..upstream/{ac_br}")
54 | return bool(changelog)
55 |
56 |
57 | @Client.on_message(command(["update", f"update@{BOT_USERNAME}"]) & ~filters.edited)
58 | @sudo_users_only
59 | async def update_repo(_, message: Message):
60 | chat_id = message.chat.id
61 | msg = await message.reply("🔄 `processing update...`")
62 | update_avail = updater()
63 | if update_avail:
64 | await msg.edit("✅ update finished\n\n• bot restarted, back active again in 1 minutes.")
65 | system("git pull -f && pip3 install --no-cache-dir -r requirements.txt")
66 | execle(sys.executable, sys.executable, "main.py", environ)
67 | return
68 | await msg.edit(f"bot is **up-to-date** with [main](https://github.com/USDDBOT/Shadow/tree/main)", disable_web_page_preview=True)
69 |
70 |
71 | @Client.on_message(command(["restart", f"restart@{BOT_USERNAME}"]) & ~filters.edited)
72 | @sudo_users_only
73 | async def restart_bot(_, message: Message):
74 | msg = await message.reply("`restarting bot...`")
75 | args = [sys.executable, "main.py"]
76 | await msg.edit("✅ bot restarted\n\n• now you can use this bot again.")
77 | execle(sys.executable, *args, environ)
78 | return
79 |
--------------------------------------------------------------------------------
/driver/design/chatname.py:
--------------------------------------------------------------------------------
1 | async def CHAT_TITLE(ctitle):
2 | string = ctitle
3 | font1 = list("𝔄𝔅ℭ𝔇𝔈𝔉𝔊ℌℑ𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔ℜ𝔖𝔗𝔘𝔙𝔚𝔛𝔜ℨ")
4 | font2 = list("𝕬𝕭𝕮𝕯𝕰𝕱𝕲𝕳𝕴𝕵𝕶𝕷𝕸𝕹𝕺𝕻𝕼𝕽𝕾𝕿𝖀𝖁𝖂𝖃𝖄𝖅")
5 | font3 = list("𝓐𝓑𝓒𝓓𝓔𝓕𝓖𝓗𝓘𝓙𝓚𝓛𝓜𝓝𝓞𝓟𝓠𝓡𝓢𝓣𝓤𝓥𝓦𝓧𝓨𝓩")
6 | font4 = list("𝒜𝐵𝒞𝒟𝐸𝐹𝒢𝐻𝐼𝒥𝒦𝐿𝑀𝒩𝒪𝒫𝒬𝑅𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵")
7 | font5 = list("𝔸𝔹ℂ𝔻𝔼𝔽𝔾ℍ𝕀𝕁𝕂𝕃𝕄ℕ𝕆ℙℚℝ𝕊𝕋𝕌𝕍𝕎𝕏𝕐ℤ")
8 | font6 = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
9 | font26 = list("𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙")
10 | font27 = list("𝗔𝗕𝗖𝗗𝗘𝗙𝗚𝗛𝗜𝗝𝗞𝗟𝗠𝗡𝗢𝗣𝗤𝗥𝗦𝗧𝗨𝗩𝗪𝗫𝗬𝗭")
11 | font28 = list("𝘈𝘉𝘊𝘋𝘌𝘍𝘎𝘏𝘐𝘑𝘒𝘓𝘔𝘕𝘖𝘗𝘘𝘙𝘚𝘛𝘜𝘝𝘞𝘟𝘠𝘡")
12 | font29 = list("𝘼𝘽𝘾𝘿𝙀𝙁𝙂𝙃𝙄𝙅𝙆𝙇𝙈𝙉𝙊𝙋𝙌𝙍𝙎𝙏𝙐𝙑𝙒𝙓𝙔𝙕")
13 | font30 = list("𝙰𝙱𝙲𝙳𝙴𝙵𝙶𝙷𝙸𝙹𝙺𝙻𝙼𝙽𝙾𝙿𝚀𝚁𝚂𝚃𝚄𝚅𝚆𝚇𝚈𝚉")
14 | font1L = list("𝔞𝔟𝔠𝔡𝔢𝔣𝔤𝔥𝔦𝔧𝔨𝔩𝔪𝔫𝔬𝔭𝔮𝔯𝔰𝔱𝔲𝔳𝔴𝔵𝔶𝔷")
15 | font2L = list("𝖆𝖇𝖈𝖉𝖊𝖋𝖌𝖍𝖎𝖏𝖐𝖑𝖒𝖓𝖔𝖕𝖖𝖗𝖘𝖙𝖚𝖛𝖜𝖝𝖞𝖟")
16 | font3L = list("𝓪𝓫𝓬𝓭𝓮𝓯𝓰𝓱𝓲𝓳𝓴𝓵𝓶𝓷𝓸𝓹𝓺𝓻𝓼𝓽𝓾𝓿𝔀𝔁𝔂𝔃")
17 | font4L = list("𝒶𝒷𝒸𝒹𝑒𝒻𝑔𝒽𝒾𝒿𝓀𝓁𝓂𝓃𝑜𝓅𝓆𝓇𝓈𝓉𝓊𝓋𝓌𝓍𝓎𝓏")
18 | font5L = list("𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫")
19 | font6L = list("abcdefghijklmnopqrstuvwxyz")
20 | font27L = list("𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳")
21 | font28L = list("𝗮𝗯𝗰𝗱𝗲𝗳𝗴𝗵𝗶𝗷𝗸𝗹𝗺𝗻𝗼𝗽𝗾𝗿𝘀𝘁𝘂𝘃𝘄𝘅𝘆𝘇")
22 | font29L = list("𝘢𝘣𝘤𝘥𝘦𝘧𝘨𝘩𝘪𝘫𝘬𝘭𝘮𝘯𝘰𝘱𝘲𝘳𝘴𝘵𝘶𝘷𝘸𝘹𝘺𝘻")
23 | font30L = list("𝙖𝙗𝙘𝙙𝙚𝙛𝙜𝙝𝙞𝙟𝙠𝙡𝙢𝙣𝙤𝙥𝙦𝙧𝙨𝙩𝙪𝙫𝙬𝙭𝙮𝙯")
24 | font31L = list("𝚊𝚋𝚌𝚍𝚎𝚏𝚐𝚑𝚒𝚓𝚔𝚕𝚖𝚗𝚘𝚙𝚚𝚛𝚜𝚝𝚞𝚟𝚠𝚡𝚢𝚣")
25 | normal = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
26 | normalL = list("abcdefghijklmnopqrstuvwxyz")
27 | cout = 0
28 | for XCB in font1:
29 | string = string.replace(font1[cout], normal[cout])
30 | string = string.replace(font2[cout], normal[cout])
31 | string = string.replace(font3[cout], normal[cout])
32 | string = string.replace(font4[cout], normal[cout])
33 | string = string.replace(font5[cout], normal[cout])
34 | string = string.replace(font6[cout], normal[cout])
35 | string = string.replace(font26[cout], normal[cout])
36 | string = string.replace(font27[cout], normal[cout])
37 | string = string.replace(font28[cout], normal[cout])
38 | string = string.replace(font29[cout], normal[cout])
39 | string = string.replace(font30[cout], normal[cout])
40 | string = string.replace(font1L[cout], normalL[cout])
41 | string = string.replace(font2L[cout], normalL[cout])
42 | string = string.replace(font3L[cout], normalL[cout])
43 | string = string.replace(font4L[cout], normalL[cout])
44 | string = string.replace(font5L[cout], normalL[cout])
45 | string = string.replace(font6L[cout], normalL[cout])
46 | string = string.replace(font27L[cout], normalL[cout])
47 | string = string.replace(font28L[cout], normalL[cout])
48 | string = string.replace(font29L[cout], normalL[cout])
49 | string = string.replace(font30L[cout], normalL[cout])
50 | string = string.replace(font31L[cout], normalL[cout])
51 | cout += 1
52 | return string
53 |
--------------------------------------------------------------------------------
/program/extra.py:
--------------------------------------------------------------------------------
1 | """ broadcast & statistic collector """
2 |
3 | import asyncio
4 | from pyrogram import Client, filters
5 | from pyrogram.types import Message
6 | from driver.filters import command
7 | from driver.decorators import sudo_users_only
8 | from driver.database.dbchat import get_served_chats
9 |
10 | from config import BOT_USERNAME as bn
11 |
12 |
13 | @Client.on_message(command(["اذاعه"]) & ~filters.edited)
14 | @sudo_users_only
15 | async def broadcast(c: Client, message: Message):
16 | if not message.reply_to_message:
17 | pass
18 | else:
19 | x = message.reply_to_message.message_id
20 | y = message.chat.id
21 | sent = 0
22 | chats = []
23 | schats = await get_served_chats()
24 | for chat in schats:
25 | chats.append(int(chat["chat_id"]))
26 | for i in chats:
27 | try:
28 | m = await c.forward_messages(i, y, x)
29 | await asyncio.sleep(0.3)
30 | sent += 1
31 | except Exception:
32 | pass
33 | await message.reply_text(f"✅ تمت الاذاعه إلى {sent} جروب في البوت.")
34 | return
35 | if len(message.command) < 2:
36 | await message.reply_text(
37 | "**مثال**:\n\n/اذاعه (`رسالتك`) او (`الرد على رساله`)"
38 | )
39 | return
40 | text = message.text.split(None, 1)[1]
41 | sent = 0
42 | chats = []
43 | schats = await get_served_chats()
44 | for chat in schats:
45 | chats.append(int(chat["chat_id"]))
46 | for i in chats:
47 | try:
48 | m = await c.send_message(i, text=text)
49 | await asyncio.sleep(0.3)
50 | sent += 1
51 | except Exception:
52 | pass
53 | await message.reply_text(f"✅ تمت الاذاعه إلى {sent} جروب في البوت.")
54 |
55 |
56 | @Client.on_message(command(["ذت", f"اذت"]) & ~filters.edited)
57 | @sudo_users_only
58 | async def broadcast_pin(c: Client, message: Message):
59 | if not message.reply_to_message:
60 | pass
61 | else:
62 | x = message.reply_to_message.message_id
63 | y = message.chat.id
64 | sent = 0
65 | pin = 0
66 | chats = []
67 | schats = await get_served_chats()
68 | for chat in schats:
69 | chats.append(int(chat["chat_id"]))
70 | for i in chats:
71 | try:
72 | m = await c.forward_messages(i, y, x)
73 | try:
74 | await m.pin(disable_notification=True)
75 | pin += 1
76 | except Exception:
77 | pass
78 | await asyncio.sleep(0.3)
79 | sent += 1
80 | except Exception:
81 | pass
82 | await message.reply_text(
83 | f"✅ تم تثبيت الرساله في {sent} جروب في البوت."
84 | )
85 | return
86 | if len(message.command) < 2:
87 | await message.reply_text(
88 | "**مثال**:\n\n/اذاعه بالتثبيت (`رسالتك`) او (`الرد على رساله`)"
89 | )
90 | return
91 | text = message.text.split(None, 1)[1]
92 | sent = 0
93 | pin = 0
94 | chats = []
95 | schats = await get_served_chats()
96 | for chat in schats:
97 | chats.append(int(chat["chat_id"]))
98 | for i in chats:
99 | try:
100 | m = await c.send_message(i, text=text)
101 | try:
102 | await m.pin(disable_notification=True)
103 | pin += 1
104 | except Exception:
105 | pass
106 | await asyncio.sleep(0.3)
107 | sent += 1
108 | except Exception:
109 | pass
110 | await message.reply_text(
111 | f"✅ تم تثبيت الرساله في {sent} جروب في البوت."
112 | )
113 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Video x Music Stream Bot",
3 | "description": "Telegram bot for Streaming Video & Music trought the Telegram Group Video Chat, powered by PyTgCalls and Pyrogram",
4 | "logo": "https://telegra.ph/file/18b88af791e36bf3c4259.jpg",
5 | "keywords": [
6 | "py-tgcalls",
7 | "telegram bot",
8 | "video stream",
9 | "live stream",
10 | "music stream",
11 | "mongodb",
12 | "pyrogram"
13 | ],
14 | "website": "https://t.me/FA9SH",
15 | "repository": "https://github.com/USDDBOOT/Shadow",
16 | "success_url": "https://t.me/KB_Shadow",
17 | "env": {
18 | "API_ID": {
19 | "description": "قم بوضع الايبي ايدي هنا",
20 | "required": true
21 | },
22 | "API_HASH": {
23 | "description": "قم بوضع الايبي هاش",
24 | "required": true
25 | },
26 | "BOT_TOKEN": {
27 | "description": "قم بوضع توكن البوت الخاص بك هنا",
28 | "required": true
29 | },
30 | "BOT_USERNAME": {
31 | "description": "قم بوضع يوزر بوتك بدون علامة @",
32 | "required": true,
33 | "value": "USDDBOT"
34 | },
35 | "ASSISTANT_NAME": {
36 | "description": "قم بوضع يوزر الحساب المساعد بدون علامة @",
37 | "required": true,
38 | "value": "SHADOW_MUSIC0"
39 | },
40 | "SESSION_NAME": {
41 | "description": "قم بوضع كود تيرمكس هنا",
42 | "required": true
43 | },
44 | "SUDO_USERS": {
45 | "description": "قم بوضع ايدي المطور الاساسي",
46 | "required": true,
47 | "value": "1970797144"
48 | },
49 | "GROUP_SUPPORT": {
50 | "description": "ضع هنا يوزر جروبك بدون علامة @",
51 | "required": true,
52 | "value": "S150D"
53 | },
54 | "UPDATES_CHANNEL": {
55 | "description": "ضع هنا يوزر قناتك بدون علامة @",
56 | "required": true,
57 | "value": "FA9SH"
58 | },
59 | "OWNER_NAME": {
60 | "description": "ضع هنا يوزر المطور بدون علامة @",
61 | "required": true,
62 | "value": "KB_Shadow"
63 | },
64 | "BOT_PHOTO": {
65 | "description": "ضع لينك صورة البوت من هنا @T_ELEGRAPH00BOT",
66 | "required": true
67 | },
68 | "DEV_PHOTO": {
69 | "description": "ضع لينك صورة حساب مطور البوت من هنا @T_ELEGRAPH00BOT",
70 | "required": true
71 | },
72 | "DEV_NAME": {
73 | "description": "ضع اسم حساب التليجرام الخاص بالمطور",
74 | "required": true
75 | },
76 | "ALIVE_NAME": {
77 | "description": "ضع هنا اسم الحساب المساعد",
78 | "required": true,
79 | "value": "𝑺𝑯𝑨𝑫𝑶𝑾 𝑴𝑼𝑺𝑰𝑪"
80 | },
81 | "MONGODB_URL": {
82 | "description": "لا تغيره!",
83 | "required": true,
84 | "value": "mongodb://mongo:DZ2AUmIS4Gm7UzzAwy6u@containers-us-west-34.railway.app:7933"
85 | },
86 | "UPSTREAM_REPO": {
87 | "description": "اتركه كما هوا",
88 | "required": true,
89 | "value": "https://github.com/USDDBOOT/Shadow"
90 | }
91 | },
92 | "addons": [],
93 | "buildpacks": [
94 | {
95 | "url": "heroku/python"
96 | },
97 | {
98 | "url": "heroku/nodejs"
99 | },
100 | {
101 | "url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git"
102 | }
103 | ],
104 | "formation": {
105 | "worker": {
106 | "quantity": 1,
107 | "size": "free"
108 | }
109 | },
110 | "stack": "container"
111 | }
112 |
--------------------------------------------------------------------------------
/driver/utils.py:
--------------------------------------------------------------------------------
1 | import asyncio
2 |
3 | from driver.queues import QUEUE, clear_queue, get_queue, pop_an_item
4 | from driver.veez import bot, call_py
5 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
6 | from pytgcalls.types import Update
7 | from pytgcalls.types.input_stream import AudioPiped, AudioVideoPiped
8 | from pytgcalls.types.input_stream.quality import (
9 | HighQualityAudio,
10 | HighQualityVideo,
11 | LowQualityVideo,
12 | MediumQualityVideo,
13 | )
14 | from pytgcalls.types.stream import StreamAudioEnded
15 |
16 |
17 | keyboard = InlineKeyboardMarkup(
18 | [
19 | [
20 | InlineKeyboardButton(text="• الـقـائـمـه♪", callback_data="cbmenu"),
21 | InlineKeyboardButton("• الـتـحـديـثـات♪",url=f"https://t.me/FA9SH"),
22 | ],
23 | [
24 | InlineKeyboardButton(
25 | "♡اضـف الـبـوت لـمـجـمـوعـتـك♡",
26 | url=f"https://t.me/USDDBOT?startgroup=true"
27 | )
28 | ],
29 | ]
30 | )
31 |
32 |
33 | async def skip_current_song(chat_id):
34 | if chat_id in QUEUE:
35 | chat_queue = get_queue(chat_id)
36 | if len(chat_queue) == 1:
37 | await call_py.leave_group_call(chat_id)
38 | clear_queue(chat_id)
39 | return 1
40 | else:
41 | try:
42 | songname = chat_queue[1][0]
43 | url = chat_queue[1][1]
44 | link = chat_queue[1][2]
45 | type = chat_queue[1][3]
46 | Q = chat_queue[1][4]
47 | if type == "Audio":
48 | await call_py.change_stream(
49 | chat_id,
50 | AudioPiped(
51 | url,
52 | HighQualityAudio(),
53 | ),
54 | )
55 | elif type == "Video":
56 | if Q == 720:
57 | hm = HighQualityVideo()
58 | elif Q == 480:
59 | hm = MediumQualityVideo()
60 | elif Q == 360:
61 | hm = LowQualityVideo()
62 | await call_py.change_stream(
63 | chat_id,
64 | AudioVideoPiped(
65 | url,
66 | HighQualityAudio(),
67 | hm
68 | )
69 | )
70 | pop_an_item(chat_id)
71 | return [songname, link, type]
72 | except:
73 | await call_py.leave_group_call(chat_id)
74 | clear_queue(chat_id)
75 | return 2
76 | else:
77 | return 0
78 |
79 |
80 | async def skip_item(chat_id, h):
81 | if chat_id in QUEUE:
82 | chat_queue = get_queue(chat_id)
83 | try:
84 | x = int(h)
85 | songname = chat_queue[x][0]
86 | chat_queue.pop(x)
87 | return songname
88 | except Exception as e:
89 | print(e)
90 | return 0
91 | else:
92 | return 0
93 |
94 |
95 | @call_py.on_kicked()
96 | async def kicked_handler(_, chat_id: int):
97 | if chat_id in QUEUE:
98 | clear_queue(chat_id)
99 |
100 |
101 | @call_py.on_closed_voice_chat()
102 | async def closed_voice_chat_handler(_, chat_id: int):
103 | if chat_id in QUEUE:
104 | clear_queue(chat_id)
105 |
106 |
107 | @call_py.on_left()
108 | async def left_handler(_, chat_id: int):
109 | if chat_id in QUEUE:
110 | clear_queue(chat_id)
111 |
112 |
113 | @call_py.on_stream_end()
114 | async def stream_end_handler(_, u: Update):
115 | if isinstance(u, StreamAudioEnded):
116 | chat_id = u.chat_id
117 | print(chat_id)
118 | op = await skip_current_song(chat_id)
119 | if op == 1:
120 | pass
121 | elif op == 2:
122 | await bot.send_message(
123 | chat_id,
124 | "❌ an error occurred\n\n» **Clearing** __Queues__ and leaving video chat.",
125 | )
126 | else:
127 | await bot.send_message(
128 | chat_id,
129 | f"💡 **تم التخطي الئ المسار التالي**\n\n🗂 **الاسم:** [{op[0]}]({op[1]}) | `{op[2]}`\n💭 **المجموعه:** `{chat_id}`",
130 | disable_web_page_preview=True,
131 | reply_markup=keyboard,
132 | )
133 | else:
134 | pass
135 |
136 |
137 | async def bash(cmd):
138 | process = await asyncio.create_subprocess_shell(
139 | cmd,
140 | stdout=asyncio.subprocess.PIPE,
141 | stderr=asyncio.subprocess.PIPE,
142 | )
143 | stdout, stderr = await process.communicate()
144 | err = stderr.decode().strip()
145 | out = stdout.decode().strip()
146 | return out, err
147 |
--------------------------------------------------------------------------------
/program/downloader.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2021 By Amor Music-Project
2 |
3 | from __future__ import unicode_literals
4 |
5 | import asyncio
6 | import math
7 | import os
8 | import time
9 | from random import randint
10 | from urllib.parse import urlparse
11 |
12 | import aiofiles
13 | import aiohttp
14 | import requests
15 | import wget
16 | import yt_dlp
17 | from pyrogram import Client, filters
18 | from pyrogram.errors import FloodWait, MessageNotModified
19 | from pyrogram.types import Message
20 | from youtube_search import YoutubeSearch
21 | from yt_dlp import YoutubeDL
22 |
23 | from config import BOT_USERNAME as bn
24 | from driver.decorators import humanbytes
25 | from driver.filters import command, other_filters
26 |
27 |
28 | ydl_opts = {
29 | 'format': 'best',
30 | 'keepvideo': True,
31 | 'prefer_ffmpeg': False,
32 | 'geo_bypass': True,
33 | 'outtmpl': '%(title)s.%(ext)s',
34 | 'quite': True
35 | }
36 |
37 |
38 | @Client.on_message(command(["حميل", f"تحميل", "song"]) & ~filters.edited)
39 | def song(_, message):
40 | query = " ".join(message.command[1:])
41 | m = message.reply("🔎 جاري البحث انتظر قليلآ...")
42 | ydl_ops = {"format": "bestaudio[ext=m4a]"}
43 | try:
44 | results = YoutubeSearch(query, max_results=1).to_dict()
45 | link = f"https://youtube.com{results[0]['url_suffix']}"
46 | title = results[0]["title"][:40]
47 | thumbnail = results[0]["thumbnails"][0]
48 | thumb_name = f"{title}.jpg"
49 | thumb = requests.get(thumbnail, allow_redirects=True)
50 | open(thumb_name, "wb").write(thumb.content)
51 | duration = results[0]["duration"]
52 |
53 | except Exception as e:
54 | m.edit("❌ لم يتم العثور على الاغنية\n\nيرجى إعطاء اسم أغنية صالح")
55 | print(str(e))
56 | return
57 | m.edit("📥 جاري تحميل الملف...")
58 | try:
59 | with yt_dlp.YoutubeDL(ydl_ops) as ydl:
60 | info_dict = ydl.extract_info(link, download=False)
61 | audio_file = ydl.prepare_filename(info_dict)
62 | ydl.process_info(info_dict)
63 | rep = f"**🎧 الرافع @{bn}**"
64 | secmul, dur, dur_arr = 1, 0, duration.split(":")
65 | for i in range(len(dur_arr) - 1, -1, -1):
66 | dur += int(float(dur_arr[i])) * secmul
67 | secmul *= 60
68 | m.edit("📤 جاري تحميل الملف...")
69 | message.reply_audio(
70 | audio_file,
71 | caption=rep,
72 | thumb=thumb_name,
73 | parse_mode="md",
74 | title=title,
75 | duration=dur,
76 | )
77 | m.delete()
78 | except Exception as e:
79 | m.edit("❌ خطأ")
80 | print(e)
81 |
82 | try:
83 | os.remove(audio_file)
84 | os.remove(thumb_name)
85 | except Exception as e:
86 | print(e)
87 |
88 |
89 | @Client.on_message(
90 | command(["vsong", f"vsong@{bn}", "video", f"فيديو"]) & ~filters.edited
91 | )
92 | async def vsong(client, message):
93 | ydl_opts = {
94 | "format": "best",
95 | "keepvideo": True,
96 | "prefer_ffmpeg": False,
97 | "geo_bypass": True,
98 | "outtmpl": "%(title)s.%(ext)s",
99 | "quite": True,
100 | }
101 | query = " ".join(message.command[1:])
102 | try:
103 | results = YoutubeSearch(query, max_results=1).to_dict()
104 | link = f"https://youtube.com{results[0]['url_suffix']}"
105 | title = results[0]["title"][:40]
106 | thumbnail = results[0]["thumbnails"][0]
107 | thumb_name = f"{title}.jpg"
108 | thumb = requests.get(thumbnail, allow_redirects=True)
109 | open(thumb_name, "wb").write(thumb.content)
110 | results[0]["duration"]
111 | results[0]["url_suffix"]
112 | results[0]["views"]
113 | message.from_user.mention
114 | except Exception as e:
115 | print(e)
116 | try:
117 | msg = await message.reply("📥 **جاري تحميل الفيديو...**")
118 | with YoutubeDL(ydl_opts) as ytdl:
119 | ytdl_data = ytdl.extract_info(link, download=True)
120 | file_name = ytdl.prepare_filename(ytdl_data)
121 | except Exception as e:
122 | return await msg.edit(f"🚫 **خطأ:** {e}")
123 | preview = wget.download(thumbnail)
124 | await msg.edit("📤 **جاري تحميل الفيديو...**")
125 | await message.reply_video(
126 | file_name,
127 | duration=int(ytdl_data["duration"]),
128 | thumb=preview,
129 | caption=ytdl_data["title"],
130 | )
131 | try:
132 | os.remove(file_name)
133 | await msg.delete()
134 | except Exception as e:
135 | print(e)
136 |
137 |
138 | @Client.on_message(command(["lyric", f"بحث"]))
139 | async def lyrics(_, message):
140 | try:
141 | if len(message.command) < 2:
142 | await message.reply_text("» **قم باارسال اسم المقطع**")
143 | return
144 | query = message.text.split(None, 1)[1]
145 | rep = await message.reply_text("🔎 **جاري البحث عن كلمات...**")
146 | resp = requests.get(
147 | f"https://api-tede.herokuapp.com/api/lirik?l={query}"
148 | ).json()
149 | result = f"{resp['data']}"
150 | await rep.edit(result)
151 | except Exception:
152 | await rep.edit("❌ **لم يتم العثور على نتائج كلمات غنائية**\n\n» **يرجى إعطاء اسم أغنية صالح**")
153 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We as members, contributors, and leaders pledge to make participation in our
6 | community a harassment-free experience for everyone, regardless of age, body
7 | size, visible or invisible disability, ethnicity, sex characteristics, gender
8 | identity and expression, level of experience, education, socio-economic status,
9 | nationality, personal appearance, race, religion, or sexual identity
10 | and orientation.
11 |
12 | We pledge to act and interact in ways that contribute to an open, welcoming,
13 | diverse, inclusive, and healthy community.
14 |
15 | ## Our Standards
16 |
17 | Examples of behavior that contributes to a positive environment for our
18 | community include:
19 |
20 | * Demonstrating empathy and kindness toward other people
21 | * Being respectful of differing opinions, viewpoints, and experiences
22 | * Giving and gracefully accepting constructive feedback
23 | * Accepting responsibility and apologizing to those affected by our mistakes,
24 | and learning from the experience
25 | * Focusing on what is best not just for us as individuals, but for the
26 | overall community
27 |
28 | Examples of unacceptable behavior include:
29 |
30 | * The use of sexualized language or imagery, and sexual attention or
31 | advances of any kind
32 | * Trolling, insulting or derogatory comments, and personal or political attacks
33 | * Public or private harassment
34 | * Publishing others' private information, such as a physical or email
35 | address, without their explicit permission
36 | * Other conduct which could reasonably be considered inappropriate in a
37 | professional setting
38 |
39 | ## Enforcement Responsibilities
40 |
41 | Community leaders are responsible for clarifying and enforcing our standards of
42 | acceptable behavior and will take appropriate and fair corrective action in
43 | response to any behavior that they deem inappropriate, threatening, offensive,
44 | or harmful.
45 |
46 | Community leaders have the right and responsibility to remove, edit, or reject
47 | comments, commits, code, wiki edits, issues, and other contributions that are
48 | not aligned to this Code of Conduct, and will communicate reasons for moderation
49 | decisions when appropriate.
50 |
51 | ## Scope
52 |
53 | This Code of Conduct applies within all community spaces, and also applies when
54 | an individual is officially representing the community in public spaces.
55 | Examples of representing our community include using an official e-mail address,
56 | posting via an official social media account, or acting as an appointed
57 | representative at an online or offline event.
58 |
59 | ## Enforcement
60 |
61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
62 | reported to the community leaders responsible for enforcement at
63 | TELEGRAM.
64 | All complaints will be reviewed and investigated promptly and fairly.
65 |
66 | All community leaders are obligated to respect the privacy and security of the
67 | reporter of any incident.
68 |
69 | ## Enforcement Guidelines
70 |
71 | Community leaders will follow these Community Impact Guidelines in determining
72 | the consequences for any action they deem in violation of this Code of Conduct:
73 |
74 | ### 1. Correction
75 |
76 | **Community Impact**: Use of inappropriate language or other behavior deemed
77 | unprofessional or unwelcome in the community.
78 |
79 | **Consequence**: A private, written warning from community leaders, providing
80 | clarity around the nature of the violation and an explanation of why the
81 | behavior was inappropriate. A public apology may be requested.
82 |
83 | ### 2. Warning
84 |
85 | **Community Impact**: A violation through a single incident or series
86 | of actions.
87 |
88 | **Consequence**: A warning with consequences for continued behavior. No
89 | interaction with the people involved, including unsolicited interaction with
90 | those enforcing the Code of Conduct, for a specified period of time. This
91 | includes avoiding interactions in community spaces as well as external channels
92 | like social media. Violating these terms may lead to a temporary or
93 | permanent ban.
94 |
95 | ### 3. Temporary Ban
96 |
97 | **Community Impact**: A serious violation of community standards, including
98 | sustained inappropriate behavior.
99 |
100 | **Consequence**: A temporary ban from any sort of interaction or public
101 | communication with the community for a specified period of time. No public or
102 | private interaction with the people involved, including unsolicited interaction
103 | with those enforcing the Code of Conduct, is allowed during this period.
104 | Violating these terms may lead to a permanent ban.
105 |
106 | ### 4. Permanent Ban
107 |
108 | **Community Impact**: Demonstrating a pattern of violation of community
109 | standards, including sustained inappropriate behavior, harassment of an
110 | individual, or aggression toward or disparagement of classes of individuals.
111 |
112 | **Consequence**: A permanent ban from any sort of public interaction within
113 | the community.
114 |
115 | ## Attribution
116 |
117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118 | version 2.0, available at
119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120 |
121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct
122 | enforcement ladder](https://github.com/XxshadowxX0/musicano).
123 |
124 | [homepage]: https://www.contributor-covenant.org
125 |
126 | For answers to common questions about this code of conduct, see the FAQ at
127 | https://www.contributor-covenant.org/faq. Translations are available at
128 | https://www.contributor-covenant.org/translations.
129 |
--------------------------------------------------------------------------------
/program/developer.py:
--------------------------------------------------------------------------------
1 | import os
2 | import re
3 | import sys
4 | import shutil
5 | import subprocess
6 | import traceback
7 |
8 | from time import time
9 | from io import StringIO
10 | from sys import version as pyver
11 | from inspect import getfullargspec
12 |
13 | from config import BOT_USERNAME as bname
14 | from driver.veez import bot
15 | from driver.filters import command
16 | from pyrogram import Client, filters
17 | from driver.decorators import sudo_users_only, errors
18 | from pyrogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup
19 |
20 |
21 | async def aexec(code, client, message):
22 | exec(
23 | "async def __aexec(client, message): "
24 | + "".join(f"\n {a}" for a in code.split("\n"))
25 | )
26 | return await locals()["__aexec"](client, message)
27 |
28 | async def edit_or_reply(msg: Message, **kwargs):
29 | func = msg.edit_text if msg.from_user.is_self else msg.reply
30 | spec = getfullargspec(func.__wrapped__).args
31 | await func(**{k: v for k, v in kwargs.items() if k in spec})
32 |
33 |
34 | @Client.on_message(command(["eval", f"eval{bname}"]) & ~filters.edited)
35 | @sudo_users_only
36 | async def executor(client, message):
37 | if len(message.command) < 2:
38 | return await edit_or_reply(message, text="» Give a command to execute")
39 | try:
40 | cmd = message.text.split(" ", maxsplit=1)[1]
41 | except IndexError:
42 | return await message.delete()
43 | t1 = time()
44 | old_stderr = sys.stderr
45 | old_stdout = sys.stdout
46 | redirected_output = sys.stdout = StringIO()
47 | redirected_error = sys.stderr = StringIO()
48 | stdout, stderr, exc = None, None, None
49 | try:
50 | await aexec(cmd, client, message)
51 | except Exception:
52 | exc = traceback.format_exc()
53 | stdout = redirected_output.getvalue()
54 | stderr = redirected_error.getvalue()
55 | sys.stdout = old_stdout
56 | sys.stderr = old_stderr
57 | evaluation = ""
58 | if exc:
59 | evaluation = exc
60 | elif stderr:
61 | evaluation = stderr
62 | elif stdout:
63 | evaluation = stdout
64 | else:
65 | evaluation = "SUCCESS"
66 | final_output = f"`OUTPUT:`\n\n```{evaluation.strip()}```"
67 | if len(final_output) > 4096:
68 | filename = "output.txt"
69 | with open(filename, "w+", encoding="utf8") as out_file:
70 | out_file.write(str(evaluation.strip()))
71 | t2 = time()
72 | keyboard = InlineKeyboardMarkup(
73 | [
74 | [
75 | InlineKeyboardButton(
76 | text="⏳", callback_data=f"runtime {t2-t1} Seconds"
77 | )
78 | ]
79 | ]
80 | )
81 | await message.reply_document(
82 | document=filename,
83 | caption=f"`INPUT:`\n`{cmd[0:980]}`\n\n`OUTPUT:`\n`attached document`",
84 | quote=False,
85 | reply_markup=keyboard,
86 | )
87 | await message.delete()
88 | os.remove(filename)
89 | else:
90 | t2 = time()
91 | keyboard = InlineKeyboardMarkup(
92 | [
93 | [
94 | InlineKeyboardButton(
95 | text="⏳",
96 | callback_data=f"runtime {round(t2-t1, 3)} Seconds",
97 | )
98 | ]
99 | ]
100 | )
101 | await edit_or_reply(message, text=final_output, reply_markup=keyboard)
102 |
103 |
104 | @Client.on_callback_query(filters.regex(r"runtime"))
105 | async def runtime_func_cq(_, cq):
106 | runtime = cq.data.split(None, 1)[1]
107 | await cq.answer(runtime, show_alert=True)
108 |
109 |
110 | @Client.on_message(command(["sh", f"sh{bname}"]) & ~filters.edited)
111 | @sudo_users_only
112 | async def shellrunner(client, message):
113 | if len(message.command) < 2:
114 | return await edit_or_reply(message, text="**usage:**\n\n» /sh git pull")
115 | text = message.text.split(None, 1)[1]
116 | if "\n" in text:
117 | code = text.split("\n")
118 | output = ""
119 | for x in code:
120 | shell = re.split(""" (?=(?:[^'"]|'[^']*'|"[^"]*")*$)""", x)
121 | try:
122 | process = subprocess.Popen(
123 | shell,
124 | stdout=subprocess.PIPE,
125 | stderr=subprocess.PIPE,
126 | )
127 | except Exception as err:
128 | print(err)
129 | await edit_or_reply(message, text=f"`ERROR:`\n```{err}```")
130 | output += f"**{code}**\n"
131 | output += process.stdout.read()[:-1].decode("utf-8")
132 | output += "\n"
133 | else:
134 | shell = re.split(""" (?=(?:[^'"]|'[^']*'|"[^"]*")*$)""", text)
135 | for a in range(len(shell)):
136 | shell[a] = shell[a].replace('"', "")
137 | try:
138 | process = subprocess.Popen(
139 | shell,
140 | stdout=subprocess.PIPE,
141 | stderr=subprocess.PIPE,
142 | )
143 | except Exception as err:
144 | print(err)
145 | exc_type, exc_obj, exc_tb = sys.exc_info()
146 | errors = traceback.format_exception(
147 | etype=exc_type,
148 | value=exc_obj,
149 | tb=exc_tb,
150 | )
151 | return await edit_or_reply(
152 | message, text=f"`ERROR:`\n```{''.join(errors)}```"
153 | )
154 | output = process.stdout.read()[:-1].decode("utf-8")
155 | if str(output) == "\n":
156 | output = None
157 | if output:
158 | if len(output) > 4096:
159 | with open("output.txt", "w+") as file:
160 | file.write(output)
161 | await bot.send_document(
162 | message.chat.id,
163 | "output.txt",
164 | reply_to_message_id=message.message_id,
165 | caption="`OUTPUT`",
166 | )
167 | return os.remove("output.txt")
168 | await edit_or_reply(message, text=f"`OUTPUT:`\n```{output}```")
169 | else:
170 | await edit_or_reply(message, text="`OUTPUT:`\n`no output`")
171 |
172 |
173 | @Client.on_message(command(["leavebot", f"خروج"]) & ~filters.edited)
174 | @sudo_users_only
175 | async def bot_leave_group(_, message):
176 | if len(message.command) != 2:
177 | await message.reply_text(
178 | "**usage:**\n\n» /leavebot [chat id]"
179 | )
180 | return
181 | chat = message.text.split(None, 2)[1]
182 | try:
183 | await bot.leave_chat(chat)
184 | except Exception as e:
185 | await message.reply_text(f"❌ procces failed\n\nreason: `{e}`")
186 | print(e)
187 | return
188 | await message.reply_text(f"✅ Bot successfully left from the Group:\n\n💭 » `{chat}`")
189 |
--------------------------------------------------------------------------------
/program/callback.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 By Shadow
2 |
3 | from driver.queues import QUEUE
4 | from pyrogram import Client, filters
5 | from program.utils.inline import menu_markup
6 | from pyrogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup
7 | from config import (
8 | BOT_PHOTO,
9 | ASSISTANT_NAME,
10 | BOT_NAME,
11 | BOT_USERNAME,
12 | GROUP_SUPPORT,
13 | OWNER_NAME,
14 | UPDATES_CHANNEL,
15 | )
16 |
17 |
18 | @Client.on_callback_query(filters.regex("cbstart"))
19 | async def cbstart(_, query: CallbackQuery):
20 | await query.answer("الصفحه الرئيسيه")
21 | await query.edit_message_text(
22 | f"""✨ **مرحبا عزيزي »「 [{query.message.chat.first_name}](tg://user?id={query.message.chat.id}) 」!**\n
23 | 💭 **انا بوت استطيع تشغيل الموسيقي والفديو في محادثتك الصوتية**
24 |
25 | 💡 تعلم طريقة تشغيلي واوامر التحكم بي عن طريق » 📚 الاوامر !
26 |
27 | 🔖 لتعلم طريقة تشغيلي بمجموعتك اضغط علي » ❓طريقة التفعيل !
28 | """,
29 | reply_markup=InlineKeyboardMarkup(
30 | [
31 | [
32 | InlineKeyboardButton(
33 | "• نـصـب بـوتك مـن هـنا •", url="https://t.me/FA9SH/2270",
34 | )
35 | ],
36 | [InlineKeyboardButton("", callback_data="cbhowtouse")],
37 | [
38 | InlineKeyboardButton("📚 الاوامر", callback_data="cbcmds"),
39 | InlineKeyboardButton("❤️ المطور", url=f"https://t.me/{OWNER_NAME}"),
40 | ],
41 | [
42 | InlineKeyboardButton(
43 | "👥 جروب الدعم", url=f"https://t.me/{GROUP_SUPPORT}"
44 | ),
45 | InlineKeyboardButton(
46 | "📣 قناة البوت", url=f"https://t.me/FA9SH"
47 | ),
48 | ],
49 | [
50 | InlineKeyboardButton(
51 | "ضيـف البـوت لمجمـوعتـك ✅",
52 | url=f"https://t.me/USDDBOT?startgroup=true"
53 | )
54 | ],
55 | ]
56 | ),
57 | disable_web_page_preview=True,
58 | )
59 |
60 |
61 | @Client.on_callback_query(filters.regex("cbhowtouse"))
62 | async def cbguides(_, query: CallbackQuery):
63 | await query.answer("طريقة الاستخدام")
64 | await query.edit_message_text(
65 | f""" الدليل الأساسي لاستخدام هذا البوت:
66 |
67 | 1 ↤ أولاً ، أضفني إلى مجموعتك
68 | 2 ↤ بعد ذلك ، قم بترقيتي كمشرف ومنح جميع الصلاحيات باستثناء الوضع الخفي
69 | 3 ↤ بعد ترقيتي ، اكتب /reload مجموعة لتحديث بيانات المشرفين
70 | 4 ↤ أضف @{ASSISTANT_NAME} إلى مجموعتك أو اكتب /userbotjoin لدعوة حساب المساعد
71 | 5 ↤ قم بتشغيل المكالمة أولاً قبل البدء في تشغيل الفيديو / الموسيقى
72 | 6 ↤ في بعض الأحيان ، يمكن أن تساعدك إعادة تحميل البوت باستخدام الأمر /reload في إصلاح بعض المشكلات
73 | 📌 إذا لم ينضم البوت إلى المكالمة ، فتأكد من تشغيل المكالمة بالفعل ، أو اكتب /userbotleave ثم اكتب /userbotjoin مرة أخرى
74 |
75 | 💡 إذا كانت لديك أسئلة حول هذا البوت ، فيمكنك إخبارنا منن خلال قروب الدعم الخاصة بي هنا ↤ @{GROUP_SUPPORT}
76 |
77 | ⚡ قناة البوت @{UPDATES_CHANNEL}
78 | """,
79 | reply_markup=InlineKeyboardMarkup(
80 | [[InlineKeyboardButton("🔙 رجوع", callback_data="cbstart")]]
81 | ),
82 | )
83 |
84 |
85 | @Client.on_callback_query(filters.regex("cbcmds"))
86 | async def cbcmds(_, query: CallbackQuery):
87 | await query.answer("قائمة الاوامر")
88 | await query.edit_message_text(
89 | f"""» **قم بالضغط علي الزر الذي تريده لمعرفه الاوامر لكل فئه منهم !**
90 |
91 | ⚡ قناة البوت @{UPDATES_CHANNEL}""",
92 | reply_markup=InlineKeyboardMarkup(
93 | [
94 | [
95 | InlineKeyboardButton("👷🏻 اوامر الادمنيه", callback_data="cbadmin"),
96 | InlineKeyboardButton("🧙🏻 اوامر المطور", callback_data="cbsudo"),
97 | ],[
98 | InlineKeyboardButton("📚 اوامر اساسيه", callback_data="cbbasic")
99 | ],[
100 | InlineKeyboardButton("🔙 رجوع", callback_data="cbstart")
101 | ],
102 | ]
103 | ),
104 | )
105 |
106 |
107 | @Client.on_callback_query(filters.regex("cbbasic"))
108 | async def cbbasic(_, query: CallbackQuery):
109 | await query.answer("الاوامر الاساسيه")
110 | await query.edit_message_text(
111 | f"""🏮 الاوامر الاساسيه:
112 |
113 | » /play +「اسم الأغنية / رابط」لتشغيل اغنيه في المحادثه الصوتيه
114 | » /vplay +「اسم الفيديو / رابط 」 لتشغيل الفيديو داخل المكالمة
115 | » /vstream 「رابط」 تشغيل فيديو مباشر من اليوتيوب
116 | » /playlist 「تظهر لك قائمة التشغيل」
117 | » /end「لإنهاء الموسيقى / الفيديو في الكول」
118 | » /song + 「الاسم تنزيل صوت من youtube」
119 | »/vsong + 「الاسم تنزيل فيديو من youtube」
120 | » /skip「للتخطي إلى التالي」
121 | » /ping 「إظهار حالة البوت بينغ」
122 | » /uptime 「لعرض مده التشغيل للبوت」
123 | » /alive「اظهار معلومات البوت(في المجموعه)」
124 | ⚡ قناة البوت @{UPDATES_CHANNEL}""",
125 | reply_markup=InlineKeyboardMarkup(
126 | [[InlineKeyboardButton("🔙 رجوع", callback_data="cbcmds")]]
127 | ),
128 | )
129 |
130 |
131 |
132 | @Client.on_callback_query(filters.regex("cbadmin"))
133 | async def cbadmin(_, query: CallbackQuery):
134 | await query.answer("اوامر الادمنيه")
135 | await query.edit_message_text(
136 | f"""🏮 هنا أوامر الادمنيه:
137 |
138 | » /pause 「ايقاف التشغيل موقتآ」
139 | » /resume 「استئناف التشغيل」
140 | » /stop「لإيقاف التشغيل」
141 | » /vmute 「لكتم البوت」
142 | » /vunmute 「لرفع الكتم عن البوت」
143 | » /volume 「ضبط مستوئ الصوت」
144 | » /reload「لتحديث البوت و قائمة المشرفين」
145 | » /userbotjoin「لاستدعاء الحساب المساعد」
146 | » /userbotleave「لطرد الحساب المساعد」
147 | ⚡ قناة البوت @{UPDATES_CHANNEL}""",
148 | reply_markup=InlineKeyboardMarkup(
149 | [[InlineKeyboardButton("🔙 رجوع", callback_data="cbcmds")]]
150 | ),
151 | )
152 |
153 | @Client.on_callback_query(filters.regex("cbsudo"))
154 | async def cbsudo(_, query: CallbackQuery):
155 | await query.answer("اوامر المطور")
156 | await query.edit_message_text(
157 | f"""🏮 هنا اوامر المطور:
158 |
159 | » /rmw「لحذف جميع الملفات 」
160 | » /rmd「حذف جميع الملفات المحمله」
161 | » /sysinfo「لمعرفه معلومات السيرفر」
162 | » /update「لتحديث بوتك لاخر نسخه」
163 | » /restart「اعاده تشغيل البوت」
164 | » /leaveall「خروج الحساب المساعد من جميع المجموعات」
165 |
166 | ⚡ قناة البوت @{UPDATES_CHANNEL}""",
167 | reply_markup=InlineKeyboardMarkup(
168 | [[InlineKeyboardButton("🔙 رجوع", callback_data="cbcmds")]]
169 | ),
170 | )
171 |
172 |
173 | @Client.on_callback_query(filters.regex("cbmenu"))
174 | async def cbmenu(_, query: CallbackQuery):
175 | a = await _.get_chat_member(query.message.chat.id, query.from_user.id)
176 | if not a.can_manage_voice_chats:
177 | return await query.answer("💡 المسؤول الوحيد الذي لديه إذن إدارة الدردشات الصوتية يمكنه النقر على هذا الزر !", show_alert=True)
178 | chat_id = query.message.chat.id
179 | user_id = query.message.from_user.id
180 | buttons = menu_markup(user_id)
181 | chat = query.message.chat.title
182 | if chat_id in QUEUE:
183 | await query.edit_message_text(
184 | f"⚙️ **الإعدادات** {query.message.chat.title}\n\n⏸ : ايقاف التشغيل موقتآ\n▶️ : استئناف التشغيل\n🔇 : كتم الصوت\n🔊 : الغاء كتم الصوت\n⏹ : ايقاف التشغيل",
185 | reply_markup=InlineKeyboardMarkup(buttons),
186 | )
187 | else:
188 | await query.answer("❌ قائمة التشغيل فارغه", show_alert=True)
189 |
190 |
191 | @Client.on_callback_query(filters.regex("cls"))
192 | async def close(_, query: CallbackQuery):
193 | a = await _.get_chat_member(query.message.chat.id, query.from_user.id)
194 | if not a.can_manage_voice_chats:
195 | return await query.answer("💡 المسؤول الوحيد الذي لديه إذن إدارة الدردشات الصوتية يمكنه النقر على هذا الزر !", show_alert=True)
196 | await query.message.delete()
197 |
--------------------------------------------------------------------------------
/program/start.py:
--------------------------------------------------------------------------------
1 | import asyncio
2 |
3 | from datetime import datetime
4 | from sys import version_info
5 | from time import time
6 |
7 | from config import (
8 | BOT_PHOTO,
9 | ALIVE_IMG,
10 | ALIVE_NAME,
11 | BOT_NAME,
12 | BOT_USERNAME,
13 | GROUP_SUPPORT,
14 | OWNER_NAME,
15 | SUDO_USERS,
16 | BOT_TOKEN,
17 | DEV_PHOTO,
18 | DEV_NAME,
19 | UPDATES_CHANNEL,
20 | )
21 | from program import __version__
22 | from driver.veez import user
23 | from driver.filters import command, other_filters
24 | from driver.decorators import sudo_users_only
25 | from driver.database.dbchat import add_served_chat, is_served_chat
26 | from driver.database.dbpunish import is_gbanned_user
27 | from pyrogram import Client, filters, __version__ as pyrover
28 | from pyrogram.errors import FloodWait, MessageNotModified
29 | from pytgcalls import (__version__ as pytover)
30 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message, ChatJoinRequest
31 |
32 | __major__ = 0
33 | __minor__ = 2
34 | __micro__ = 1
35 |
36 | __python_version__ = f"{version_info[0]}.{version_info[1]}.{version_info[2]}"
37 |
38 |
39 | START_TIME = datetime.utcnow()
40 | START_TIME_ISO = START_TIME.replace(microsecond=0).isoformat()
41 | TIME_DURATION_UNITS = (
42 | ("week", 60 * 60 * 24 * 7),
43 | ("day", 60 * 60 * 24),
44 | ("hour", 60 * 60),
45 | ("min", 60),
46 | ("sec", 1),
47 | )
48 |
49 |
50 | async def _human_time_duration(seconds):
51 | if seconds == 0:
52 | return "inf"
53 | parts = []
54 | for unit, div in TIME_DURATION_UNITS:
55 | amount, seconds = divmod(int(seconds), div)
56 | if amount > 0:
57 | parts.append("{} {}{}".format(amount, unit, "" if amount == 1 else "s"))
58 | return ", ".join(parts)
59 |
60 |
61 | @Client.on_message(command("start") & filters.private & ~filters.edited)
62 | async def start_(client: Client, message: Message):
63 | await message.reply_photo(
64 | photo=f"{BOT_PHOTO}",
65 | caption=f"""✨ **مرحبا عزيزي » {message.from_user.mention()} !**\n
66 | 💭 **انا بوت استطيع تشغيل الموسيقي والفديو في محادثتك الصوتية**
67 |
68 | 💡 تعلم طريقة تشغيلي واوامر التحكم بي عن طريق » 📚 الاوامر !
69 |
70 | 🔖 لتعلم طريقة تشغيلي بمجموعتك اضغط علي » ❓طريقة التفعيل !
71 | """,
72 | reply_markup=InlineKeyboardMarkup(
73 | [
74 | [
75 | InlineKeyboardButton(
76 | "• نـصـب بـوتك مـن هـنا •", url="https://t.me/FA9SH/2270",
77 | )
78 | ],
79 | [InlineKeyboardButton("", callback_data="cbhowtouse")],
80 | [
81 | InlineKeyboardButton("📚 الاوامر", callback_data="cbcmds"),
82 | InlineKeyboardButton("❤️ المطور", url=f"https://t.me/{OWNER_NAME}"),
83 | ],
84 | [
85 | InlineKeyboardButton(
86 | "👥 جروب الدعم", url=f"https://t.me/{GROUP_SUPPORT}"
87 | ),
88 | InlineKeyboardButton(
89 | "📣 قناة البوت", url=f"https://t.me/{UPDATES_CHANNEL}"
90 | ),
91 | ],
92 | [
93 | InlineKeyboardButton(
94 | "ضيـف البـوت لمجمـوعتـك ✅",
95 | url=f"https://t.me/{BOT_USERNAME}?startgroup=true"
96 | )
97 | ],
98 | ]
99 | ),
100 | )
101 |
102 |
103 | @Client.on_message(command(["برمج السورس", f"ؤمن", f"ورس", f"لسورس", f"ادو", f"اضو"]) & filters.group & ~filters.edited)
104 | async def start(client: Client, message: Message):
105 | await message.reply_photo(
106 | photo=f"https://telegra.ph/file/18b88af791e36bf3c4259.jpg",
107 | caption=f"""ᴘʀᴏɢʀᴀᴍᴍᴇʀ [ѕʜᴀᴅᴏᴡ](https://t.me/S_V_I_P) 𖡼\nᴛᴏ ᴄᴏᴍᴍụɴɪᴄᴀᴛᴇ ᴛᴏɢᴇᴛʜᴇʀ 𖡼\nғᴏʟʟᴏᴡ ᴛʜᴇ ʙụᴛᴛᴏɴѕ ʟᴏᴡᴇʀ 𖡼""",
108 | reply_markup=InlineKeyboardMarkup(
109 | [
110 | [
111 | InlineKeyboardButton("𓌹●↯𝑫𝑨𝑫 𝑺𝑯𝑨𝑫𝑶𝑾↯●𓌺", url=f"https://t.me/KB_Shadow"),
112 | ],
113 | [
114 | InlineKeyboardButton(
115 | "𝑬𝑹𝑹𝑶𝑹🖤", url=f"https://t.me/FA9SH"
116 | ),
117 | ],
118 | [
119 | InlineKeyboardButton("♡اضف البوت الى مجموعتك♡", url=f"https://t.me/USDDBOT?startgroup=true"),
120 | ]
121 | ]
122 | )
123 | )
124 |
125 | @Client.on_message(command(["لمطور", "طور"]) & filters.group & ~filters.edited)
126 | async def help(client: Client, message: Message):
127 | await message.reply_photo(
128 | photo=f"{DEV_PHOTO}",
129 | caption=f"""◍ الاول: هو مطور السورس \n◍ الثاني: هو مطور البوت\n√""",
130 | reply_markup=InlineKeyboardMarkup(
131 | [
132 | [
133 | InlineKeyboardButton("𓌹●↯𝑫𝑨𝑫 𝑺𝑯𝑨𝑫𝑶𝑾↯●𓌺", url=f"https://t.me/S_V_I_P"),
134 | ],
135 | [
136 | InlineKeyboardButton(
137 | DEV_NAME, url=f"https://t.me/{OWNER_NAME}"
138 | ),
139 | ],
140 | [
141 | InlineKeyboardButton("ضيـف البـوت لمجمـوعتـك ✅", url=f"https://t.me/{BOT_USERNAME}?startgroup=true"),
142 | ]
143 | ]
144 | )
145 | )
146 |
147 | @Client.on_message(command(["لب التوكن", f"لب_التوكن", "hadow"]) & filters.private & ~filters.edited)
148 | @sudo_users_only
149 | async def shadow(c: Client, message: Message):
150 | start = time()
151 | m_reply = await message.reply_text("انتظر من فضلك...")
152 | BOT_TOKEN = time() - start
153 | await m_reply.edit_text(f"**تم جلب التوكن**\n`{BOT_TOKEN}`")
154 |
155 | @Client.on_message(command(["ping", f"بينج"]) & ~filters.edited)
156 | async def ping_pong(client: Client, message: Message):
157 | start = time()
158 | m_reply = await message.reply_text("pinging...")
159 | delta_ping = time() - start
160 | await m_reply.edit_text("🏓 `PONG!!`\n" f"⚡️ `{delta_ping * 1000:.3f} ms`")
161 |
162 |
163 | @Client.on_message(command(["uptime", f"uptime@{BOT_USERNAME}"]) & ~filters.edited)
164 | async def get_uptime(client: Client, message: Message):
165 | current_time = datetime.utcnow()
166 | uptime_sec = (current_time - START_TIME).total_seconds()
167 | uptime = await _human_time_duration(int(uptime_sec))
168 | await message.reply_text(
169 | "🤖 bot status:\n"
170 | f"• **uptime:** `{uptime}`\n"
171 | f"• **start time:** `{START_TIME_ISO}`"
172 | )
173 |
174 |
175 | @Client.on_chat_join_request()
176 | async def approve_join_chat(c: Client, m: ChatJoinRequest):
177 | if not m.from_user:
178 | return
179 | try:
180 | await c.approve_chat_join_request(m.chat.id, m.from_user.id)
181 | except FloodWait as e:
182 | await asyncio.sleep(e.x + 2)
183 | await c.approve_chat_join_request(m.chat.id, m.from_user.id)
184 |
185 |
186 | @Client.on_message(filters.new_chat_members)
187 | async def new_chat(c: Client, m: Message):
188 | chat_id = m.chat.id
189 | if await is_served_chat(chat_id):
190 | pass
191 | else:
192 | await add_served_chat(chat_id)
193 | ass_uname = (await user.get_me()).username
194 | bot_id = (await c.get_me()).id
195 | for member in m.new_chat_members:
196 | if member.id == bot_id:
197 | return await m.reply(
198 | "❤️ **شكرا لإضافتي إلى المجموعة !**\n\n"
199 | "قم بترقيتي كمسؤول عن المجموعة لكي أتمكن من العمل بشكل صحيح\nولا تنسى كتابة `/انضم` لدعوة الحساب المساعد\nقم بكتابة`/تحديث` لتحديث قائمة المشرفين",
200 | reply_markup=InlineKeyboardMarkup(
201 | [
202 | [
203 | InlineKeyboardButton("📣 قناة البوت", url=f"https://t.me/{UPDATES_CHANNEL}"),
204 | InlineKeyboardButton("💭 جروب الدعم", url=f"https://t.me/{GROUP_SUPPORT}")
205 | ],
206 | [
207 | InlineKeyboardButton(
208 | ALIVE_NAME, url=f"https://t.me/{ass_uname}"),
209 | ],
210 | [
211 | InlineKeyboardButton(
212 | "♡اضـف الـبـوت لـمـجـمـوعـتـك♡",
213 | url=f'https://t.me/USDDBOT?startgroup=true'),
214 | ],
215 | ]
216 | )
217 | )
218 |
219 |
220 | chat_watcher_group = 5
221 |
222 | @Client.on_message(group=chat_watcher_group)
223 | async def chat_watcher_func(_, message: Message):
224 | try:
225 | userid = message.from_user.id
226 | except Exception:
227 | return
228 | suspect = f"[{message.from_user.first_name}](tg://user?id={message.from_user.id})"
229 | if await is_gbanned_user(userid):
230 | try:
231 | await message.chat.ban_member(userid)
232 | except Exception:
233 | return
234 | await message.reply_text(
235 | f"👮🏼 (> {suspect} <)\n\n**Gbanned** user detected, that user has been gbanned by sudo user and was blocked from this Chat !\n\n🚫 **Reason:** potential spammer and abuser."
236 | )
237 |
238 |
--------------------------------------------------------------------------------
/program/admins.py:
--------------------------------------------------------------------------------
1 | from cache.admins import admins
2 | from driver.veez import call_py, bot
3 | from pyrogram import Client, filters
4 | from driver.design.thumbnail import thumb
5 | from driver.design.chatname import CHAT_TITLE
6 | from driver.queues import QUEUE, clear_queue
7 | from driver.filters import command, other_filters
8 | from driver.decorators import authorized_users_only
9 | from driver.utils import skip_current_song, skip_item
10 | from program.utils.inline import (
11 | stream_markup,
12 | close_mark,
13 | back_mark,
14 | )
15 | from config import BOT_USERNAME, GROUP_SUPPORT, IMG_5, UPDATES_CHANNEL
16 | from pyrogram.types import (
17 | CallbackQuery,
18 | InlineKeyboardButton,
19 | InlineKeyboardMarkup,
20 | Message,
21 | )
22 |
23 |
24 | @Client.on_message(command(["reload", f"تحديث", "حديث"]) & other_filters)
25 | @authorized_users_only
26 | async def update_admin(client, message):
27 | global admins
28 | new_admins = []
29 | new_ads = await client.get_chat_members(message.chat.id, filter="administrators")
30 | for u in new_ads:
31 | new_admins.append(u.user.id)
32 | admins[message.chat.id] = new_admins
33 | await message.reply_text(
34 | "✅تم إعادة تحميل البوت ** بشكل صحيح! ** \n✅ ** تم تحديث قائمة المسؤولين ** **! ** "
35 | )
36 |
37 |
38 | @Client.on_message(command(["skip", f"تخطي", "خطي"]) & other_filters)
39 | @authorized_users_only
40 | async def skip(c: Client, m: Message):
41 | user_id = m.from_user.id
42 | chat_id = m.chat.id
43 | if len(m.command) < 2:
44 | op = await skip_current_song(chat_id)
45 | if op == 0:
46 | await c.send_message(chat_id, "❌ قائمة التشغيل فارغه")
47 | elif op == 1:
48 | await c.send_message(chat_id, "✅ قوائم الانتظار ** فارغة. ** \n\n** • خروج المستخدم من الدردشة الصوتية ** ")
49 | elif op == 2:
50 | await c.send_message(chat_id, "🗑️مسح قوائم الانتظار ** \n \n ** • مغادرة المستخدم الآلي للدردشة الصوتية ** ")
51 | else:
52 | buttons = stream_markup(user_id)
53 | requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
54 | thumbnail = f"{IMG_5}"
55 | title = f"{op[0]}"
56 | userid = m.from_user.id
57 | gcname = m.chat.title
58 | ctitle = await CHAT_TITLE(gcname)
59 | image = await thumb(thumbnail, title, userid, ctitle)
60 | await c.send_photo(
61 | chat_id,
62 | photo=image,
63 | reply_markup=InlineKeyboardMarkup(buttons),
64 | caption=f"⏭ **تم التخطي الئ المسار التالي**\n\n🏷 **الاسم:** [{op[0]}]({op[1]})\n💭 **المجموعة:** `{chat_id}`\n💡 **الحالة:** `شغال`\n🎧 **طلب بواسطة:** {m.from_user.mention()}",
65 | )
66 | else:
67 | skip = m.text.split(None, 1)[1]
68 | OP = "🗑 **تمت إزالة الأغنية من قائمة الانتظار:**"
69 | if chat_id in QUEUE:
70 | items = [int(x) for x in skip.split(" ") if x.isdigit()]
71 | items.sort(reverse=True)
72 | for x in items:
73 | if x == 0:
74 | pass
75 | else:
76 | hm = await skip_item(chat_id, x)
77 | if hm == 0:
78 | pass
79 | else:
80 | OP = OP + "\n" + f"**#{x}** - {hm}"
81 | await m.reply(OP)
82 |
83 |
84 | @Client.on_message(
85 | command(["stop", f"stop@{BOT_USERNAME}", "end", f"نهاء", "انهاء"])
86 | & other_filters
87 | )
88 | @authorized_users_only
89 | async def stop(client, m: Message):
90 | chat_id = m.chat.id
91 | if chat_id in QUEUE:
92 | try:
93 | await call_py.leave_group_call(chat_id)
94 | clear_queue(chat_id)
95 | await m.reply("✅ **تم ايقاف التشغيل**")
96 | except Exception as e:
97 | await m.reply(f"🚫 **خطأ:**\n\n`{e}`")
98 | else:
99 | await m.reply("❌ **قائمة التشغيل فارغه**")
100 |
101 |
102 | @Client.on_message(
103 | command(["pause", f"pause@{BOT_USERNAME}", "vpause"]) & other_filters
104 | )
105 | @authorized_users_only
106 | async def pause(client, m: Message):
107 | chat_id = m.chat.id
108 | if chat_id in QUEUE:
109 | try:
110 | await call_py.pause_stream(chat_id)
111 | await m.reply(
112 | "⏸ **تم ايقاف المسار موقتآ**\n\n• **لٲستئناف البث استخدم**\n» /resume الامر."
113 | )
114 | except Exception as e:
115 | await m.reply(f"🚫 **خطأ:**\n\n`{e}`")
116 | else:
117 | await m.reply("❌ **قائمة التشغيل فارغه**")
118 |
119 |
120 | @Client.on_message(
121 | command(["resume", f"resume@{BOT_USERNAME}", "vresume"]) & other_filters
122 | )
123 | @authorized_users_only
124 | async def resume(client, m: Message):
125 | chat_id = m.chat.id
126 | if chat_id in QUEUE:
127 | try:
128 | await call_py.resume_stream(chat_id)
129 | await m.reply(
130 | "▶️ **تم استئناف المسار**\n\n• **لايقاف البث موقتآ استخدم**\n» /pause الامر"
131 | )
132 | except Exception as e:
133 | await m.reply(f"🚫 **خطأ:**\n\n`{e}`")
134 | else:
135 | await m.reply("❌ **قائمة التشغيل فارغه**")
136 |
137 |
138 | @Client.on_message(
139 | command(["mute", f"mute@{BOT_USERNAME}", "vmute"]) & other_filters
140 | )
141 | @authorized_users_only
142 | async def mute(client, m: Message):
143 | chat_id = m.chat.id
144 | if chat_id in QUEUE:
145 | try:
146 | await call_py.mute_stream(chat_id)
147 | await m.reply(
148 | "🔇 **تم كتم الصوت**\n\n• **لرفع الكتم استخدم**\n» /unmute الامر"
149 | )
150 | except Exception as e:
151 | await m.reply(f"🚫 **خطأ:**\n\n`{e}`")
152 | else:
153 | await m.reply("❌ **قائمة التشغيل فارغه**")
154 |
155 |
156 | @Client.on_message(
157 | command(["unmute", f"unmute@{BOT_USERNAME}", "vunmute"]) & other_filters
158 | )
159 | @authorized_users_only
160 | async def unmute(client, m: Message):
161 | chat_id = m.chat.id
162 | if chat_id in QUEUE:
163 | try:
164 | await call_py.unmute_stream(chat_id)
165 | await m.reply(
166 | "🔊 **تم رفع الكتم**\n\n• **لكتم الصوت استخدم**\n» /mute الامر"
167 | )
168 | except Exception as e:
169 | await m.reply(f"🚫 **خطأ:**\n\n`{e}`")
170 | else:
171 | await m.reply("❌ **قائمة التشغيل فارغه**")
172 |
173 |
174 | @Client.on_callback_query(filters.regex("cbpause"))
175 | async def cbpause(_, query: CallbackQuery):
176 | a = await _.get_chat_member(query.message.chat.id, query.from_user.id)
177 | if not a.can_manage_voice_chats:
178 | return await query.answer("💡 المسؤول الوحيد الذي لديه إذن إدارة الدردشات الصوتية يمكنه النقر على هذا الزر !", show_alert=True)
179 | chat_id = query.message.chat.id
180 | if chat_id in QUEUE:
181 | try:
182 | await call_py.pause_stream(chat_id)
183 | await query.answer("streaming paused")
184 | await query.edit_message_text(
185 | "⏸ توقف البث موقتآ", reply_markup=back_mark
186 | )
187 | except Exception as e:
188 | await query.edit_message_text(f"🚫 **خطأ:**\n\n`{e}`", reply_markup=close_mark)
189 | else:
190 | await query.answer("❌ **قائمة التشغيل فارغه**", show_alert=True)
191 |
192 |
193 | @Client.on_callback_query(filters.regex("cbresume"))
194 | async def cbresume(_, query: CallbackQuery):
195 | a = await _.get_chat_member(query.message.chat.id, query.from_user.id)
196 | if not a.can_manage_voice_chats:
197 | return await query.answer("💡 المسؤول الوحيد الذي لديه إذن إدارة الدردشات الصوتية يمكنه النقر على هذا الزر !", show_alert=True)
198 | chat_id = query.message.chat.id
199 | if chat_id in QUEUE:
200 | try:
201 | await call_py.resume_stream(chat_id)
202 | await query.answer("streaming resumed")
203 | await query.edit_message_text(
204 | "▶️ تم استئناف البث", reply_markup=back_mark
205 | )
206 | except Exception as e:
207 | await query.edit_message_text(f"🚫 **خطأ:**\n\n`{e}`", reply_markup=close_mark)
208 | else:
209 | await query.answer("❌ **قائمة التشغيل فارغه**", show_alert=True)
210 |
211 |
212 | @Client.on_callback_query(filters.regex("cbstop"))
213 | async def cbstop(_, query: CallbackQuery):
214 | a = await _.get_chat_member(query.message.chat.id, query.from_user.id)
215 | if not a.can_manage_voice_chats:
216 | return await query.answer("💡 المسؤول الوحيد الذي لديه إذن إدارة الدردشات الصوتية يمكنه النقر على هذا الزر !", show_alert=True)
217 | chat_id = query.message.chat.id
218 | if chat_id in QUEUE:
219 | try:
220 | await call_py.leave_group_call(chat_id)
221 | clear_queue(chat_id)
222 | await query.edit_message_text("✅ **تم ايقاف التشغيل**", reply_markup=close_mark)
223 | except Exception as e:
224 | await query.edit_message_text(f"🚫 **خطأ:**\n\n`{e}`", reply_markup=close_mark)
225 | else:
226 | await query.answer("❌ **قائمة التشغيل فارغه**", show_alert=True)
227 |
228 |
229 | @Client.on_callback_query(filters.regex("cbmute"))
230 | async def cbmute(_, query: CallbackQuery):
231 | a = await _.get_chat_member(query.message.chat.id, query.from_user.id)
232 | if not a.can_manage_voice_chats:
233 | return await query.answer("💡 المسؤول الوحيد الذي لديه إذن إدارة الدردشات الصوتية يمكنه النقر على هذا الزر !", show_alert=True)
234 | chat_id = query.message.chat.id
235 | if chat_id in QUEUE:
236 | try:
237 | await call_py.mute_stream(chat_id)
238 | await query.answer("streaming muted")
239 | await query.edit_message_text(
240 | "🔇 تم كتم الصوت", reply_markup=back_mark
241 | )
242 | except Exception as e:
243 | await query.edit_message_text(f"🚫 **خطأ:**\n\n`{e}`", reply_markup=close_mark)
244 | else:
245 | await query.answer("❌ **قائمة التشغيل فارغه**", show_alert=True)
246 |
247 |
248 | @Client.on_callback_query(filters.regex("cbunmute"))
249 | async def cbunmute(_, query: CallbackQuery):
250 | a = await _.get_chat_member(query.message.chat.id, query.from_user.id)
251 | if not a.can_manage_voice_chats:
252 | return await query.answer("💡 المسؤول الوحيد الذي لديه إذن إدارة الدردشات الصوتية يمكنه النقر على هذا الزر !", show_alert=True)
253 | chat_id = query.message.chat.id
254 | if chat_id in QUEUE:
255 | try:
256 | await call_py.unmute_stream(chat_id)
257 | await query.answer("streaming unmuted")
258 | await query.edit_message_text(
259 | "🔊 تم تشغيل الصوت", reply_markup=back_mark
260 | )
261 | except Exception as e:
262 | await query.edit_message_text(f"🚫 **خطأ:**\n\n`{e}`", reply_markup=close_mark)
263 | else:
264 | await query.answer("❌ **قائمة التشغيل فارغه**", show_alert=True)
265 |
266 |
267 | @Client.on_message(
268 | command(["volume", f"volume@{BOT_USERNAME}", "تحكم"]) & other_filters
269 | )
270 | @authorized_users_only
271 | async def change_volume(client, m: Message):
272 | range = m.command[1]
273 | chat_id = m.chat.id
274 | if chat_id in QUEUE:
275 | try:
276 | await call_py.change_volume_call(chat_id, volume=int(range))
277 | await m.reply(
278 | f"✅ **تم ضبط الصوت على** `{range}`%"
279 | )
280 | except Exception as e:
281 | await m.reply(f"🚫 **خطأ:**\n\n`{e}`")
282 | else:
283 | await m.reply("❌ **قائمة التشغيل فارغه**")
284 |
--------------------------------------------------------------------------------
/program/music.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2021 By Veez Music-Project
2 | # Commit Start Date 20/10/2021
3 | # Finished On 28/10/2021
4 |
5 | # pyrogram stuff
6 | from pyrogram import Client
7 | from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant
8 | from pyrogram.types import InlineKeyboardMarkup, Message
9 | # pytgcalls stuff
10 | from pytgcalls import StreamType
11 | from pytgcalls.types.input_stream import AudioPiped
12 | from pytgcalls.types.input_stream.quality import HighQualityAudio
13 | # repository stuff
14 | from program.utils.inline import stream_markup
15 | from driver.design.thumbnail import thumb
16 | from driver.design.chatname import CHAT_TITLE
17 | from driver.filters import command, other_filters
18 | from driver.queues import QUEUE, add_to_queue
19 | from driver.veez import call_py, user
20 | from driver.utils import bash
21 | from config import BOT_USERNAME, IMG_5
22 | # youtube-dl stuff
23 | from youtubesearchpython import VideosSearch
24 |
25 |
26 | def ytsearch(query: str):
27 | try:
28 | search = VideosSearch(query, limit=1).result()
29 | data = search["result"][0]
30 | songname = data["title"]
31 | url = data["link"]
32 | duration = data["duration"]
33 | thumbnail = f"https://i.ytimg.com/vi/{data['id']}/hqdefault.jpg"
34 | return [songname, url, duration, thumbnail]
35 | except Exception as e:
36 | print(e)
37 | return 0
38 |
39 |
40 | async def ytdl(link: str):
41 | stdout, stderr = await bash(
42 | f'yt-dlp -g -f "best[height<=?720][width<=?1280]" {link}'
43 | )
44 | if stdout:
45 | return 1, stdout
46 | return 0, stderr
47 |
48 |
49 | @Client.on_message(command(["mplay","شغيل","غل","play", f"تشغيل"]) & other_filters)
50 | async def play(c: Client, m: Message):
51 | replied = m.reply_to_message
52 | chat_id = m.chat.id
53 | user_id = m.from_user.id
54 | if m.sender_chat:
55 | return await m.reply_text(
56 | "you're an __Anonymous__ user !\n\n» revert back to your real user account to use this bot."
57 | )
58 | try:
59 | aing = await c.get_me()
60 | except Exception as e:
61 | return await m.reply_text(f"error:\n\n{e}")
62 | a = await c.get_chat_member(chat_id, aing.id)
63 | if a.status != "administrator":
64 | await m.reply_text(
65 | f"💡 لاستخدامي ، يجب أن أكون ** مشرف ** مع ** الصلاحيات التالية **:\n\n» ❌ __حذف الرسائل__\n» ❌ __دعوة المستخدمين__\n» ❌ __ادارة المكالمات المرئية__\n\n** يتم تحديث البيانات ** تلقائيًا بعد أن تقوم بترقيتي **"
66 | )
67 | return
68 | if not a.can_manage_voice_chats:
69 | await m.reply_text(
70 | "ليس لدي صلاحية:" + "\n\n» ❌ __ادارة المكالمات المرئية__"
71 | )
72 | return
73 | if not a.can_delete_messages:
74 | await m.reply_text(
75 | "ليس لدي صلاحية:" + "\n\n» ❌ __حذف الرسائل__"
76 | )
77 | return
78 | if not a.can_invite_users:
79 | await m.reply_text("ليس لدي صلاحية:" + "\n\n» ❌ __اضافة المستخدمين__")
80 | return
81 | try:
82 | ubot = (await user.get_me()).id
83 | b = await c.get_chat_member(chat_id, ubot)
84 | if b.status == "kicked":
85 | await c.unban_chat_member(chat_id, ubot)
86 | invitelink = await c.export_chat_invite_link(chat_id)
87 | if invitelink.startswith("https://t.me/+"):
88 | invitelink = invitelink.replace(
89 | "https://t.me/+", "https://t.me/joinchat/"
90 | )
91 | await user.join_chat(invitelink)
92 | except UserNotParticipant:
93 | try:
94 | invitelink = await c.export_chat_invite_link(chat_id)
95 | if invitelink.startswith("https://t.me/+"):
96 | invitelink = invitelink.replace(
97 | "https://t.me/+", "https://t.me/joinchat/"
98 | )
99 | await user.join_chat(invitelink)
100 | except UserAlreadyParticipant:
101 | pass
102 | except Exception as e:
103 | return await m.reply_text(
104 | f"❌ **فشل المساعد في الانضمام**\n\n**السبب**: `{e}`"
105 | )
106 | if replied:
107 | if replied.audio or replied.voice:
108 | suhu = await replied.reply("📥 **جاري تنزيل الصوت...**")
109 | dl = await replied.download()
110 | link = replied.link
111 |
112 | try:
113 | if replied.audio:
114 | songname = replied.audio.title[:70]
115 | songname = replied.audio.file_name[:70]
116 | duration = replied.audio.duration
117 | elif replied.voice:
118 | songname = "Voice Note"
119 | duration = replied.voice.duration
120 | except BaseException:
121 | songname = "Audio"
122 |
123 | if chat_id in QUEUE:
124 | gcname = m.chat.title
125 | ctitle = await CHAT_TITLE(gcname)
126 | title = songname
127 | userid = m.from_user.id
128 | thumbnail = f"{IMG_5}"
129 | image = await thumb(thumbnail, title, userid, ctitle)
130 | pos = add_to_queue(chat_id, songname, dl, link, "Audio", 0)
131 | requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
132 | buttons = stream_markup(user_id)
133 | await suhu.delete()
134 | await m.reply_photo(
135 | photo=image,
136 | reply_markup=InlineKeyboardMarkup(buttons),
137 | caption=f"💡 **تمت إضافة المقطع إلى قائمة الانتظار »** `{pos}`\n\n🏷 **الاسم:** [{songname}]({link})\n💭 **المجموعه:** `{chat_id}`\n⏱️ **المده:** `{duration}`\n🎧 **طلب بواسطة:** {requester}",
138 | )
139 | else:
140 | try:
141 | gcname = m.chat.title
142 | ctitle = await CHAT_TITLE(gcname)
143 | title = songname
144 | userid = m.from_user.id
145 | thumbnail = f"{IMG_5}"
146 | image = await thumb(thumbnail, title, userid, ctitle)
147 | await suhu.edit("🔄 **يتم التشغيل...**")
148 | await call_py.join_group_call(
149 | chat_id,
150 | AudioPiped(
151 | dl,
152 | HighQualityAudio(),
153 | ),
154 | stream_type=StreamType().local_stream,
155 | )
156 | add_to_queue(chat_id, songname, dl, link, "Audio", 0)
157 | await suhu.delete()
158 | buttons = stream_markup(user_id)
159 | requester = (
160 | f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
161 | )
162 | await m.reply_photo(
163 | photo=image,
164 | reply_markup=InlineKeyboardMarkup(buttons),
165 | caption=f"🏷 **الاسم:** [{songname}]({link})\n💭 **المجموعه:** `{chat_id}`\n⏱️ **المده:** `{duration}`\n🎧 **طلب بواسطة:** {requester}",
166 | )
167 | except Exception as e:
168 | await suhu.delete()
169 | await m.reply_text(f"🚫 خطأ:\n\n» {e}")
170 | else:
171 | if len(m.command) < 2:
172 | await m.reply(
173 | "» عليك الرد على ** ملف صوتي ** أو ** أكتب شي للبحث**"
174 | )
175 | else:
176 | suhu = await c.send_message(chat_id, "🔎 **جاري البحث...**")
177 | query = m.text.split(None, 1)[1]
178 | search = ytsearch(query)
179 | if search == 0:
180 | await suhu.edit("❌ **لم يتم العثور على نتائج**")
181 | else:
182 | songname = search[0]
183 | title = search[0]
184 | url = search[1]
185 | duration = search[2]
186 | thumbnail = search[3]
187 | userid = m.from_user.id
188 | gcname = m.chat.title
189 | ctitle = await CHAT_TITLE(gcname)
190 | image = await thumb(thumbnail, title, userid, ctitle)
191 | veez, ytlink = await ytdl(url)
192 | if veez == 0:
193 | await suhu.edit(f"❌ تم اكتشاف مشاكل في youtube-dl\n\n» `{ytlink}`")
194 | else:
195 | if chat_id in QUEUE:
196 | pos = add_to_queue(
197 | chat_id, songname, ytlink, url, "Audio", 0
198 | )
199 | await suhu.delete()
200 | buttons = stream_markup(user_id)
201 | requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
202 | await m.reply_photo(
203 | photo=image,
204 | reply_markup=InlineKeyboardMarkup(buttons),
205 | caption=f"💡 **تمت إضافة المقطع إلى قائمة الانتظار »** `{pos}`\n\n🏷 **الاسم:** [{songname}]({url})\n💭 **المجموعه:** `{chat_id}`\n**⏱ المده:** `{duration}`\n🎧 **طلب بواسطة:** {requester}",
206 | )
207 | else:
208 | try:
209 | await suhu.edit("🔄 **يتم التشغيل...**")
210 | await call_py.join_group_call(
211 | chat_id,
212 | AudioPiped(
213 | ytlink,
214 | HighQualityAudio(),
215 | ),
216 | stream_type=StreamType().local_stream,
217 | )
218 | add_to_queue(chat_id, songname, ytlink, url, "Audio", 0)
219 | await suhu.delete()
220 | buttons = stream_markup(user_id)
221 | requester = (
222 | f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
223 | )
224 | await m.reply_photo(
225 | photo=image,
226 | reply_markup=InlineKeyboardMarkup(buttons),
227 | caption=f"💡 **تم تشغيل الموسيقى.**\n\n🏷 **الاسم:** [{songname}]({url})\n💭 **المجموعه:** `{chat_id}`\n**⏱ المده:** `{duration}`\n🎧 **طلب بواسطة:** {requester}",
228 | )
229 | except Exception as ep:
230 | await suhu.delete()
231 | await m.reply_text(f"🚫 خطأ: `{ep}`")
232 |
233 | else:
234 | if len(m.command) < 2:
235 | await m.reply(
236 | "» عليك الرد على ** ملف صوتي ** أو ** أكتب شي للبحث**"
237 | )
238 | else:
239 | suhu = await c.send_message(chat_id, "🔎 **جاري البحث...**")
240 | query = m.text.split(None, 1)[1]
241 | search = ytsearch(query)
242 | if search == 0:
243 | await suhu.edit("❌ **لم يتم العثور على نتائج**")
244 | else:
245 | songname = search[0]
246 | title = search[0]
247 | url = search[1]
248 | duration = search[2]
249 | thumbnail = search[3]
250 | userid = m.from_user.id
251 | gcname = m.chat.title
252 | ctitle = await CHAT_TITLE(gcname)
253 | image = await thumb(thumbnail, title, userid, ctitle)
254 | veez, ytlink = await ytdl(url)
255 | if veez == 0:
256 | await suhu.edit(f"❌ تم اكتشاف مشاكل في youtube-dl\n\n» `{ytlink}`")
257 | else:
258 | if chat_id in QUEUE:
259 | pos = add_to_queue(chat_id, songname, ytlink, url, "Audio", 0)
260 | await suhu.delete()
261 | requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
262 | buttons = stream_markup(user_id)
263 | await m.reply_photo(
264 | photo=image,
265 | reply_markup=InlineKeyboardMarkup(buttons),
266 | caption=f"💡 **تمت إضافة المقطع إلى قائمة الانتظار »** `{pos}`\n\n🏷 **الاسم:** [{songname}]({url})\n💭 **المجموعه:** `{chat_id}`\n**⏱ المده:** `{duration}`\n🎧 **طلب بواسطة:** {requester}",
267 | )
268 | else:
269 | try:
270 | await suhu.edit("🔄 **يتم التشغيل...**")
271 | await call_py.join_group_call(
272 | chat_id,
273 | AudioPiped(
274 | ytlink,
275 | HighQualityAudio(),
276 | ),
277 | stream_type=StreamType().local_stream,
278 | )
279 | add_to_queue(chat_id, songname, ytlink, url, "Audio", 0)
280 | await suhu.delete()
281 | requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
282 | buttons = stream_markup(user_id)
283 | await m.reply_photo(
284 | photo=image,
285 | reply_markup=InlineKeyboardMarkup(buttons),
286 | caption=f"💡 **تم تشغيل الموسيقى.**\n\n🏷 **الاسم:** [{songname}]({url})\n💭 **المجموعه:** `{chat_id}`\n**⏱ المده:** `{duration}`\n🎧 **طلب بواسطة:** {requester}",
287 | )
288 | except Exception as ep:
289 | await suhu.delete()
290 | await m.reply_text(f"🚫 خطأ: `{ep}`")
291 |
--------------------------------------------------------------------------------
/program/video.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2021 By Veez Music-Project
2 | # Commit Start Date 20/10/2021
3 | # Finished On 28/10/2021
4 |
5 | import re
6 | import asyncio
7 |
8 | from config import BOT_USERNAME, IMG_1, IMG_2, IMG_5
9 | from program.utils.inline import stream_markup
10 | from driver.design.thumbnail import thumb
11 | from driver.design.chatname import CHAT_TITLE
12 | from driver.filters import command, other_filters
13 | from driver.queues import QUEUE, add_to_queue
14 | from driver.veez import call_py, user
15 | from pyrogram import Client
16 | from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant
17 | from pyrogram.types import InlineKeyboardMarkup, Message
18 | from pytgcalls import StreamType
19 | from pytgcalls.types.input_stream import AudioVideoPiped
20 | from pytgcalls.types.input_stream.quality import (
21 | HighQualityAudio,
22 | HighQualityVideo,
23 | LowQualityVideo,
24 | MediumQualityVideo,
25 | )
26 | from youtubesearchpython import VideosSearch
27 |
28 |
29 | def ytsearch(query: str):
30 | try:
31 | search = VideosSearch(query, limit=1).result()
32 | data = search["result"][0]
33 | songname = data["title"]
34 | url = data["link"]
35 | duration = data["duration"]
36 | thumbnail = f"https://i.ytimg.com/vi/{data['id']}/hqdefault.jpg"
37 | return [songname, url, duration, thumbnail]
38 | except Exception as e:
39 | print(e)
40 | return 0
41 |
42 |
43 | async def ytdl(link):
44 | proc = await asyncio.create_subprocess_exec(
45 | "yt-dlp",
46 | "-g",
47 | "-f",
48 | "best[height<=?720][width<=?1280]",
49 | f"{link}",
50 | stdout=asyncio.subprocess.PIPE,
51 | stderr=asyncio.subprocess.PIPE,
52 | )
53 | stdout, stderr = await proc.communicate()
54 | if stdout:
55 | return 1, stdout.decode().split("\n")[0]
56 | else:
57 | return 0, stderr.decode()
58 |
59 |
60 | @Client.on_message(command(["vplay", f"vplay@{BOT_USERNAME}"]) & other_filters)
61 | async def vplay(c: Client, m: Message):
62 | replied = m.reply_to_message
63 | chat_id = m.chat.id
64 | user_id = m.from_user.id
65 | if m.sender_chat:
66 | return await m.reply_text(
67 | "you're an __Anonymous__ user !\n\n» revert back to your real user account to use this bot."
68 | )
69 | try:
70 | aing = await c.get_me()
71 | except Exception as e:
72 | return await m.reply_text(f"error:\n\n{e}")
73 | a = await c.get_chat_member(chat_id, aing.id)
74 | if a.status != "administrator":
75 | await m.reply_text(
76 | f"💡 لكي تستطيع استخدامي ارفعني **ادمن** مع **صلاحيات**:\n\n» ❌ __حذف الرسائل__\n» ❌ __اضافة المستخدمين__\n» ❌ __ادارة المكالمات المرئية__\n\n **يتم تحديث البوت تلقائي** "
77 | )
78 | return
79 | if not a.can_manage_voice_chats:
80 | await m.reply_text(
81 | "ليس لدي صلاحية:" + "\n\n» ❌ __ادارة المكالمات المرئية__"
82 | )
83 | return
84 | if not a.can_delete_messages:
85 | await m.reply_text(
86 | "ليس لدي صلاحية:" + "\n\n» ❌ __حذف الرسائل__"
87 | )
88 | return
89 | if not a.can_invite_users:
90 | await m.reply_text("ليس لدي صلاحية:" + "\n\n» ❌ __اضافة مستخدمين__")
91 | return
92 | try:
93 | ubot = (await user.get_me()).id
94 | b = await c.get_chat_member(chat_id, ubot)
95 | if b.status == "kicked":
96 | await c.unban_chat_member(chat_id, ubot)
97 | invitelink = await c.export_chat_invite_link(chat_id)
98 | if invitelink.startswith("https://t.me/+"):
99 | invitelink = invitelink.replace(
100 | "https://t.me/+", "https://t.me/joinchat/"
101 | )
102 | await user.join_chat(invitelink)
103 | except UserNotParticipant:
104 | try:
105 | invitelink = await c.export_chat_invite_link(chat_id)
106 | if invitelink.startswith("https://t.me/+"):
107 | invitelink = invitelink.replace(
108 | "https://t.me/+", "https://t.me/joinchat/"
109 | )
110 | await user.join_chat(invitelink)
111 | except UserAlreadyParticipant:
112 | pass
113 | except Exception as e:
114 | return await m.reply_text(
115 | f"❌ **فشل المساعد بالانضمام**\n\n**السبب**: `{e}`"
116 | )
117 |
118 | if replied:
119 | if replied.video or replied.document:
120 | loser = await replied.reply("📥 **جاري تحميل الفيديو...**")
121 | dl = await replied.download()
122 | link = replied.link
123 | if len(m.command) < 2:
124 | Q = 720
125 | else:
126 | pq = m.text.split(None, 1)[1]
127 | if pq == "720" or "480" or "360":
128 | Q = int(pq)
129 | else:
130 | Q = 720
131 | await loser.edit(
132 | "» __فقط 720, 480, 360 مسموح__ \n💡 ** الان يشتغل الفيديو في 720p**"
133 | )
134 | try:
135 | if replied.video:
136 | songname = replied.video.file_name[:70]
137 | duration = replied.video.duration
138 | elif replied.document:
139 | songname = replied.document.file_name[:70]
140 | duration = replied.document.duration
141 | except BaseException:
142 | songname = "Video"
143 |
144 | if chat_id in QUEUE:
145 | gcname = m.chat.title
146 | ctitle = await CHAT_TITLE(gcname)
147 | title = songname
148 | userid = m.from_user.id
149 | thumbnail = f"{IMG_5}"
150 | image = await thumb(thumbnail, title, userid, ctitle)
151 | pos = add_to_queue(chat_id, songname, dl, link, "Video", Q)
152 | await loser.delete()
153 | requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
154 | buttons = stream_markup(user_id)
155 | await m.reply_photo(
156 | photo=image,
157 | reply_markup=InlineKeyboardMarkup(buttons),
158 | caption=f"💡 **تمت إضافة المسار إلى قائمة الانتظار »** `{pos}`\n\n🏷 **الاسم:** [{songname}]({url})\n💭 **المجموعه:** `{chat_id}`\n💡 **الحالة:** `شغال`\n🎧 **طلب بواسطة:** {requester}",
159 | )
160 | else:
161 | gcname = m.chat.title
162 | ctitle = await CHAT_TITLE(gcname)
163 | title = songname
164 | userid = m.from_user.id
165 | thumbnail = f"{IMG_5}"
166 | image = await thumb(thumbnail, title, userid, ctitle)
167 | if Q == 720:
168 | amaze = HighQualityVideo()
169 | elif Q == 480:
170 | amaze = MediumQualityVideo()
171 | elif Q == 360:
172 | amaze = LowQualityVideo()
173 | await loser.edit("🔄 **جاري التشغيل انتظر قليلآ...**")
174 | await call_py.join_group_call(
175 | chat_id,
176 | AudioVideoPiped(
177 | dl,
178 | HighQualityAudio(),
179 | amaze,
180 | ),
181 | stream_type=StreamType().local_stream,
182 | )
183 | add_to_queue(chat_id, songname, dl, link, "Video", Q)
184 | await loser.delete()
185 | requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
186 | buttons = stream_markup(user_id)
187 | await m.reply_photo(
188 | photo=image,
189 | reply_markup=InlineKeyboardMarkup(buttons),
190 | caption=f"💡 **بدء تشغيل الفيديو.**\n\n🏷 **الاسم:** [{songname}]({url})\n💭 **المجموعه:** `{chat_id}`\n**⏱ المده:** `{duration}`\n🎧 **طلب بواسطة:** {requester}",
191 | )
192 | else:
193 | if len(m.command) < 2:
194 | await m.reply(
195 | "» الرد على ** ملف فيديو ** أو ** أعط شيئًا للبحث **"
196 | )
197 | else:
198 | loser = await c.send_message(chat_id, "🔎 **جاري البحث انتظر قليلآ...**")
199 | query = m.text.split(None, 1)[1]
200 | search = ytsearch(query)
201 | Q = 720
202 | amaze = HighQualityVideo()
203 | if search == 0:
204 | await loser.edit("❌ **لم يتم العثور على نتائج**")
205 | else:
206 | songname = search[0]
207 | title = search[0]
208 | url = search[1]
209 | duration = search[2]
210 | thumbnail = search[3]
211 | userid = m.from_user.id
212 | gcname = m.chat.title
213 | ctitle = await CHAT_TITLE(gcname)
214 | image = await thumb(thumbnail, title, userid, ctitle)
215 | veez, ytlink = await ytdl(url)
216 | if veez == 0:
217 | await loser.edit(f"❌ تم اكتشاف خطأ حاول مجددآ\n\n» `{ytlink}`")
218 | else:
219 | if chat_id in QUEUE:
220 | pos = add_to_queue(
221 | chat_id, songname, ytlink, url, "Video", Q
222 | )
223 | await loser.delete()
224 | requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
225 | buttons = stream_markup(user_id)
226 | await m.reply_photo(
227 | photo=image,
228 | reply_markup=InlineKeyboardMarkup(buttons),
229 | caption=f"💡 **تمت إضافة المسار إلى قائمة الانتظار »** `{pos}`\n\n🏷 **الاسم:** [{songname}]({url})\n💭 **المجموعه:** `{chat_id}`\n💡 **الحالة:** `شغال`\n🎧 **طلب بواسطة:** {requester}",
230 | )
231 | else:
232 | try:
233 | await loser.edit("🔄 **جاري التشغيل انتظر قليلآ...**")
234 | await call_py.join_group_call(
235 | chat_id,
236 | AudioVideoPiped(
237 | ytlink,
238 | HighQualityAudio(),
239 | amaze,
240 | ),
241 | stream_type=StreamType().local_stream,
242 | )
243 | add_to_queue(chat_id, songname, ytlink, url, "Video", Q)
244 | await loser.delete()
245 | requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
246 | buttons = stream_markup(user_id)
247 | await m.reply_photo(
248 | photo=image,
249 | reply_markup=InlineKeyboardMarkup(buttons),
250 | caption=f"💡 **بدء تشغيل الفيديو.**\n\n🏷 **الاسم:** [{songname}]({link})\n💭 **المجموعه:** `{chat_id}`\n⏱️ **المده:** `{duration}`\n🎧 **طلب بواسطة:** {requester}",
251 | )
252 | except Exception as ep:
253 | await loser.delete()
254 | await m.reply_text(f"🚫 خطأ: `{ep}`")
255 |
256 | else:
257 | if len(m.command) < 2:
258 | await m.reply(
259 | "» الرد على ** ملف فيديو ** أو ** أعط شيئًا للبحث **"
260 | )
261 | else:
262 | loser = await c.send_message(chat_id, "🔎 **جاري البحث انتظر قليلآ...**")
263 | query = m.text.split(None, 1)[1]
264 | search = ytsearch(query)
265 | Q = 720
266 | amaze = HighQualityVideo()
267 | if search == 0:
268 | await loser.edit("❌ **لم يتم العثور على نتائج**")
269 | else:
270 | songname = search[0]
271 | title = search[0]
272 | url = search[1]
273 | duration = search[2]
274 | thumbnail = search[3]
275 | userid = m.from_user.id
276 | gcname = m.chat.title
277 | ctitle = await CHAT_TITLE(gcname)
278 | image = await thumb(thumbnail, title, userid, ctitle)
279 | veez, ytlink = await ytdl(url)
280 | if veez == 0:
281 | await loser.edit(f"❌ تم اكتشاف خطأ حاول مجددآ\n\n» `{ytlink}`")
282 | else:
283 | if chat_id in QUEUE:
284 | pos = add_to_queue(chat_id, songname, ytlink, url, "Video", Q)
285 | await loser.delete()
286 | requester = (
287 | f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
288 | )
289 | buttons = stream_markup(user_id)
290 | await m.reply_photo(
291 | photo=image,
292 | reply_markup=InlineKeyboardMarkup(buttons),
293 | caption=f"💡 **تمت إضافة المسار إلى قائمة الانتظار »** `{pos}`\n\n🏷 **الاسم:** [{songname}]({url})\n💭 **المجموعه:** `{chat_id}`\n💡 **الحالة:** `شغال`\n🎧 **طلب بواسطة:** {requester}",
294 | )
295 | else:
296 | try:
297 | await loser.edit("🔄 **جاري التشغيل انتظر قليلآ...**")
298 | await call_py.join_group_call(
299 | chat_id,
300 | AudioVideoPiped(
301 | ytlink,
302 | HighQualityAudio(),
303 | amaze,
304 | ),
305 | stream_type=StreamType().local_stream,
306 | )
307 | add_to_queue(chat_id, songname, ytlink, url, "Video", Q)
308 | await loser.delete()
309 | requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
310 | buttons = stream_markup(user_id)
311 | await m.reply_photo(
312 | photo=image,
313 | reply_markup=InlineKeyboardMarkup(buttons),
314 | caption=f"💡 **بدء تشغيل الفيديو.**\n\n🏷 **الاسم:** [{songname}]({url})\n💭 **المجموعه:** `{chat_id}`\n**⏱ المده:** `{duration}`\n🎧 **طلب بواسطة:** {requester}",
315 | )
316 | except Exception as ep:
317 | await loser.delete()
318 | await m.reply_text(f"🚫 خطأ: `{ep}`")
319 |
320 |
321 | @Client.on_message(command(["vstream", f"vstream@{BOT_USERNAME}"]) & other_filters)
322 | async def vstream(c: Client, m: Message):
323 | await m.delete()
324 | chat_id = m.chat.id
325 | user_id = m.from_user.id
326 | if m.sender_chat:
327 | return await m.reply_text(
328 | "you're an __Anonymous__ user !\n\n» revert back to your real user account to use this bot."
329 | )
330 | try:
331 | aing = await c.get_me()
332 | except Exception as e:
333 | return await m.reply_text(f"error:\n\n{e}")
334 | a = await c.get_chat_member(chat_id, aing.id)
335 | if a.status != "administrator":
336 | await m.reply_text(
337 | f"💡 لكي تستطيع استخدامي ارفعني **ادمن** مع **صلاحيات**:\n\n» ❌ __حذف الرسائل__\n» ❌ __اضافة المستخدمين__\n» ❌ __ادارة المكالمات المرئية__\n\n **يتم تحديث البوت تلقائي** "
338 | )
339 | return
340 | if not a.can_manage_voice_chats:
341 | await m.reply_text(
342 | "ليس لدي صلاحية:" + "\n\n» ❌ __ادارة المكالمات المرئية__"
343 | )
344 | return
345 | if not a.can_delete_messages:
346 | await m.reply_text(
347 | "ليس لدي صلاحية:" + "\n\n» ❌ __حذف الرسائل__"
348 | )
349 | return
350 | if not a.can_invite_users:
351 | await m.reply_text("ليس لدي صلاحية:" + "\n\n» ❌ __اضافة مستخدمين__")
352 | return
353 | try:
354 | ubot = (await user.get_me()).id
355 | b = await c.get_chat_member(chat_id, ubot)
356 | if b.status == "kicked":
357 | await c.unban_chat_member(chat_id, ubot)
358 | invitelink = await c.export_chat_invite_link(chat_id)
359 | if invitelink.startswith("https://t.me/+"):
360 | invitelink = invitelink.replace(
361 | "https://t.me/+", "https://t.me/joinchat/"
362 | )
363 | await user.join_chat(invitelink)
364 | except UserNotParticipant:
365 | try:
366 | invitelink = await c.export_chat_invite_link(chat_id)
367 | if invitelink.startswith("https://t.me/+"):
368 | invitelink = invitelink.replace(
369 | "https://t.me/+", "https://t.me/joinchat/"
370 | )
371 | await user.join_chat(invitelink)
372 | except UserAlreadyParticipant:
373 | pass
374 | except Exception as e:
375 | return await m.reply_text(
376 | f"❌ **فشل المساعد بالانضمام**\n\n**السبب**: `{e}`"
377 | )
378 |
379 | if len(m.command) < 2:
380 | await m.reply("» اعطني رابط مباشر للتشغيل")
381 | else:
382 | if len(m.command) == 2:
383 | link = m.text.split(None, 1)[1]
384 | Q = 720
385 | loser = await c.send_message(chat_id, "🔄 **تتم المعالجة انتظر قليلآ...**")
386 | elif len(m.command) == 3:
387 | op = m.text.split(None, 1)[1]
388 | link = op.split(None, 1)[0]
389 | quality = op.split(None, 1)[1]
390 | if quality == "720" or "480" or "360":
391 | Q = int(quality)
392 | else:
393 | Q = 720
394 | await m.reply(
395 | "» __فقط 720, 480, 360 مسموح__ \n💡 **الان يشتغل الفيديو في 720p**"
396 | )
397 | loser = await c.send_message(chat_id, "🔄 **تتم المعالجة انتظر قليلآ...**")
398 | else:
399 | await m.reply("**/vstream {link} {720/480/360}**")
400 |
401 | regex = r"^(https?\:\/\/)?(www\.youtube\.com|youtu\.?be)\/.+"
402 | match = re.match(regex, link)
403 | if match:
404 | veez, livelink = await ytdl(link)
405 | else:
406 | livelink = link
407 | veez = 1
408 |
409 | if veez == 0:
410 | await loser.edit(f"❌ تم اكتشاف خطأ حاول مجددآ\n\n» `{livelink}`")
411 | else:
412 | if chat_id in QUEUE:
413 | pos = add_to_queue(chat_id, "Live Stream", livelink, link, "Video", Q)
414 | await loser.delete()
415 | requester = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
416 | buttons = stream_markup(user_id)
417 | await m.reply_photo(
418 | photo=f"{IMG_1}",
419 | reply_markup=InlineKeyboardMarkup(buttons),
420 | caption=f"💡 **تمت إضافة المسار إلى قائمة الانتظار »** `{pos}`\n\n💭 **المجموعه:** `{chat_id}`\n🎧 **طلب بواسطة:** {requester}",
421 | )
422 | else:
423 | if Q == 720:
424 | amaze = HighQualityVideo()
425 | elif Q == 480:
426 | amaze = MediumQualityVideo()
427 | elif Q == 360:
428 | amaze = LowQualityVideo()
429 | try:
430 | await loser.edit("🔄 **جاري التشغيل انتظر قليلآ...**")
431 | await call_py.join_group_call(
432 | chat_id,
433 | AudioVideoPiped(
434 | livelink,
435 | HighQualityAudio(),
436 | amaze,
437 | ),
438 | stream_type=StreamType().live_stream,
439 | )
440 | add_to_queue(chat_id, "Live Stream", livelink, link, "Video", Q)
441 | await loser.delete()
442 | requester = (
443 | f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})"
444 | )
445 | buttons = stream_markup(user_id)
446 | await m.reply_photo(
447 | photo=f"{IMG_2}",
448 | reply_markup=InlineKeyboardMarkup(buttons),
449 | caption=f"💡 **[فيديو مباشر]({link}) بدء التشغيل**\n\n💭 **المجموعه:** `{chat_id}`\n💡 **الحالة:** `شغال`\n🎧 **طلب بواسطة:** {requester}",
450 | )
451 | except Exception as ep:
452 | await loser.delete()
453 | await m.reply_text(f"🚫 خطأ: `{ep}`")
454 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
676 | This repository is developed by Veez Music Team project, changing any code
677 | it's allowed, but removed an important credits named as veez music developer
678 | it's prohibited, our team will report your repository and your account to the
679 | GitHub communities to takedown your repository and banned your account too.
680 |
--------------------------------------------------------------------------------