├── heroku.yml ├── README.md ├── modules ├── vars.py ├── logs.py ├── utils.py ├── core.py └── main.py ├── Dockerfile ├── Installer └── app.json /heroku.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | worker: Dockerfile 4 | run: 5 | worker: python3 modules/main.py 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Deploy To Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/MatizTechz/txt_leech) 2 | -------------------------------------------------------------------------------- /modules/vars.py: -------------------------------------------------------------------------------- 1 | api_id = "29953693" 2 | api_hash = "bc080dadf0a0e8ca544ac842bcfcf2e0" 3 | bot_token = "7182994277:AAGz3vbjIweEe1qxENkorYiwf99Lk3aXSOA" 4 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | RUN apt-get update -y && apt-get upgrade -y \ 3 | && apt-get install -y --no-install-recommends gcc libffi-dev musl-dev ffmpeg aria2 python3-pip \ 4 | && apt-get clean \ 5 | && rm -rf /var/lib/apt/lists/* 6 | 7 | COPY . /app/ 8 | WORKDIR /app/ 9 | RUN pip3 install --no-cache-dir --upgrade --requirement Installer 10 | CMD python3 modules/main.py 11 | -------------------------------------------------------------------------------- /Installer: -------------------------------------------------------------------------------- 1 | async-lru==2.0.2 2 | certifi==2023.5.7 3 | charset-normalizer==3.1.0 4 | idna==3.4 5 | mutagen==1.46.0 6 | pyaes==1.6.1 7 | pycryptodome==3.18.0 8 | pyrogram==2.0.106 9 | pyromod==1.5 10 | PySocks==1.7.1 11 | python-dotenv==1.0.0 12 | requests==2.31.0 13 | soupsieve==2.4.1 14 | TgCrypto==1.2.5 15 | urllib3==2.0.3 16 | websockets==11.0.3 17 | yt-dlp==2023.6.22 18 | motor 19 | aiohttp==3.8.4 20 | aiofiles 21 | pytz 22 | umongo==3.1.0 23 | speedtest-cli 24 | -------------------------------------------------------------------------------- /modules/logs.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from logging.handlers import RotatingFileHandler 3 | 4 | logging.basicConfig( 5 | level=logging.ERROR, 6 | format= 7 | "%(asctime)s - %(levelname)s - %(message)s [%(filename)s:%(lineno)d]", 8 | datefmt="%d-%b-%y %H:%M:%S", 9 | handlers=[ 10 | RotatingFileHandler("logs.txt", maxBytes=50000000, backupCount=10), 11 | logging.StreamHandler(), 12 | ], 13 | ) 14 | logging.getLogger("pyrogram").setLevel(logging.WARNING) 15 | 16 | 17 | logging = logging.getLogger() 18 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "𝐓𝐞𝐱𝐭 𝐋𝐞𝐞𝐜𝐡", 3 | "description": "𝑻𝒆𝒙𝒕 𝑳𝒆𝒆𝒄𝒉 𝑽𝒊𝒅𝒆𝒐 𝑬𝒙𝒕𝒓𝒂𝒄𝒕𝒐𝒓 𝑭𝒐𝒓 𝑻𝒆𝒍𝒆𝒈𝒓𝒂𝒎", 4 | "logo": "https://telegra.ph/file/32f106d692ff33700c464.jpg", 5 | "keywords": [ 6 | "text-video", 7 | "video-extract", 8 | "pyrogram" 9 | ], 10 | "repository": "https://github.com/Mswpresents/txttovdomy", 11 | "success_url": "https://t.me/teamjaishriramofficial", 12 | "stack": "container", 13 | "env": { 14 | "API_ID": { 15 | "description": "𝑬𝒏𝒕𝒆𝒓 𝒀𝒐𝒖𝒓 𝑨𝒑𝒊 𝑰𝑫", 16 | "required": true 17 | }, 18 | "API_HASH": { 19 | "description": "𝑬𝒏𝒕𝒆𝒓 𝒀𝒐𝒖𝒓 𝑨𝒑𝒊 𝑯𝒂𝒔𝒉", 20 | "required": true 21 | }, 22 | "BOT_TOKEN": { 23 | "description": "𝑬𝒏𝒕𝒆𝒓 𝒀𝒐𝒖𝒓 𝑩𝒐𝒕 𝑻𝒐𝒌𝒆𝒏", 24 | "required": true 25 | }, 26 | "OWNER_ID": { 27 | "description": "𝑼𝒔𝒆𝒓 𝑰𝑫 𝑶𝒇 𝑩𝒐𝒕 𝑶𝒘𝒏𝒆𝒓", 28 | "required": true 29 | }, 30 | "SUDO_USERS": { 31 | "description": "𝑺𝒖𝒅𝒐 𝑰𝑫'𝒔 (𝒀𝒐𝒖 𝑪𝒂𝒏 𝑨𝒅𝒅 𝑴𝒖𝒍𝒕𝒊𝒑𝒍𝒆 𝑩𝒚 𝑮𝒊𝒗𝒊𝒏𝒈 𝑺𝒑𝒂𝒄𝒆)", 32 | "required": true 33 | } 34 | }, 35 | "addons": [], 36 | "buildpacks": [ 37 | { 38 | "url": "heroku/python" 39 | }, 40 | { 41 | "url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git" 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /modules/utils.py: -------------------------------------------------------------------------------- 1 | import time 2 | import math 3 | import os 4 | from pyrogram.errors import FloodWait 5 | 6 | class Timer: 7 | def __init__(self, time_between=5): 8 | self.start_time = time.time() 9 | self.time_between = time_between 10 | 11 | def can_send(self): 12 | if time.time() > (self.start_time + self.time_between): 13 | self.start_time = time.time() 14 | return True 15 | return False 16 | 17 | 18 | from datetime import datetime,timedelta 19 | 20 | #lets do calculations 21 | def hrb(value, digits= 2, delim= "", postfix=""): 22 | """Return a human-readable file size. 23 | """ 24 | if value is None: 25 | return None 26 | chosen_unit = "B" 27 | for unit in ("KiB", "MiB", "GiB", "TiB"): 28 | if value > 1000: 29 | value /= 1024 30 | chosen_unit = unit 31 | else: 32 | break 33 | return f"{value:.{digits}f}" + delim + chosen_unit + postfix 34 | 35 | def hrt(seconds, precision = 0): 36 | """Return a human-readable time delta as a string. 37 | """ 38 | pieces = [] 39 | value = timedelta(seconds=seconds) 40 | 41 | 42 | if value.days: 43 | pieces.append(f"{value.days}d") 44 | 45 | seconds = value.seconds 46 | 47 | if seconds >= 3600: 48 | hours = int(seconds / 3600) 49 | pieces.append(f"{hours}h") 50 | seconds -= hours * 3600 51 | 52 | if seconds >= 60: 53 | minutes = int(seconds / 60) 54 | pieces.append(f"{minutes}m") 55 | seconds -= minutes * 60 56 | 57 | if seconds > 0 or not pieces: 58 | pieces.append(f"{seconds}s") 59 | 60 | if not precision: 61 | return "".join(pieces) 62 | 63 | return "".join(pieces[:precision]) 64 | 65 | 66 | 67 | timer = Timer() 68 | 69 | # Powered By Ankush 70 | async def progress_bar(current, total, reply, start): 71 | if timer.can_send(): 72 | now = time.time() 73 | diff = now - start 74 | if diff < 1: 75 | return 76 | else: 77 | perc = f"{current * 100 / total:.1f}%" 78 | elapsed_time = round(diff) 79 | speed = current / elapsed_time 80 | remaining_bytes = total - current 81 | if speed > 0: 82 | eta_seconds = remaining_bytes / speed 83 | eta = hrt(eta_seconds, precision=1) 84 | else: 85 | eta = "-" 86 | sp = str(hrb(speed)) + "/s" 87 | tot = hrb(total) 88 | cur = hrb(current) 89 | bar_length = 11 90 | completed_length = int(current * bar_length / total) 91 | remaining_length = bar_length - completed_length 92 | progress_bar = "▰" * completed_length + "▱" * remaining_length 93 | 94 | try: 95 | await reply.edit(f'\n `╭──⌯════🆄︎ᴘʟᴏᴀᴅɪɴɢ⬆️⬆️═════⌯──╮ \n├⚡ {progress_bar}|﹝{perc}﹞ \n├🚀 Speed » {sp} \n├📟 Processed » {cur}\n├🧲 Size - ETA » {tot} - {eta} \n├🤖𝔹ʏ » Md Matin Ashraf\n╰─═══ ✪ @Matiz_Techz ✪ ═══─╯\n`') 96 | except FloodWait as e: 97 | time.sleep(e.x) 98 | 99 | -------------------------------------------------------------------------------- /modules/core.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import datetime 4 | import aiohttp 5 | import aiofiles 6 | import asyncio 7 | import logging 8 | import requests 9 | import tgcrypto 10 | import subprocess 11 | import concurrent.futures 12 | 13 | from utils import progress_bar 14 | 15 | from pyrogram import Client, filters 16 | from pyrogram.types import Message 17 | 18 | 19 | 20 | def duration(filename): 21 | result = subprocess.run(["ffprobe", "-v", "error", "-show_entries", 22 | "format=duration", "-of", 23 | "default=noprint_wrappers=1:nokey=1", filename], 24 | stdout=subprocess.PIPE, 25 | stderr=subprocess.STDOUT) 26 | return float(result.stdout) 27 | 28 | def exec(cmd): 29 | process = subprocess.run(cmd, stdout=subprocess.PIPE,stderr=subprocess.PIPE) 30 | output = process.stdout.decode() 31 | print(output) 32 | return output 33 | #err = process.stdout.decode() 34 | def pull_run(work, cmds): 35 | with concurrent.futures.ThreadPoolExecutor(max_workers=work) as executor: 36 | print("Waiting for tasks to complete") 37 | fut = executor.map(exec,cmds) 38 | async def aio(url,name): 39 | k = f'{name}.pdf' 40 | async with aiohttp.ClientSession() as session: 41 | async with session.get(url) as resp: 42 | if resp.status == 200: 43 | f = await aiofiles.open(k, mode='wb') 44 | await f.write(await resp.read()) 45 | await f.close() 46 | return k 47 | 48 | 49 | async def download(url,name): 50 | ka = f'{name}.pdf' 51 | async with aiohttp.ClientSession() as session: 52 | async with session.get(url) as resp: 53 | if resp.status == 200: 54 | f = await aiofiles.open(ka, mode='wb') 55 | await f.write(await resp.read()) 56 | await f.close() 57 | return ka 58 | 59 | 60 | 61 | def parse_vid_info(info): 62 | info = info.strip() 63 | info = info.split("\n") 64 | new_info = [] 65 | temp = [] 66 | for i in info: 67 | i = str(i) 68 | if "[" not in i and '---' not in i: 69 | while " " in i: 70 | i = i.replace(" ", " ") 71 | i.strip() 72 | i = i.split("|")[0].split(" ",2) 73 | try: 74 | if "RESOLUTION" not in i[2] and i[2] not in temp and "audio" not in i[2]: 75 | temp.append(i[2]) 76 | new_info.append((i[0], i[2])) 77 | except: 78 | pass 79 | return new_info 80 | 81 | 82 | def vid_info(info): 83 | info = info.strip() 84 | info = info.split("\n") 85 | new_info = dict() 86 | temp = [] 87 | for i in info: 88 | i = str(i) 89 | if "[" not in i and '---' not in i: 90 | while " " in i: 91 | i = i.replace(" ", " ") 92 | i.strip() 93 | i = i.split("|")[0].split(" ",3) 94 | try: 95 | if "RESOLUTION" not in i[2] and i[2] not in temp and "audio" not in i[2]: 96 | temp.append(i[2]) 97 | 98 | # temp.update(f'{i[2]}') 99 | # new_info.append((i[2], i[0])) 100 | # mp4,mkv etc ==== f"({i[1]})" 101 | 102 | new_info.update({f'{i[2]}':f'{i[0]}'}) 103 | 104 | except: 105 | pass 106 | return new_info 107 | 108 | 109 | 110 | async def run(cmd): 111 | proc = await asyncio.create_subprocess_shell( 112 | cmd, 113 | stdout=asyncio.subprocess.PIPE, 114 | stderr=asyncio.subprocess.PIPE) 115 | 116 | stdout, stderr = await proc.communicate() 117 | 118 | print(f'[{cmd!r} exited with {proc.returncode}]') 119 | if proc.returncode == 1: 120 | return False 121 | if stdout: 122 | return f'[stdout]\n{stdout.decode()}' 123 | if stderr: 124 | return f'[stderr]\n{stderr.decode()}' 125 | 126 | 127 | 128 | def old_download(url, file_name, chunk_size = 1024 * 10): 129 | if os.path.exists(file_name): 130 | os.remove(file_name) 131 | r = requests.get(url, allow_redirects=True, stream=True) 132 | with open(file_name, 'wb') as fd: 133 | for chunk in r.iter_content(chunk_size=chunk_size): 134 | if chunk: 135 | fd.write(chunk) 136 | return file_name 137 | 138 | 139 | def human_readable_size(size, decimal_places=2): 140 | for unit in ['B', 'KB', 'MB', 'GB', 'TB', 'PB']: 141 | if size < 1024.0 or unit == 'PB': 142 | break 143 | size /= 1024.0 144 | return f"{size:.{decimal_places}f} {unit}" 145 | 146 | 147 | def time_name(): 148 | date = datetime.date.today() 149 | now = datetime.datetime.now() 150 | current_time = now.strftime("%H%M%S") 151 | return f"{date} {current_time}.mp4" 152 | 153 | 154 | async def download_video(url,cmd, name): 155 | download_cmd = f'{cmd} -R 25 --fragment-retries 25 --external-downloader aria2c --downloader-args "aria2c: -x 16 -j 32"' 156 | global failed_counter 157 | print(download_cmd) 158 | logging.info(download_cmd) 159 | k = subprocess.run(download_cmd, shell=True) 160 | if "visionias" in cmd and k.returncode != 0 and failed_counter <= 10: 161 | failed_counter += 1 162 | await asyncio.sleep(5) 163 | await download_video(url, cmd, name) 164 | failed_counter = 0 165 | try: 166 | if os.path.isfile(name): 167 | return name 168 | elif os.path.isfile(f"{name}.webm"): 169 | return f"{name}.webm" 170 | name = name.split(".")[0] 171 | if os.path.isfile(f"{name}.mkv"): 172 | return f"{name}.mkv" 173 | elif os.path.isfile(f"{name}.mp4"): 174 | return f"{name}.mp4" 175 | elif os.path.isfile(f"{name}.mp4.webm"): 176 | return f"{name}.mp4.webm" 177 | 178 | return name 179 | except FileNotFoundError as exc: 180 | return os.path.isfile.splitext[0] + "." + "mp4" 181 | 182 | 183 | async def send_doc(bot: Client, m: Message,cc,ka,cc1,prog,count,name): 184 | reply = await m.reply_text(f"Uploading » `{name}`") 185 | time.sleep(1) 186 | start_time = time.time() 187 | await m.reply_document(ka,caption=cc1) 188 | count+=1 189 | await reply.delete (True) 190 | time.sleep(1) 191 | os.remove(ka) 192 | time.sleep(3) 193 | 194 | 195 | async def send_vid(bot: Client, m: Message,cc,filename,thumb,name,prog): 196 | subprocess.run(f'ffmpeg -i "{filename}" -ss 00:01:00 -vframes 1 "{filename}.jpg"', shell=True) 197 | await prog.delete (True) 198 | reply = await m.reply_text(f"**⥣ Uploading ...** » `{name}`") 199 | try: 200 | if thumb == "no": 201 | thumbnail = f"{filename}.jpg" 202 | else: 203 | thumbnail = thumb 204 | except Exception as e: 205 | await m.reply_text(str(e)) 206 | 207 | dur = int(duration(filename)) 208 | 209 | start_time = time.time() 210 | 211 | try: 212 | await m.reply_video(filename,caption=cc, supports_streaming=True,height=720,width=1280,thumb=thumbnail,duration=dur, progress=progress_bar,progress_args=(reply,start_time)) 213 | except Exception: 214 | await m.reply_document(filename,caption=cc, progress=progress_bar,progress_args=(reply,start_time)) 215 | os.remove(filename) 216 | 217 | os.remove(f"{filename}.jpg") 218 | await reply.delete (True) 219 | 220 | -------------------------------------------------------------------------------- /modules/main.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import sys 4 | import json 5 | import time 6 | import asyncio 7 | import requests 8 | import subprocess 9 | 10 | import core as helper 11 | from utils import progress_bar 12 | from vars import api_id, api_hash, bot_token 13 | from aiohttp import ClientSession 14 | from pyromod import listen 15 | from subprocess import getstatusoutput 16 | 17 | from pyrogram import Client, filters 18 | from pyrogram.types import Message 19 | from pyrogram.errors import FloodWait 20 | from pyrogram.errors.exceptions.bad_request_400 import StickerEmojiInvalid 21 | from pyrogram.types.messages_and_media import message 22 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup 23 | 24 | 25 | bot = Client( 26 | "bot", 27 | api_id=api_id, 28 | api_hash=api_hash, 29 | bot_token=bot_token) 30 | 31 | 32 | @bot.on_message(filters.command(["start"])) 33 | async def account_login(bot: Client, m: Message): 34 | editable = await m.reply_text("**ℍɪɪ** ┈━═My Freind═━┈😎\n\n I Am A Bot For Download Links From Your **.TXT** File And Then Upload That File Om Telegram So Basically If You Want To Use Me First Send Me /upload Command And Then Follow Few Steps..") 35 | 36 | 37 | @bot.on_message(filters.command("stop")) 38 | async def restart_handler(_, m): 39 | await m.reply_text("**Stopped**🚦", True) 40 | os.execl(sys.executable, sys.executable, *sys.argv) 41 | 42 | 43 | 44 | @bot.on_message(filters.command(["upload"])) 45 | async def account_login(bot: Client, m: Message): 46 | editable = await m.reply_text('𝕋𝕆 ᴅᴏᴡɴʟᴏᴀᴅ ᴀ ᴛxᴛ ғɪʟᴇ 𝕤ᴇɴᴅ ʜᴇʀᴇ ⚡️') 47 | input: Message = await bot.listen(editable.chat.id) 48 | x = await input.download() 49 | await input.delete(True) 50 | 51 | path = f"./downloads/{m.chat.id}" 52 | 53 | try: 54 | with open(x, "r") as f: 55 | content = f.read() 56 | content = content.split("\n") 57 | links = [] 58 | for i in content: 59 | links.append(i.split("://", 1)) 60 | os.remove(x) 61 | # print(len(links) 62 | except: 63 | await m.reply_text("**Invalid file input.**") 64 | os.remove(x) 65 | return 66 | 67 | 68 | await editable.edit(f"**𝕋ᴏᴛᴀʟ ʟɪɴᴋ𝕤 ғᴏᴜɴᴅ ᴀʀᴇ🔗🔗** **{len(links)}**\n\n**𝕊ᴇɴᴅ 𝔽ʀᴏᴍ ᴡʜᴇʀᴇ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴅᴏᴡɴʟᴏᴀᴅ ɪɴɪᴛɪᴀʟ ɪ𝕤** **1**") 69 | input0: Message = await bot.listen(editable.chat.id) 70 | raw_text = input0.text 71 | await input0.delete(True) 72 | 73 | await editable.edit("**Now Please Send Me Your Batch Name**") 74 | input1: Message = await bot.listen(editable.chat.id) 75 | raw_text0 = input1.text 76 | await input1.delete(True) 77 | 78 | 79 | await editable.edit("**𝔼ɴᴛᴇʀ ʀᴇ𝕤ᴏʟᴜᴛɪᴏɴ📸**\n144,240,360,480,720,1080 please choose quality") 80 | input2: Message = await bot.listen(editable.chat.id) 81 | raw_text2 = input2.text 82 | await input2.delete(True) 83 | try: 84 | if raw_text2 == "144": 85 | res = "256x144" 86 | elif raw_text2 == "240": 87 | res = "426x240" 88 | elif raw_text2 == "360": 89 | res = "640x360" 90 | elif raw_text2 == "480": 91 | res = "854x480" 92 | elif raw_text2 == "720": 93 | res = "1280x720" 94 | elif raw_text2 == "1080": 95 | res = "1920x1080" 96 | else: 97 | res = "UN" 98 | except Exception: 99 | res = "UN" 100 | 101 | 102 | 103 | await editable.edit("Now Enter A Caption to add caption on your uploaded file") 104 | input3: Message = await bot.listen(editable.chat.id) 105 | raw_text3 = input3.text 106 | await input3.delete(True) 107 | highlighter = f"️ " 108 | if raw_text3 == 'Robin': 109 | MR = highlighter 110 | else: 111 | MR = raw_text3 112 | 113 | await editable.edit("Now send the Thumb url/nEg » https://telegra.ph/file/1bf523c4b51530e57e84d.jpg \n Or if don't want thumbnail send = no") 114 | input6 = message = await bot.listen(editable.chat.id) 115 | raw_text6 = input6.text 116 | await input6.delete(True) 117 | await editable.delete() 118 | 119 | thumb = input6.text 120 | if thumb.startswith("http://") or thumb.startswith("https://"): 121 | getstatusoutput(f"wget '{thumb}' -O 'thumb.jpg'") 122 | thumb = "thumb.jpg" 123 | else: 124 | thumb == "no" 125 | 126 | if len(links) == 1: 127 | count = 1 128 | else: 129 | count = int(raw_text) 130 | 131 | try: 132 | for i in range(count - 1, len(links)): 133 | 134 | V = links[i][1].replace("file/d/","uc?export=download&id=").replace("www.youtube-nocookie.com/embed", "youtu.be").replace("?modestbranding=1", "").replace("/view?usp=sharing","") # .replace("mpd","m3u8") 135 | url = "https://" + V 136 | 137 | if "visionias" in url: 138 | async with ClientSession() as session: 139 | async with session.get(url, headers={'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Accept-Language': 'en-US,en;q=0.9', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Referer': 'http://www.visionias.in/', 'Sec-Fetch-Dest': 'iframe', 'Sec-Fetch-Mode': 'navigate', 'Sec-Fetch-Site': 'cross-site', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Linux; Android 12; RMX2121) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Mobile Safari/537.36', 'sec-ch-ua': '"Chromium";v="107", "Not=A?Brand";v="24"', 'sec-ch-ua-mobile': '?1', 'sec-ch-ua-platform': '"Android"',}) as resp: 140 | text = await resp.text() 141 | url = re.search(r"(https://.*?playlist.m3u8.*?)\"", text).group(1) 142 | 143 | elif 'videos.classplusapp' in url: 144 | url = requests.get(f'https://api.classplusapp.com/cams/uploader/video/jw-signed-url?url={url}', headers={'x-access-token': 'eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9.eyJpZCI6MzgzNjkyMTIsIm9yZ0lkIjoyNjA1LCJ0eXBlIjoxLCJtb2JpbGUiOiI5MTcwODI3NzQyODkiLCJuYW1lIjoiQWNlIiwiZW1haWwiOm51bGwsImlzRmlyc3RMb2dpbiI6dHJ1ZSwiZGVmYXVsdExhbmd1YWdlIjpudWxsLCJjb3VudHJ5Q29kZSI6IklOIiwiaXNJbnRlcm5hdGlvbmFsIjowLCJpYXQiOjE2NDMyODE4NzcsImV4cCI6MTY0Mzg4NjY3N30.hM33P2ai6ivdzxPPfm01LAd4JWv-vnrSxGXqvCirCSpUfhhofpeqyeHPxtstXwe0'}).json()['url'] 145 | 146 | elif '/master.mpd' in url: 147 | id = url.split("/")[-2] 148 | url = "https://d26g5bnklkwsh4.cloudfront.net/" + id + "/master.m3u8" 149 | 150 | name1 = links[i][0].replace("\t", "").replace(":", "").replace("/", "").replace("+", "").replace("#", "").replace("|", "").replace("@", "").replace("*", "").replace(".", "").replace("https", "").replace("http", "").strip() 151 | name = f'{str(count).zfill(3)}) {name1[:60]}' 152 | 153 | if "youtu" in url: 154 | ytf = f"b[height<={raw_text2}][ext=mp4]/bv[height<={raw_text2}][ext=mp4]+ba[ext=m4a]/b[ext=mp4]" 155 | else: 156 | ytf = f"b[height<={raw_text2}]/bv[height<={raw_text2}]+ba/b/bv+ba" 157 | 158 | if "jw-prod" in url: 159 | cmd = f'yt-dlp -o "{name}.mp4" "{url}"' 160 | else: 161 | cmd = f'yt-dlp -f "{ytf}" "{url}" -o "{name}.mp4"' 162 | 163 | try: 164 | 165 | cc = f'**[📽️] Vid_ID:** {str(count).zfill(3)}.** {𝗻𝗮𝗺𝗲𝟭}{MR}.mkv\n**𝔹ᴀᴛᴄʜ** » **{raw_text0}**' 166 | cc1 = f'**[📁] Pdf_ID:** {str(count).zfill(3)}. {𝗻𝗮𝗺𝗲𝟭}{MR}.pdf \n**𝔹ᴀᴛᴄʜ** » **{raw_text0}**' 167 | if "drive" in url: 168 | try: 169 | ka = await helper.download(url, name) 170 | copy = await bot.send_document(chat_id=m.chat.id,document=ka, caption=cc1) 171 | count+=1 172 | os.remove(ka) 173 | time.sleep(1) 174 | except FloodWait as e: 175 | await m.reply_text(str(e)) 176 | time.sleep(e.x) 177 | continue 178 | 179 | elif ".pdf" in url: 180 | try: 181 | cmd = f'yt-dlp -o "{name}.pdf" "{url}"' 182 | download_cmd = f"{cmd} -R 25 --fragment-retries 25" 183 | os.system(download_cmd) 184 | copy = await bot.send_document(chat_id=m.chat.id, document=f'{name}.pdf', caption=cc1) 185 | count += 1 186 | os.remove(f'{name}.pdf') 187 | except FloodWait as e: 188 | await m.reply_text(str(e)) 189 | time.sleep(e.x) 190 | continue 191 | else: 192 | Show = f"**⥥ 🄳🄾🅆🄽🄻🄾🄰🄳🄸🄽🄶⬇️⬇️... »**\n\n**📝Name »** `{name}\n❄Quality » {raw_text2}`\n\n**🔗URL »** `{url}`" 193 | prog = await m.reply_text(Show) 194 | res_file = await helper.download_video(url, cmd, name) 195 | filename = res_file 196 | await prog.delete(True) 197 | await helper.send_vid(bot, m, cc, filename, thumb, name, prog) 198 | count += 1 199 | time.sleep(1) 200 | 201 | except Exception as e: 202 | await m.reply_text( 203 | f"**downloading Interupted **\n{str(e)}\n**Name** » {name}\n**Link** » `{url}`" 204 | ) 205 | continue 206 | 207 | except Exception as e: 208 | await m.reply_text(e) 209 | await m.reply_text("**𝔻ᴏɴᴇ 𝔹ᴏ𝕤𝕤😎**") 210 | 211 | 212 | bot.run() 213 | --------------------------------------------------------------------------------