forked from Dheeru20020/VcVideoPlayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e200ab0
Showing
8 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3.9 | ||
|
||
RUN apt update && apt upgrade -y | ||
RUN apt install python3-pip -y | ||
RUN apt install ffmpeg -y | ||
|
||
COPY . /innexia | ||
WORKDIR /innexia | ||
|
||
RUN pip3 install --upgrade pip | ||
RUN pip3 install -U -r requirements.txt | ||
|
||
CMD python3 -m player |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
worker: python3 -m player |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# VC Video Player | ||
|
||
<a href="https://t.me/SiderzBot"><img src="https://img.shields.io/badge/Join-Telegram%20Channel-red.svg?logo=Telegram"></a> | ||
<a href="t.me/SiderzChat"><img src="https://img.shields.io/badge/Join-Telegram%20Group-blue.svg?logo=telegram"></a> | ||
|
||
# How To Host | ||
[![Deploy+on+Railway](https://railway.app/button.svg)](https://railway.app/new/template?template=https://github.com/Sammy-XD/VcVideoPlayer&envs=API_ID,API_HASH,BOT_TOKEN,SESSION_NAME) | ||
|
||
|
||
# Credit 🔥 | ||
``` | ||
|🇮🇳 Louis | ||
|🇮🇳 Sammy | ||
|🇮🇳 Blaze | ||
``` | ||
- [MarshalX](https://github.com/MarshalX) for [pytgcalls](https://github.com/MarshalX/tgcalls) | ||
- [Dan](https://github.com/delivrance) for [Pyrogram](https://github.com/pyrogram/pyrogram) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import os | ||
|
||
API_ID = int(os.getenv("API_ID", "6")) | ||
API_HASH = os.getenv("API_HASH", "eb06d4abfb49dc3eeb1aeb98ae0f581e") | ||
BOT_TOKEN = os.getenv("BOT_TOKEN") | ||
SESSION_NAME = os.getenv("SESSION_NAME") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from pyrogram import Client, idle | ||
from config import API_ID, API_HASH, BOT_TOKEN | ||
from player.videoplayer import app | ||
|
||
bot = Client( | ||
":memory:", | ||
API_ID, | ||
API_HASH, | ||
bot_token=BOT_TOKEN, | ||
plugins=dict(root="player"), | ||
) | ||
|
||
bot.start() | ||
app.start() | ||
idle() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from pyrogram import Client, filters | ||
from pyrogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup | ||
|
||
@Client.on_message(filters.command("start")) | ||
async def start(client, m: Message): | ||
if m.chat.type == 'private': | ||
await m.reply(f"**Hey, I'm a VC Video Player developed by Developers of** @SiderzBot \n\n**To use it:-** __ \n1) Add this Bot to your Group and Make it Admin \n2) Add__ @SiderzVideoPlayer __to your Group__ \n3) **Commands** : \n`/stream` (IN REPLY TO A VIDEO) \n`/stop`", | ||
reply_markup=InlineKeyboardMarkup( | ||
[[ | ||
InlineKeyboardButton( | ||
"Support", url="t.me/SiderzChat") | ||
]] | ||
)) | ||
else: | ||
await m.reply("**SiderzStreamBot is Alive! ✨**") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import os | ||
import asyncio | ||
from pytgcalls import GroupCallFactory | ||
from pyrogram import Client, filters | ||
from pyrogram.types import Message | ||
from config import API_ID, API_HASH, SESSION_NAME | ||
|
||
app = Client(SESSION_NAME, API_ID, API_HASH) | ||
group_call_factory = GroupCallFactory(app, GroupCallFactory.MTPROTO_CLIENT_TYPE.PYROGRAM) | ||
VIDEO_CALL = {} | ||
|
||
|
||
@Client.on_message(filters.command("stream")) | ||
async def stream(client, m: Message): | ||
replied = m.reply_to_message | ||
if not replied: | ||
await m.reply("`Reply to some Video!`") | ||
elif replied.video or replied.document: | ||
msg = await m.reply("`Downloading...`") | ||
chat_id = m.chat.id | ||
try: | ||
video = await client.download_media(m.reply_to_message) | ||
await msg.edit("`Converting...`") | ||
os.system(f'ffmpeg -i "{video}" -vn -f s16le -ac 2 -ar 48000 -acodec pcm_s16le -filter:a "atempo=0.81" vid-{chat_id}.raw -y') | ||
except Exception as e: | ||
await msg.edit(f"**🚫 Error** - `{e}`") | ||
await asyncio.sleep(5) | ||
try: | ||
group_call = group_call_factory.get_file_group_call(f'vid-{chat_id}.raw') | ||
await group_call.start(chat_id) | ||
await group_call.set_video_capture(video) | ||
VIDEO_CALL[chat_id] = group_call | ||
await msg.edit("**▶️ Started Streaming!**") | ||
except Exception as e: | ||
await msg.edit(f"**Error** -- `{e}`") | ||
else: | ||
await m.reply("`Reply to some Video!`") | ||
|
||
@Client.on_message(filters.command("stop")) | ||
async def stopvideo(client, m: Message): | ||
chat_id = m.chat.id | ||
try: | ||
await VIDEO_CALL[chat_id].stop() | ||
await m.reply("**⏹️ Stopped Streaming!**") | ||
except Exception as e: | ||
await m.reply(f"**🚫 Error** - `{e}`") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
TgCrypto | ||
ffmpeg-python | ||
git+https://github.com/pyrogram/pyrogram@master | ||
pytgcalls==3.0.0.dev10 |