diff --git a/plugins/button.py b/plugins/button.py index 62276c92..8b1f4f77 100644 --- a/plugins/button.py +++ b/plugins/button.py @@ -5,12 +5,11 @@ import shutil import asyncio from datetime import datetime - -from Uploader.functions.display_progress import humanbytes, progress_for_pyrogram -from Uploader.functions.ran_text import random_char -from Uploader.script import Translation -from Uploader.utitles import Mdata01, Mdata02, Mdata03 from config import Config +from plugins.functions.display_progress import humanbytes, progress_for_pyrogram +from plugins.functions.ran_text import random_char +from plugins.script import Translation +from plugins.utitles import Mdata01, Mdata02, Mdata03 # Set up logging configuration logging.basicConfig( @@ -65,7 +64,7 @@ async def youtube_dl_call_back(_bot, update): elif entity.type == "url": o = entity.offset length = entity.length - youtube_dl_url = youtube_dl_url[o : o + length] + youtube_dl_url = youtube_dl_url[o: o + length] # Cleaning up inputs youtube_dl_url, custom_file_name, youtube_dl_username, youtube_dl_password = ( @@ -87,7 +86,7 @@ async def youtube_dl_call_back(_bot, update): elif entity.type == "url": o = entity.offset length = entity.length - youtube_dl_url = youtube_dl_url[o : o + length] + youtube_dl_url = youtube_dl_url[o: o + length] await update.message.edit_caption( caption=Translation.DOWNLOAD_START.format(custom_file_name) diff --git a/plugins/callbacks.py b/plugins/callbacks.py index d3fe2948..534fb725 100644 --- a/plugins/callbacks.py +++ b/plugins/callbacks.py @@ -2,9 +2,9 @@ import logging from pyrogram import Client -from Uploader.dl_button import ddl_call_back -from Uploader.button import youtube_dl_call_back -from Uploader.script import Translation +from plugins.dl_button import ddl_call_back +from plugins.button import youtube_dl_call_back +from plugins.script import Translation # Set up logging configuration logging.basicConfig( diff --git a/plugins/commands.py b/plugins/commands.py index ae739c9b..930559d8 100644 --- a/plugins/commands.py +++ b/plugins/commands.py @@ -1,6 +1,6 @@ from pyrogram import Client, filters from pyrogram.types import Message -from Uploader.script import Translation +from plugins.script import Translation @Client.on_message( diff --git a/plugins/dl_button.py b/plugins/dl_button.py index 00774722..18c35861 100644 --- a/plugins/dl_button.py +++ b/plugins/dl_button.py @@ -6,13 +6,13 @@ import os import time import aiohttp -from Uploader.functions.display_progress import ( +from plugins.functions.display_progress import ( progress_for_pyrogram, humanbytes, TimeFormatter, ) -from Uploader.script import Translation -from Uploader.utitles import Mdata01, Mdata02, Mdata03 +from plugins.script import Translation +from plugins.utitles import Mdata01, Mdata02, Mdata03 from config import Config logging.basicConfig( diff --git a/plugins/echo.py b/plugins/echo.py index 7f533919..db631292 100644 --- a/plugins/echo.py +++ b/plugins/echo.py @@ -8,9 +8,9 @@ from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton from config import Config -from Uploader.script import Translation -from Uploader.functions.ran_text import random_char -from Uploader.functions.display_progress import humanbytes +from plugins.script import Translation +from plugins.functions.ran_text import random_char +from plugins.functions.display_progress import humanbytes logging.basicConfig( level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" @@ -58,7 +58,7 @@ async def echo(bot, update): elif entity.type == "url": o = entity.offset length = entity.length - url = url[o : o + length] + url = url[o: o + length] if url is not None: url = url.strip() if file_name is not None: @@ -77,7 +77,7 @@ async def echo(bot, update): elif entity.type == "url": o = entity.offset length = entity.length - url = url[o : o + length] + url = url[o: o + length] if Config.HTTP_PROXY != "": command_to_exec = [ "yt-dlp", diff --git a/plugins/functions/help_uploadbot.py b/plugins/functions/help_uploadbot.py index 2de6db48..8a53261d 100644 --- a/plugins/functions/help_uploadbot.py +++ b/plugins/functions/help_uploadbot.py @@ -1,9 +1,9 @@ +import logging import os import time import requests -import logging -from Uploader.functions.display_progress import humanbytes +from plugins.functions.display_progress import humanbytes logging.basicConfig( level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" @@ -21,7 +21,7 @@ def DetectFileSize(url): Returns: int: Size of the file in bytes. """ - r = requests.head(url, allow_redirects=True) + r = requests.head(url, allow_redirects=True, timeout=60) return int(r.headers.get("content-length", 0)) diff --git a/plugins/youtube.py b/plugins/youtube.py index bfed65c6..3a7aad25 100644 --- a/plugins/youtube.py +++ b/plugins/youtube.py @@ -7,9 +7,7 @@ from pyrogram import Client, filters from config import Config - -from Uploader.functions.help_ytdl import get_file_extension_from_url, get_resolution - +from plugins.functions.help_ytdl import get_file_extension_from_url, get_resolution YTDL_REGEX = r"^((?:https?:)?\/\/)"