From 1bfa3fa890af2c019603bdc38c01f9eea01c2d12 Mon Sep 17 00:00:00 2001 From: Zxce3 Date: Tue, 14 Sep 2021 06:47:34 +0700 Subject: [PATCH 01/24] Update README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d9581fb..20195b4 100644 --- a/README.md +++ b/README.md @@ -149,11 +149,13 @@ jobs: # Special Credits 💖 -- [Levina](https://github.com/levina-lab) Dev -- [Sammy-XD](https://github.com/Sammy-XD) Dev -- [Zxce3](https://github.com/Zxce3) Dev -- [Laky's](https://github.com/Laky-64) for [pytgcalls](https://github.com/MarshalX) -- [Dan](https://github.com/delivrance) for [Pyrogram](https://github.com/pyrogram) +- [Levina](https://github.com/levina-lab) ``Dev`` +- [Sammy-XD](https://github.com/Sammy-XD) ``Dev`` +- [Zxce3](https://github.com/Zxce3) ``Dev`` +- [DoellBarr](https://github.com/DoellBarr) ``Dev`` +- [tofikdn](https://github.com/tofikdn) ``Dev`` +- [Laky's](https://github.com/Laky-64) for [``pytgcalls``](https://github.com/MarshalX) +- [Dan](https://github.com/delivrance) for [``Pyrogram``](https://github.com/pyrogram) ### Support & Updates 🎑 From 517e1424dce2615414bebc3956aafd268f07ee7d Mon Sep 17 00:00:00 2001 From: Zxce3 Date: Tue, 14 Sep 2021 07:05:46 +0700 Subject: [PATCH 02/24] Sorry --- app.json | 1 - 1 file changed, 1 deletion(-) diff --git a/app.json b/app.json index aa64b8f..ea4cd5d 100644 --- a/app.json +++ b/app.json @@ -1,4 +1,3 @@ -// Copyright (C) 2021 By VeezMusicProject { "name": "Veez Video Stream Bot", From c0fb81ddbe741571b55e7ed28251fb6e7bd5ee96 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 10:08:25 +0700 Subject: [PATCH 03/24] status info --- bot/videoplayer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bot/videoplayer.py b/bot/videoplayer.py index bed3ad9..da05e39 100644 --- a/bot/videoplayer.py +++ b/bot/videoplayer.py @@ -209,10 +209,11 @@ async def stopvideo(client, m: Message): await m.reply(f"🚫 **error** | `{e}`") @call_py.on_stream_end() -async def handler(client: PyTgCalls, update: Update): +async def handler(client: PyTgCalls, update: Update, m: Message): LOG.info(f"called ended stream") chat_id = update.chat_id - await call_py.leave_group_call(chat_id) + await call_py.leave_group_call(chat_id) + await m.reply("✅ **successfully left vc !**") @Client.on_message(command(["cplay", f"cplay@{Veez.BOT_USERNAME}"]) & filters.group & ~filters.edited) From 8c4ba6accd94c84ba7d9d5789cd25357579fcec2 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 10:14:43 +0700 Subject: [PATCH 04/24] pre-commit --- .pre-commit-config.yaml | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..ee89e0f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,44 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-docstring-first + - id: check-yaml + - id: debug-statements + - id: double-quote-string-fixer + - id: requirements-txt-fixer + - repo: https://github.com/PyCQA/flake8 + rev: 3.9.2 + hooks: + - id: flake8 + additional_dependencies: [flake8-typing-imports==1.7.0] + - repo: https://github.com/pre-commit/mirrors-autopep8 + rev: v1.5.7 + hooks: + - id: autopep8 + - repo: https://github.com/asottile/reorder_python_imports + rev: v2.6.0 + hooks: + - id: reorder-python-imports + args: [--py3-plus] + - repo: https://github.com/asottile/add-trailing-comma + rev: v2.1.0 + hooks: + - id: add-trailing-comma + args: [--py36-plus] + - repo: https://github.com/asottile/pyupgrade + rev: v2.26.0 + hooks: + - id: pyupgrade + args: [--py36-plus] + - repo: https://github.com/asottile/setup-cfg-fmt + rev: v1.17.0 + hooks: + - id: setup-cfg-fmt + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.910 + hooks: + - id: mypy + additional_dependencies: [types-all] From c5f9a1130fa51262c6aa42ad515f466ee2baccd5 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 10:24:05 +0700 Subject: [PATCH 05/24] check #1 auto detection for missing object --- helpers/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/helpers/utils.py b/helpers/utils.py index ee89ffe..8e17202 100644 --- a/helpers/utils.py +++ b/helpers/utils.py @@ -1,8 +1,12 @@ # Copyright (C) 2021 By VeezMusicProject +import asyncio from youtube_dl import YoutubeDL from youtube_dl.utils import ExtractorError +SIGINT: int = 2 +FFMPEG_PROCESS = {} +call_py = PyTgCalls(app) ############### # Basic Utils # @@ -18,7 +22,7 @@ def raw_converter(dl, song, video): ) async def leave_call(chat_id: int): - process = FFMPEG_PROCESSES.get(chat_id) + process = FFMPEG_PROCESS.get(chat_id) if process: try: process.send_signal(SIGINT) @@ -41,4 +45,3 @@ def youtube(url: str): return None, None except Exception: return None, None - From b4e5d12fe49f03ea180e03c72b3e7c02555cdeda Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 10:29:48 +0700 Subject: [PATCH 06/24] check #2 auto detection for missing object --- helpers/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helpers/utils.py b/helpers/utils.py index 8e17202..1c104d1 100644 --- a/helpers/utils.py +++ b/helpers/utils.py @@ -3,10 +3,12 @@ import asyncio from youtube_dl import YoutubeDL from youtube_dl.utils import ExtractorError +from pytgcalls.pytgcalls import PyTgCalls SIGINT: int = 2 FFMPEG_PROCESS = {} call_py = PyTgCalls(app) +app = Client(Veez.SESSION_NAME, Veez.API_ID, Veez.API_HASH) ############### # Basic Utils # From 180bcdbfcb86c87911452540a8b54a79b1b5be3d Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 10:34:49 +0700 Subject: [PATCH 07/24] check #3 auto detection for missing object --- helpers/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/helpers/utils.py b/helpers/utils.py index 1c104d1..0326d6b 100644 --- a/helpers/utils.py +++ b/helpers/utils.py @@ -1,6 +1,7 @@ # Copyright (C) 2021 By VeezMusicProject import asyncio +from pyrogram import Client from youtube_dl import YoutubeDL from youtube_dl.utils import ExtractorError from pytgcalls.pytgcalls import PyTgCalls From 6b768fd8002e04394fc7a538f4bd83d587e6532c Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 10:37:45 +0700 Subject: [PATCH 08/24] check #4 auto detection for missing object --- helpers/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/helpers/utils.py b/helpers/utils.py index 0326d6b..d4debe2 100644 --- a/helpers/utils.py +++ b/helpers/utils.py @@ -1,6 +1,7 @@ # Copyright (C) 2021 By VeezMusicProject import asyncio +from config import Veez from pyrogram import Client from youtube_dl import YoutubeDL from youtube_dl.utils import ExtractorError From 9bfc332e3a79eaeeb732128caf6b94dea2f14bcb Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 12:02:03 +0700 Subject: [PATCH 10/24] fixes --- helpers/utils.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/helpers/utils.py b/helpers/utils.py index d4debe2..caf9bcf 100644 --- a/helpers/utils.py +++ b/helpers/utils.py @@ -1,16 +1,8 @@ # Copyright (C) 2021 By VeezMusicProject -import asyncio -from config import Veez -from pyrogram import Client from youtube_dl import YoutubeDL from youtube_dl.utils import ExtractorError -from pytgcalls.pytgcalls import PyTgCalls -SIGINT: int = 2 -FFMPEG_PROCESS = {} -call_py = PyTgCalls(app) -app = Client(Veez.SESSION_NAME, Veez.API_ID, Veez.API_HASH) ############### # Basic Utils # @@ -26,7 +18,7 @@ def raw_converter(dl, song, video): ) async def leave_call(chat_id: int): - process = FFMPEG_PROCESS.get(chat_id) + process = FFMPEG_PROCESSES.get(chat_id) if process: try: process.send_signal(SIGINT) From 16828c7991a083c5951eb758b3347eea19ad5a66 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 12:02:56 +0700 Subject: [PATCH 11/24] fixes --- bot/videoplayer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bot/videoplayer.py b/bot/videoplayer.py index da05e39..64064ba 100644 --- a/bot/videoplayer.py +++ b/bot/videoplayer.py @@ -209,11 +209,10 @@ async def stopvideo(client, m: Message): await m.reply(f"🚫 **error** | `{e}`") @call_py.on_stream_end() -async def handler(client: PyTgCalls, update: Update, m: Message): +async def handler(client: PyTgCalls, update: Update): LOG.info(f"called ended stream") chat_id = update.chat_id await call_py.leave_group_call(chat_id) - await m.reply("✅ **successfully left vc !**") @Client.on_message(command(["cplay", f"cplay@{Veez.BOT_USERNAME}"]) & filters.group & ~filters.edited) From 8f86780b899e8afbdb3ebb0663c6c410110b4e44 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 12:04:53 +0700 Subject: [PATCH 12/24] fixes --- helpers/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/utils.py b/helpers/utils.py index caf9bcf..445bedf 100644 --- a/helpers/utils.py +++ b/helpers/utils.py @@ -18,7 +18,7 @@ def raw_converter(dl, song, video): ) async def leave_call(chat_id: int): - process = FFMPEG_PROCESSES.get(chat_id) + process = FFMPEG_PROCESS.get(chat_id) if process: try: process.send_signal(SIGINT) From 77be0ecc0963d59e30147406c0c2e8fffbe63190 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 12:51:47 +0700 Subject: [PATCH 13/24] check #5 called function --- bot/__main__.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bot/__main__.py b/bot/__main__.py index 3697a94..afc21ba 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -66,11 +66,11 @@ if __name__ == '__main__': loop.run_until_complete(start()) -# bot.start() -# print("[STATUS]:✅ »» BOT CLIENT STARTED ««") -# app.start() -# print("[STATUS]:✅ »» USERBOT CLIENT STARTED ««") -# call_py.start() -# print("[STATUS]:✅ »» PYTGCALLS CLIENT STARTED ««") -# idle() -# print("[STATUS]:❌ »» BOT STOPPED ««") +bot.start() +print("[STATUS]:✅ »» BOT CLIENT STARTED ««") +app.start() +print("[STATUS]:✅ »» USERBOT CLIENT STARTED ««") +call_py.start() +print("[STATUS]:✅ »» PYTGCALLS CLIENT STARTED ««") +idle() +print("[STATUS]:❌ »» BOT STOPPED ««") From 84872e04e7f196885024cc3482ef355fe618f32d Mon Sep 17 00:00:00 2001 From: Shohih Abdul <50512936+DoellBarr@users.noreply.github.com> Date: Tue, 14 Sep 2021 13:41:26 +0700 Subject: [PATCH 14/24] Update song.py --- bot/song.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bot/song.py b/bot/song.py index 66bdc64..1ce1237 100644 --- a/bot/song.py +++ b/bot/song.py @@ -27,10 +27,7 @@ from helpers.decorators import humanbytes @Client.on_message(command(["song", f"song@{Veez.BOT_USERNAME}"]) & ~filters.channel) def song(_, message): - query = "" - for i in message.command[1:]: - query += " " + str(i) - print(query) + query = " ".join(message.command[1:]) m = message.reply("🔎 finding song...") ydl_ops = {"format": "bestaudio[ext=m4a]"} try: @@ -238,7 +235,7 @@ async def vsong(client, message): 'outtmpl':'%(title)s.%(ext)s', 'quite':True } - query = message.command[1] + query = " ".join(message.command[1:]) try: results = YoutubeSearch(query, max_results=1).to_dict() link = f"https://youtube.com{results[0]['url_suffix']}" From cc9b2b30eee9215492ead044045c00ff9772a056 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 14:21:33 +0700 Subject: [PATCH 15/24] no need again --- .pre-commit-config.yaml | 44 ----------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index ee89e0f..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,44 +0,0 @@ -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-docstring-first - - id: check-yaml - - id: debug-statements - - id: double-quote-string-fixer - - id: requirements-txt-fixer - - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 - hooks: - - id: flake8 - additional_dependencies: [flake8-typing-imports==1.7.0] - - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.5.7 - hooks: - - id: autopep8 - - repo: https://github.com/asottile/reorder_python_imports - rev: v2.6.0 - hooks: - - id: reorder-python-imports - args: [--py3-plus] - - repo: https://github.com/asottile/add-trailing-comma - rev: v2.1.0 - hooks: - - id: add-trailing-comma - args: [--py36-plus] - - repo: https://github.com/asottile/pyupgrade - rev: v2.26.0 - hooks: - - id: pyupgrade - args: [--py36-plus] - - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.17.0 - hooks: - - id: setup-cfg-fmt - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.910 - hooks: - - id: mypy - additional_dependencies: [types-all] From d87fa5379df54677de45ad1d9b717b55b77d47aa Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 14:48:23 +0700 Subject: [PATCH 16/24] . --- LICENSE | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index f288702..ec10009 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. @@ -672,3 +672,8 @@ may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . + + This repository is developed by Veez Music Team project, changing any code +it's allowed, but removed an important credits named as veez music developer +it's prohibited, our team will report your repository and your account to the +GitHub communities to takedown your repository and banned your account too. From bd89c0a0541f0c893af124c3eba8341ec879acaa Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 14:51:50 +0700 Subject: [PATCH 17/24] =?UTF-8?q?=F0=9F=94=B0=20Copyright=20(C)=202021=20V?= =?UTF-8?q?eezMusicProject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20195b4..5cd2a36 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ telegram bot project for streaming video on telegram video chat, powered by [py- 📝 Note: From now, /vstream & /vstop command can only be used by group admins. -## 🧪 Get STRING_SESSION from below: +## 🧪 Get SESSION_NAME from below: TAP THIS: [![GenerateString](https://img.shields.io/badge/repl.it-generateString-yellowgreen)](https://replit.com/@levinalab/StringSession#main.py) From 2deca1e5d16c7e490c86d6c1b715d6d95e599e4b Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 14:52:59 +0700 Subject: [PATCH 18/24] =?UTF-8?q?=F0=9F=94=B0=20Copyright=20(C)=202021=20V?= =?UTF-8?q?eezMusicProject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app.json b/app.json index ea4cd5d..01d6bb0 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,6 @@ - { "name": "Veez Video Stream Bot", - "description": "bot to stream video on telegram video chat, powered by pytgcalls and pyrogram", + "description": "telegram bot for streaming video trought the telegram group video chat, powered by pytgcalls and pyrogram", "logo": "https://telegra.ph/file/103a5208bb1698a8b33de.png", "keywords": [ "pytgcalls", From 59572aa33e595fd7efd28dd1edf927de3333eb7a Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 14:54:14 +0700 Subject: [PATCH 20/24] =?UTF-8?q?=F0=9F=94=B0=20Copyright=20(C)=202021=20V?= =?UTF-8?q?eezMusicProject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no need --- requirements.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 049b44d..ef00db2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,8 +5,6 @@ ffmpeg-python googletrans==4.0.0rc1 py-tgcalls==0.8.0 youtube_dl -pafy==0.5.5 -pytube==11.0.1 git+https://github.com/pyrogram/pyrogram@master youtube_search_python==1.4.6 youtube_search @@ -19,4 +17,4 @@ psutil future gTTS wget -yt_dlp \ No newline at end of file +yt_dlp From 06e65ad4483accbfdbac9e182585812330939918 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 14:56:49 +0700 Subject: [PATCH 23/24] =?UTF-8?q?=F0=9F=94=B0=20Copyright=20(C)=202021=20V?= =?UTF-8?q?eezMusicProject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sample.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample.env b/sample.env index 172a8a3..4bec0f0 100644 --- a/sample.env +++ b/sample.env @@ -1,13 +1,13 @@ # Your Session SESSION_NAME= -# Username Bot +# Your Bot username without @ BOT_USERNAME= # Bot TOKEN from @botfather BOT_TOKEN= -# Your BOT NAME +# Your 2nd account username without @ ASSISTANT_NAME= # Your API ID from my.telegram.org From 628ccba706b456610112b6da13c4c2fa9f0bc9a3 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Tue, 14 Sep 2021 15:03:18 +0700 Subject: [PATCH 24/24] code-owner --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..1f41649 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @levina-lab