Skip to content

Commit

Permalink
Introduced Yukki Docs, Updated README, Optimised System Stats Module,…
Browse files Browse the repository at this point in the history
… Fixed Song Download Module
  • Loading branch information
NotReallyShikhar committed Jan 8, 2022
1 parent 35a9624 commit 3384b30
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 125 deletions.
124 changes: 66 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,95 @@
<h1 align= center><b>⭐️ Yukki Music Bot ⭐️</b></h1>
<h3 align = center> Multi-Assistant | Video Calls | Voice Calls | Heroku Supported</h3>
<p align="center"><img src="https://github.com/notreallyshikhar/YukkiMusicBot/blob/main/Utils/icon.gif" alt="ICON" width="250" height="250"/></p>

<h4 align="center">
A Telegram Music+Video Bot written in Python using Pyrogram and Py-Tgcalls
</h4>
<p align="center">
<a href="https://python.org"><img src="http://forthebadge.com/images/badges/made-with-python.svg" alt="made-with-python"></a>
<br>
<img src="https://img.shields.io/github/license/notreallyshikhar/YukkiMusicBot?style=for-the-badge" alt="LICENSE">
<img src="https://img.shields.io/github/contributors/notreallyshikhar/YukkiMusicBot?style=for-the-badge" alt="Contributors">
<img src="https://img.shields.io/github/repo-size/notreallyshikhar/YukkiMusicBot?style=for-the-badge" alt="Repository Size"> <br>
<img src="https://img.shields.io/github/forks/notreallyshikhar/YukkiMusicBot?style=for-the-badge" alt="Forks">
<img src="https://img.shields.io/github/stars/notreallyshikhar/YukkiMusicBot?style=for-the-badge" alt="Stars">
<img src="https://img.shields.io/github/watchers/notreallyshikhar/YukkiMusicBot?style=for-the-badge" alt="Watchers">
<img src="https://img.shields.io/github/commit-activity/w/notreallyshikhar/YukkiMusicBot?style=for-the-badge" alt="Commit Activity">
<img src="https://img.shields.io/github/issues/notreallyshikhar/YukkiMusicBot?style=for-the-badge" alt="Issues">
</p>

<h3 align="center">
Ready to use method
</h3>

<p align="center">
A Support Group and ready-to-use running instance of this bot can be found on Telegram <br>
<a href="https://t.me/YukkiRobot"> YukkiMusicBot </a> |
<a href="https://t.me/OfficialYukkiSupport"> YukkiSupport </a>
<a href="https://t.me/YukkiRobot"> Ready-To-Use Bot </a> •
<a href="https://notreallyshikhar.gitbook.io/yukkimusicbot/about/getting-started"> Documentation </a> •
<a href="https://t.me/OfficialYukki"> Support Channel </a> •
<a href="https://t.me/YukkiSupport"> Support Chat </a>
</p>

<h1 align="center">
Deployment
</h1>
# Yukki Music Bot
A Powerful Telegram Music+Video Bot by which you can stream songs, video and even live streams in your group calls via various sources. It comes with a user friendly and easy to use yet elegant features.

## 🔗 Requirements
## Deployment
Read [Docs](https://notreallyshikhar.gitbook.io/yukkimusicbot/deployment/requirements) for Detailed Description and Setup Guide on deloying Bot.

> Click on buttons to expand!
<details>
<summary><b>🔗 Requirements</b></summary>
<br>
- [Python3.9](https://www.python.org/downloads/release/python-390/)
- [Telegram API Key](https://docs.pyrogram.org/intro/setup#api-keys)
- [Telegram Bot Token](https://t.me/botfather)
- [MongoDB URI](https://telegra.ph/How-To-get-Mongodb-URI-04-06)
- [Pyrogram String Session](https://notreallyshikhar.gitbook.io/yukkimusicbot/deployment/string-session)

</details>

<details>
<summary><b>🔗 String Session</b></summary>
<br>

> You'll need a [API_ID](https://notreallyshikhar.gitbook.io/yukkimusicbot/vars/mandatory-vars#1.-api_id) & [API_HASH](https://notreallyshikhar.gitbook.io/yukkimusicbot/vars/mandatory-vars#2.-api_hash) in order to generate pyrogram session.
> Always remeber to use good API combo else your account could be deleted.
## 🔗 Install Locally or On a VPS(Debian based)
<h4> Generate Session via Repl: </h4>
<p><a href="https://replit.com/@NotReallyShikhar/Yukki-Music-String-Gen"><img src="https://img.shields.io/badge/Generate%20On%20Repl-blueviolet?style=for-the-badge&logo=appveyor" width="200""/></a></p>

```console
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install python3-pip ffmpeg -y
sudo pip3 install -U pip
curl -fssL https://deb.nodesource.com/setup_17.x | sudo -E bash -
sudo apt-get install nodejs -y
npm i -g npm
git clone https://github.com/notreallyshikhar/YukkiMusicBot
cd YukkiMusicBot
pip3 install -U -r requirements.txt
cp sample.env .env
```
<h4> Generate Session via Telegram StringGen Bot: </h4>
<p><a href="https://t.me/YukkiStringBot"><img src="https://img.shields.io/badge/TG%20String%20Gen%20Bot-blueviolet?style=for-the-badge&logo=appveyor" width="200""/></a></p>

</details>

- Edit <b>.env</b> with your own values and Run Bot
<details>
<summary><b>🔗 Deploy to Heroku</b></summary>
<br>

> Heroku has two vars[ HEROKU_API_KEY & HEROKU_APP_NAME ] for Updater to work.
> By setting those two vars you can get logs of your heroku app, set var, edit var, delete vars , check dyno usage and update bot.
> Those two vars are not Mandatory! You can leave them blank too.
<h4>Click the button below to deploy Yukki on Heroku!</h4>
<p><a href="https://heroku.com/deploy"><img src="https://img.shields.io/badge/Deploy%20To%20Heroku-blueviolet?style=for-the-badge&logo=heroku" width="200""/></a></p>

</details>

<details>
<summary><b>🔗 Deploy to VPS</b></summary>
<br>

> Checkout [Docs](https://notreallyshikhar.gitbook.io/yukkimusicbot/deployment/local-hosting-or-vps) for Detailed Explanation on VPS Deploy

```console
shikhar@MacBook~ $ git clone https://github.com/notreallyshikhar/YukkiMusicBot
shikhar@MacBook~ $ cd YukkiMusicBot
shikhar@MacBook~ $ pip3 install -U -r requirements.txt
shikhar@MacBook~ $ cp sample.env .env
```
> Edit .env with your values and then start bot with
```console
bash start
shikhar@MacBook~ $ bash start
```

## 🔗 Deploy on Heroku
<p>
<a href="https://heroku.com/deploy"><img src="https://img.shields.io/badge/Deploy%20To%20Heroku-blueviolet?style=for-the-badge&logo=heroku" width="250""/</a> </p>
> Not Getting VPS Method? [Watch Tutorial](https://t.me/OfficialYukki/2275)
</details>
## 🔗 Generating Pyrogram Session
<p>
<a href="https://replit.com/@NotReallyShikhar/Yukki-Music-String-Gen"><img src="https://img.shields.io/badge/Generate%20On%20Repl-blueviolet?style=for-the-badge&logo=appveyor" width="245""/></a>
<a href="https://t.me/YukkiStringBot"><img src="https://img.shields.io/badge/TG%20String%20Gen%20Bot-blueviolet?style=for-the-badge&logo=appveyor" width="245""/></a></p>
## Config Vars

## Contact & Support
- Checkout All [Available Vars](https://notreallyshikhar.gitbook.io/yukkimusicbot/vars/available-vars)
- Checkout Only [Mandatory Vars](https://notreallyshikhar.gitbook.io/yukkimusicbot/vars/mandatory-vars)
- Checkout Some [Configs](https://notreallyshikhar.gitbook.io/yukkimusicbot/setup-config/config)

## Contact & Support

- [Telegram Channel](https://t.me/OfficialYukki")
- [Telegram Support Group](https://t.me/OfficialYukkiSupport)
- [Contact Owner](https://t.me/NotReallyShikhar)

## Why Yukki?

- Light and Fast Responsive
- Includes Multi-Assistant Mode where you can use 5 Assistant Accounts for large number of chats.
- Mongo DB based Queues, Playlists, Chats.
- Video Calls and Voice Calls Merged with a single command.
- Live Timer Progress Bar for playouts in a interactive inline mode.
- Heroku-Supported Added including vars addition, deletion, getting logs etc.
- Interactive UI, fonts and thumbnails.

## License

Expand Down
Binary file added Utils/icon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Utils/screen.png
Binary file not shown.
Binary file removed Utils/star.gif
Binary file not shown.
10 changes: 8 additions & 2 deletions Yukki/Plugins/Download.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ async def getspy(_, CallbackQuery):
callback_request = callback_data.split(None, 1)[1]
type, videoid, user_id = callback_request.split("|")
key = await get_formats(CallbackQuery, videoid, user_id, type)
await CallbackQuery.edit_message_reply_markup(reply_markup=key)
try:
await CallbackQuery.edit_message_reply_markup(reply_markup=key)
except:
pass


@app.on_callback_query(filters.regex(pattern=r"ytdata"))
Expand All @@ -61,7 +64,10 @@ async def ytdata(_, CallbackQuery):
type, format, videoid = callback_request.split("||")
user_id = CallbackQuery.from_user.id
key = get_type(type, format, videoid, user_id)
await CallbackQuery.edit_message_reply_markup(reply_markup=key)
try:
await CallbackQuery.edit_message_reply_markup(reply_markup=key)
except:
pass


inl = InlineKeyboardMarkup(
Expand Down
25 changes: 22 additions & 3 deletions Yukki/Plugins/Stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,18 @@ async def stats_markup(_, CallbackQuery):
await CallbackQuery.answer("Getting System Stats...", show_alert=True)
sc = platform.system()
arch = platform.machine()
cpu_count = multiprocessing.cpu_count()
p_core = psutil.cpu_count(logical=False)
t_core = psutil.cpu_count(logical=True)
cpu_freq = psutil.cpu_freq().current
if cpu_freq >= 1000:
cpu_freq = f"{round(cpu_freq / 1000, 2)}GHz"
else:
cpu_freq = f"{round(cpu_freq, 2)}MHz"
cupc = "**CPU Usage Per Core:**\n"
for i, percentage in enumerate(psutil.cpu_percent(percpu=True)):
cupc += f"Core {i} : {percentage}%\n"
cupc += "**Total CPU Usage:**\n"
cupc += f"All Cores Usage: {psutil.cpu_percent()}%\n"
ram = (
str(round(psutil.virtual_memory().total / (1024.0 ** 3))) + " GB"
)
Expand All @@ -96,10 +107,18 @@ async def stats_markup(_, CallbackQuery):
**System Proc:** Online
**Platform:** {sc}
**Architecture:** {arch}
**CPUs:** {cpu_count}v
**Ram:** {ram}
**Python Ver:** {pyver.split()[0]}
**Pyrogram Ver:** {pyrover}"""
**Pyrogram Ver:** {pyrover}
[•]<u>**CPU Stats**</u>
**Physical Cores:** {p_core}
**Total Cores:** {t_core}
**Cpu Frequency:** {cpu_freq}
{cupc}
"""
await CallbackQuery.edit_message_text(smex, reply_markup=stats2)
if command == "sto_stats":
await CallbackQuery.answer(
Expand Down
2 changes: 0 additions & 2 deletions Yukki/Plugins/Stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,12 @@ async def choose_playmode(_, CallbackQuery):
@app.on_callback_query(filters.regex(pattern=r"Choose"))
async def quality_markup(_, CallbackQuery):
limit = await get_video_limit(141414)
print(limit)
if not limit:
await CallbackQuery.message.delete()
return await CallbackQuery.message.reply_text(
"**No Limit Defined for Video Calls**\n\nSet a Limit for Number of Maximum Video Calls allowed on Bot by /set_video_limit [Sudo Users Only]"
)
count = len(await get_active_video_chats())
print(count)
if int(count) == int(limit):
if await is_active_video_chat(CallbackQuery.message.chat.id):
pass
Expand Down
8 changes: 4 additions & 4 deletions Yukki/Utilities/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def get_formats(CallbackQuery, videoid, user_id, type):
formats = YT_info(url)
except Exception:
return await CallbackQuery.message.reply_text(
"Failed To Fetch Data..."
"Failed To Fetch Data from YT...Could be YTDL issue."
)
j = 0
for x in formats:
Expand Down Expand Up @@ -120,11 +120,11 @@ async def get_formats(CallbackQuery, videoid, user_id, type):
)
else:
return await CallbackQuery.message.reply_text(
"Video Format Not Found."
"Video Formats Not Found. Try Searching Other Music"
)
if j == 0:
return await CallbackQuery.message.reply_text(
"Video Format Not Found.."
"Video Formats Not Found. Try Searching Other Music"
)
elif j == 1:
key = InlineKeyboardMarkup(
Expand Down Expand Up @@ -257,7 +257,7 @@ async def get_formats(CallbackQuery, videoid, user_id, type):
)
else:
return await CallbackQuery.message.reply_text(
"Video Format Not Found...."
"Video Formats Not Found. Try Searching Other Music"
)
return key

Expand Down
2 changes: 1 addition & 1 deletion Yukki/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ async def initiate_bot():

home_text_pm = f"""Hello ,
My name is {BOT_NAME}.
I'm Telegram Voice Chat Audio with some useful features.
A Telegram Music+Video Streaming bot with some useful features.
All commands can be used with: / """

Expand Down
11 changes: 9 additions & 2 deletions gen_session.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import asyncio

from pyrogram import Client as c

API_ID = input("\nEnter Your API_ID:\n > ")
Expand All @@ -7,7 +9,12 @@

i = c(":memory:", api_id=API_ID, api_hash=API_HASH)

with i:
ss = i.export_session_string()

async def main():
await i.start()
ss = await i.export_session_string()
print("\nHERE IS YOUR STRING SESSION, COPY IT, DON'T SHARE!!\n")
print(f"\n{ss}\n")


asyncio.run(main())
66 changes: 13 additions & 53 deletions sample.env
Original file line number Diff line number Diff line change
@@ -1,53 +1,13 @@
STRING_SESSION1 = "" # A pyrogram String Session
STRING_SESSION2 = ""
STRING_SESSION3 = ""
STRING_SESSION4 = ""
STRING_SESSION5 = ""

LOG_SESSION = ""


BOT_TOKEN= "" Get a token from @botFather

API_ID= "" Get this value from https://my.telegram.org

API_HASH= "" Get this value from https://my.telegram.org

SUDO_USERS = "" # For multiple Users Use Space

DURATION_LIMIT= "" # In Mins (EX :- 60)

MONGO_DB_URI = "" # Mongo DB URL

LOG_GROUP_ID = "" # Chat id of a group, not channel

MUSIC_BOT_NAME = "" # Name for your music bot

OWNER_ID = "" Owner id

SUPPORT_CHANNEL = "" # Support Channel Link if you have any, Leave blank if no support. Your link must start with https://t.me/

SUPPORT_GROUP = "" #Support Group Link if you have any, Leave blank if no support. Your link must start with https://t.me/

ASSISTANT_PREFIX ="" #Prefix for Assistant Commands.

PING_IMG = "" #Telegraph link of image for ping




### Remove all lines from here including this line too

### Don't use "" for your vars.
### Remove description lines we've written


A simple Example:-

API_ID=18301
API_HASH=jdks92djw092id
BOT_TOKEN=8902jd:84902jd

and so on....

###Remove all extra lines and don't use "".
STRING_SESSION1 = PYROGRAMSESSION
API_ID = 6
API_HASH = eb06d4abfb49dc3eeb1aeb98ae0f581e
BOT_TOKEN = 504729834470:AAHidqz_M26xIem_Cn4Hs3BHrIokG1W43bo
SUDO_USERS = 18920183 39103921
MONGO_DB_URI = mongodb+srv://a:[email protected]/a?retryWrites=a&w=majority
LOG_GROUP_ID = -1003209382042
MUSIC_BOT_NAME = Yukki
OWNER_ID = 482049203
DURATION_LIMIT = 90
SUPPORT_CHANNEL = https://t.me/OfficialYukki
SUPPORT_GROUP = https://t.me/YukkiSupport
ASSISTANT_PREFIX = !

0 comments on commit 3384b30

Please sign in to comment.