Skip to content

Commit

Permalink
refactor: bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmaialva33 committed Sep 25, 2024
1 parent 1c01ca7 commit 2290e91
Show file tree
Hide file tree
Showing 75 changed files with 308 additions and 322 deletions.
12 changes: 6 additions & 6 deletions WinxMusic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
from pytgcalls.exceptions import NoActiveGroupCall

import config
from config import BANNED_USERS
from WinxMusic import HELPABLE, LOGGER, app, userbot
from WinxMusic.core.call import Winx
from WinxMusic.plugins import ALL_MODULES
from WinxMusic.utils.database import get_banned_users, get_gbanned
from config import BANNED_USERS


async def init():
if (
not config.STRING1
and not config.STRING2
and not config.STRING3
and not config.STRING4
and not config.STRING5
not config.STRING1
and not config.STRING2
and not config.STRING3
and not config.STRING4
and not config.STRING5
):
LOGGER("WinxMusic").error(
"No Assistant Clients Vars Defined!.. Exiting Process."
Expand Down
24 changes: 12 additions & 12 deletions WinxMusic/core/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
)

import config
from strings import get_string
from WinxMusic import LOGGER, YouTube, app
from WinxMusic.misc import db
from WinxMusic.utils.database import (
Expand All @@ -36,6 +35,7 @@
from WinxMusic.utils.inline.play import stream_markup, telegram_markup
from WinxMusic.utils.stream.autoclear import auto_clean
from WinxMusic.utils.thumbnails import gen_thumb
from strings import get_string


async def _clear_(chat_id):
Expand Down Expand Up @@ -145,11 +145,11 @@ async def force_stop_stream(self, chat_id: int):
pass

async def skip_stream(
self,
chat_id: int,
link: str,
video: Union[bool, str] = None,
image: Union[bool, str] = None,
self,
chat_id: int,
link: str,
video: Union[bool, str] = None,
image: Union[bool, str] = None,
):
assistant = await group_assistant(self, chat_id)
audio_stream_quality = await get_audio_bitrate(chat_id)
Expand Down Expand Up @@ -206,12 +206,12 @@ async def stream_call(self, link):
await assistant.leave_call(config.LOG_GROUP_ID)

async def join_call(
self,
chat_id: int,
original_chat_id: int,
link,
video: Union[bool, str] = None,
image: Union[bool, str] = None,
self,
chat_id: int,
original_chat_id: int,
link,
video: Union[bool, str] = None,
image: Union[bool, str] = None,
):
assistant = await group_assistant(self, chat_id)
audio_stream_quality = await get_audio_bitrate(chat_id)
Expand Down
12 changes: 6 additions & 6 deletions WinxMusic/core/dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ def dirr():

for file in os.listdir():
if (
file.endswith(".jpg")
or file.endswith(".jpeg")
or file.endswith(".mp3")
or file.endswith(".png")
or file.endswith(".session")
or file.endswith(".session-journal")
file.endswith(".jpg")
or file.endswith(".jpeg")
or file.endswith(".mp3")
or file.endswith(".png")
or file.endswith(".session")
or file.endswith(".session-journal")
):
os.remove(file)

Expand Down
3 changes: 1 addition & 2 deletions WinxMusic/core/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import shlex
from typing import Tuple

from git import Repo
from git.exc import GitCommandError, InvalidGitRepositoryError

import config

from git import Repo
from ..logging import LOGGER

loop = asyncio.get_event_loop_policy().get_event_loop()
Expand Down
1 change: 0 additions & 1 deletion WinxMusic/core/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from pyrogram import Client

import config

from ..logging import LOGGER

TEMP_MONGODB = "mongodb+srv://adityapatel:[email protected]/?retryWrites=true&w=majority"
Expand Down
1 change: 0 additions & 1 deletion WinxMusic/core/userbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from pyrogram import Client

import config

from ..logging import LOGGER

assistants = []
Expand Down
1 change: 0 additions & 1 deletion WinxMusic/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import config
from WinxMusic.core.mongo import pymongodb

from .logging import LOGGER

SUDOERS = filters.user()
Expand Down
2 changes: 1 addition & 1 deletion WinxMusic/platforms/Carbon.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(self):

async def generate(self, text: str, user_id):
async with aiohttp.ClientSession(
headers={"Content-Type": "application/json"},
headers={"Content-Type": "application/json"},
) as ses:
params = {
"code": text,
Expand Down
31 changes: 15 additions & 16 deletions WinxMusic/platforms/Telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Voice

import config
from config import lyrical
from WinxMusic import app

from config import lyrical
from ..utils.formatters import convert_bytes, get_readable_time, seconds_to_min

downloader = {}
Expand All @@ -23,7 +22,7 @@ def __init__(self):

async def send_split_text(self, message, string):
n = self.chars_limit
out = [(string[i : i + n]) for i in range(0, len(string), n)]
out = [(string[i: i + n]) for i in range(0, len(string), n)]
j = 0
for x in out:
if j <= 2:
Expand Down Expand Up @@ -57,28 +56,28 @@ async def get_duration(self, file):
return dur

async def get_filepath(
self,
audio: Union[bool, str] = None,
video: Union[bool, str] = None,
self,
audio: Union[bool, str] = None,
video: Union[bool, str] = None,
):
if audio:
try:
file_name = (
audio.file_unique_id
+ "."
+ (
(audio.file_name.split(".")[-1])
if (not isinstance(audio, Voice))
else "ogg"
)
audio.file_unique_id
+ "."
+ (
(audio.file_name.split(".")[-1])
if (not isinstance(audio, Voice))
else "ogg"
)
)
except:
file_name = audio.file_unique_id + "." + ".ogg"
file_name = os.path.join(os.path.realpath("downloads"), file_name)
if video:
try:
file_name = (
video.file_unique_id + "." + (video.file_name.split(".")[-1])
video.file_unique_id + "." + (video.file_name.split(".")[-1])
)
except:
file_name = video.file_unique_id + "." + "mp4"
Expand All @@ -92,8 +91,8 @@ async def is_streamable_url(self, url: str) -> bool:
if response.status_code == 200:
content_type = response.headers.get("Content-Type", "")
if (
"application/vnd.apple.mpegurl" in content_type
or "application/x-mpegURL" in content_type
"application/vnd.apple.mpegurl" in content_type
or "application/x-mpegURL" in content_type
):
return True
if url.endswith(".m3u8") or url.endswith(".index"):
Expand Down
28 changes: 14 additions & 14 deletions WinxMusic/platforms/Youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ async def url(self, message_1: Message) -> Union[str, None]:
return entity.url
if offset in (None,):
return None
return text[offset : offset + length]
return text[offset: offset + length]

async def details(self, link: str, videoid: Union[bool, str] = None):
if videoid:
Expand Down Expand Up @@ -309,10 +309,10 @@ async def formats(self, link: str, videoid: Union[bool, str] = None):
return formats_available, link

async def slider(
self,
link: str,
query_type: int,
videoid: Union[bool, str] = None,
self,
link: str,
query_type: int,
videoid: Union[bool, str] = None,
):
if videoid:
link = self.base + link
Expand All @@ -327,15 +327,15 @@ async def slider(
return title, duration_min, thumbnail, vidid

async def download(
self,
link: str,
mystic,
video: Union[bool, str] = None,
videoid: Union[bool, str] = None,
songaudio: Union[bool, str] = None,
songvideo: Union[bool, str] = None,
format_id: Union[bool, str] = None,
title: Union[bool, str] = None,
self,
link: str,
mystic,
video: Union[bool, str] = None,
videoid: Union[bool, str] = None,
songaudio: Union[bool, str] = None,
songvideo: Union[bool, str] = None,
format_id: Union[bool, str] = None,
title: Union[bool, str] = None,
) -> str:
if videoid:
vidid = link
Expand Down
2 changes: 1 addition & 1 deletion WinxMusic/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import sys
from os.path import abspath, dirname, isfile, join

from config import EXTRA_PLUGINS, EXTRA_PLUGINS_FOLDER, EXTRA_PLUGINS_REPO
from WinxMusic import LOGGER
from config import EXTRA_PLUGINS, EXTRA_PLUGINS_FOLDER, EXTRA_PLUGINS_REPO

logger = LOGGER(__name__)

Expand Down
4 changes: 2 additions & 2 deletions WinxMusic/plugins/admins/auth.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from pyrogram import Client, filters
from pyrogram.types import Message

from config import BANNED_USERS, adminlist
from strings import get_command
from WinxMusic import app
from WinxMusic.utils.database import (
delete_authuser,
Expand All @@ -12,6 +10,8 @@
)
from WinxMusic.utils.decorators import AdminActual, language
from WinxMusic.utils.formatters import int_to_alpha
from config import BANNED_USERS, adminlist
from strings import get_command

AUTH_COMMAND = get_command("AUTH_COMMAND")
UNAUTH_COMMAND = get_command("UNAUTH_COMMAND")
Expand Down
18 changes: 9 additions & 9 deletions WinxMusic/plugins/admins/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@
from pyrogram import Client, filters
from pyrogram.types import CallbackQuery, InlineKeyboardMarkup

from config import (
BANNED_USERS,
SOUNCLOUD_IMG_URL,
STREAM_IMG_URL,
SUPPORT_GROUP,
TELEGRAM_AUDIO_URL,
TELEGRAM_VIDEO_URL,
adminlist,
)
from WinxMusic import YouTube, app
from WinxMusic.core.call import Winx
from WinxMusic.misc import SUDOERS, db
Expand All @@ -31,6 +22,15 @@
from WinxMusic.utils.inline.play import stream_markup, telegram_markup
from WinxMusic.utils.stream.autoclear import auto_clean
from WinxMusic.utils.thumbnails import gen_thumb
from config import (
BANNED_USERS,
SOUNCLOUD_IMG_URL,
STREAM_IMG_URL,
SUPPORT_GROUP,
TELEGRAM_AUDIO_URL,
TELEGRAM_VIDEO_URL,
adminlist,
)

wrong = {}
down_vote = {}
Expand Down
4 changes: 2 additions & 2 deletions WinxMusic/plugins/admins/loop.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from pyrogram import Client, filters
from pyrogram.types import Message

from config import BANNED_USERS
from strings import get_command
from WinxMusic import app
from WinxMusic.utils.database.memorydatabase import get_loop, set_loop
from WinxMusic.utils.decorators import AdminRightsCheck
from config import BANNED_USERS
from strings import get_command

LOOP_COMMAND = get_command("LOOP_COMMAND")

Expand Down
4 changes: 2 additions & 2 deletions WinxMusic/plugins/admins/pause.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from pyrogram import Client, filters
from pyrogram.types import Message

from config import BANNED_USERS
from strings import get_command
from WinxMusic import app
from WinxMusic.core.call import Winx
from WinxMusic.utils.database import is_music_playing, music_off
from WinxMusic.utils.decorators import AdminRightsCheck
from config import BANNED_USERS
from strings import get_command

PAUSE_COMMAND = get_command("PAUSE_COMMAND")

Expand Down
4 changes: 2 additions & 2 deletions WinxMusic/plugins/admins/resume.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from pyrogram import Client, filters
from pyrogram.types import Message

from config import BANNED_USERS
from strings import get_command
from WinxMusic import app
from WinxMusic.core.call import Winx
from WinxMusic.utils.database import is_music_playing, music_on
from WinxMusic.utils.decorators import AdminRightsCheck
from config import BANNED_USERS
from strings import get_command

RESUME_COMMAND = get_command("RESUME_COMMAND")

Expand Down
4 changes: 2 additions & 2 deletions WinxMusic/plugins/admins/seek.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from pyrogram import Client, filters
from pyrogram.types import Message

from config import BANNED_USERS
from strings import get_command
from WinxMusic import YouTube, app
from WinxMusic.core.call import Winx
from WinxMusic.misc import db
from WinxMusic.utils import AdminRightsCheck, seconds_to_min
from config import BANNED_USERS
from strings import get_command

SEEK_COMMAND = get_command("SEEK_COMMAND")

Expand Down
4 changes: 2 additions & 2 deletions WinxMusic/plugins/admins/shuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from pyrogram import Client, filters
from pyrogram.types import Message

from config import BANNED_USERS
from strings import get_command
from WinxMusic import app
from WinxMusic.misc import db
from WinxMusic.utils.decorators import AdminRightsCheck
from config import BANNED_USERS
from strings import get_command

SHUFFLE_COMMAND = get_command("SHUFFLE_COMMAND")

Expand Down
Loading

0 comments on commit 2290e91

Please sign in to comment.