├── .gitignore ├── LICENSE ├── Procfile ├── README.md ├── app.json ├── bot.py ├── requirements.txt └── runtime.txt /.gitignore: -------------------------------------------------------------------------------- 1 | *.session 2 | *.session-journal 3 | 4 | # Byte-compiled / optimized / DLL files 5 | __pycache__/ 6 | *.py[cod] 7 | *$py.class 8 | 9 | # C extensions 10 | *.so 11 | 12 | # Distribution / packaging 13 | .Python 14 | build/ 15 | develop-eggs/ 16 | dist/ 17 | downloads/ 18 | eggs/ 19 | .eggs/ 20 | lib/ 21 | lib64/ 22 | parts/ 23 | sdist/ 24 | var/ 25 | wheels/ 26 | share/python-wheels/ 27 | *.egg-info/ 28 | .installed.cfg 29 | *.egg 30 | MANIFEST 31 | 32 | # PyInstaller 33 | # Usually these files are written by a python script from a template 34 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 35 | *.manifest 36 | *.spec 37 | 38 | # Installer logs 39 | pip-log.txt 40 | pip-delete-this-directory.txt 41 | 42 | # Unit test / coverage reports 43 | htmlcov/ 44 | .tox/ 45 | .nox/ 46 | .coverage 47 | .coverage.* 48 | .cache 49 | nosetests.xml 50 | coverage.xml 51 | *.cover 52 | *.py,cover 53 | .hypothesis/ 54 | .pytest_cache/ 55 | cover/ 56 | 57 | # Translations 58 | *.mo 59 | *.pot 60 | 61 | # Django stuff: 62 | *.log 63 | local_settings.py 64 | db.sqlite3 65 | db.sqlite3-journal 66 | 67 | # Flask stuff: 68 | instance/ 69 | .webassets-cache 70 | 71 | # Scrapy stuff: 72 | .scrapy 73 | 74 | # Sphinx documentation 75 | docs/_build/ 76 | 77 | # PyBuilder 78 | .pybuilder/ 79 | target/ 80 | 81 | # Jupyter Notebook 82 | .ipynb_checkpoints 83 | 84 | # IPython 85 | profile_default/ 86 | ipython_config.py 87 | 88 | # pyenv 89 | # For a library or package, you might want to ignore these files since the code is 90 | # intended to run in multiple environments; otherwise, check them in: 91 | # .python-version 92 | 93 | # pipenv 94 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 95 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 96 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 97 | # install all needed dependencies. 98 | #Pipfile.lock 99 | 100 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 101 | __pypackages__/ 102 | 103 | # Celery stuff 104 | celerybeat-schedule 105 | celerybeat.pid 106 | 107 | # SageMath parsed files 108 | *.sage.py 109 | 110 | # Environments 111 | .env 112 | .venv 113 | env/ 114 | venv/ 115 | ENV/ 116 | env.bak/ 117 | venv.bak/ 118 | 119 | # Spyder project settings 120 | .spyderproject 121 | .spyproject 122 | 123 | # Rope project settings 124 | .ropeproject 125 | 126 | # mkdocs documentation 127 | /site 128 | 129 | # mypy 130 | .mypy_cache/ 131 | .dmypy.json 132 | dmypy.json 133 | 134 | # Pyre type checker 135 | .pyre/ 136 | 137 | # pytype static type analyzer 138 | .pytype/ 139 | 140 | # Cython debug symbols 141 | cython_debug/ 142 | 143 | /gplink_env 144 | /.vscode -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Mahesh0253 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | worker: python3 bot.py 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 𝐏𝐝𝐢𝐬𝐤 𝐂𝐨𝐧𝐯𝐞𝐫𝐭𝐞𝐫 𝐁𝐨𝐭 2 | Make short link by using [MDisk](https://www.cofilink.com/use-api/) API key 3 | ### Installation 4 | 5 | #### 𝐓𝐡𝐞 𝐄𝐚𝐬𝐲 𝐖𝐚𝐲 6 | 7 | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/PredatorHackerzZ/MdiskVideoBot) 8 | 9 | ##### 𝐑𝐞𝐪𝐮𝐢𝐫𝐞𝐝 𝐕𝐚𝐫𝐢𝐚𝐛𝐥𝐞𝐬 10 | 11 | * `BOT_TOKEN`: 𝐂𝐫𝐞𝐚𝐭𝐞 𝐚 𝐛𝐨𝐭 𝐮𝐬𝐢𝐧𝐠 [@BotFather](https://telegram.dog/BotFather), and get the Telegram API token. 12 | * `API_ID`: 𝐆𝐞𝐭 𝐭𝐡𝐢𝐬 𝐯𝐚𝐥𝐮𝐞 𝐟𝐫𝐨𝐦 [telegram.org](https://my.telegram.org/apps) 13 | * `API_HASH`: 𝐆𝐞𝐭 𝐭𝐡𝐢𝐬 𝐯𝐚𝐥𝐮𝐞 𝐟𝐫𝐨𝐦 [telegram.org](https://my.telegram.org/apps) 14 | * `MDISK_TOKEN`: 𝐂𝐫𝐞𝐚𝐭𝐞 [𝐏𝐝𝐢𝐬𝐤](https://www.cofilink.com/use-api) 𝐚𝐜𝐜𝐨𝐮𝐧𝐭 𝐭𝐡𝐞𝐧 𝐠𝐞𝐭 𝐭𝐡𝐢𝐬 𝐯𝐚𝐥𝐮𝐞 15 | 16 | ### 𝐒𝐮𝐩𝐩𝐨𝐫𝐭 𝐆𝐫𝐨𝐮𝐩: 17 | 18 | ### 𝐔𝐩𝐝𝐚𝐭𝐞𝐬 𝐂𝐡𝐚𝐧𝐧𝐞𝐥: 19 | 20 | 21 | 22 | 👨‍💻 𝐌𝐀𝐒𝐓𝐄𝐑 23 | 24 |

25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MDisk Video Uploader Bot", 3 | "description": "Upload Mdisk Link Or Direct Url to Pdisk...", 4 | "keywords": [ 5 | "telegram", 6 | "mdisk", 7 | "shortner" 8 | ], 9 | "website": "https://github.com/PredatorHackerzZ/PdiskVideoBot/", 10 | "repository": "https://github.com/PredatorHackerzZ/PdiskVideoBot/", 11 | "logo": "https://telegra.ph/file/51a84cdd8254ee0406683.jpg", 12 | "env": { 13 | "BOT_TOKEN": { 14 | "description": "Your bot token (must add)", 15 | "value": "" 16 | }, 17 | "API_ID": { 18 | "description": "Get this value from https://my.telegram.org", 19 | "value": "1234567" 20 | }, 21 | "API_HASH": { 22 | "description": "Get this value from https://my.telegram.org", 23 | "value": "04fc2de75c898324561286e5b10bd619" 24 | }, 25 | "MDISK_TOKEN": { 26 | "description": "MDisk API key here", 27 | "value": "xdho92oqknpp82oakowm" 28 | }, 29 | "CHANNEL": { 30 | "description": "Enter your telegram channel Username (must change and without @)", 31 | "value": "TheTeleRoid" 32 | }, 33 | "THUMB_URL": { 34 | "description": "Enter the permanent thumbnail image url can use this @TeleRoid_Image2Link_BOT", 35 | "value" : "https://telegra.ph/file/51a84cdd8254ee0406683.jpg" 36 | } 37 | }, 38 | "addons": [], 39 | "buildpacks": [ 40 | { 41 | "url": "heroku/python" 42 | } 43 | ], 44 | "formation": { 45 | "worker": { 46 | "quantity": 1, 47 | "size": "free" 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /bot.py: -------------------------------------------------------------------------------- 1 | from os import environ 2 | import os 3 | import time 4 | from unshortenit import UnshortenIt 5 | from urllib.request import urlopen 6 | from urllib.parse import urlparse 7 | import aiohttp 8 | from pyrogram import Client, filters 9 | from pyshorteners import Shortener 10 | from bs4 import BeautifulSoup 11 | #from doodstream import DoodStream 12 | import requests 13 | import re 14 | 15 | API_ID = environ.get('API_ID', '6') 16 | API_HASH = environ.get('API_HASH', 'eb06d4abfb49dc3eeb1aeb98ae0f581e') 17 | BOT_TOKEN = environ.get('BOT_TOKEN') 18 | CHANNEL = environ.get('CUSTOM_FOOTER') 19 | MDISK_TOKEN = environ.get('MDISK_TOKEN') 20 | bot = Client('Doodstream bot', 21 | api_id=API_ID, 22 | api_hash=API_HASH, 23 | bot_token=BOT_TOKEN, 24 | workers=50, 25 | sleep_threshold=0) 26 | 27 | START_TEXT = """ 28 | A Simple MDisk Uploader Bot.\n 29 | ➠ Send Me Any Direct Link, YouTube Link Or Video Link.\n 30 | ➠ I Will Upload To PDisk And Give Direct Link\n 31 | ➠ Made With ❤ BY @MoviesFlixers_DL""" 32 | 33 | HELP_TEXT = """ 34 | - Sᴇɴᴅ ᴍᴇ ᴀɴʏ ꜰɪʟᴇ (ᴏʀ) ᴍᴇᴅɪᴀ ꜰʀᴏᴍ ᴛᴇʟᴇɢʀᴀᴍ. 35 | - I ᴡɪʟʟ ᴘʀᴏᴠɪᴅᴇ ᴇxᴛᴇʀɴᴀʟ ᴅɪʀᴇᴄᴛ Mdisk ᴅᴏᴡɴʟᴏᴀᴅ ʟɪɴᴋ !. 36 | - Tʜɪs Pᴇʀᴍᴇᴀɴᴛ Lɪɴᴋ Wɪᴛʜ Fᴀsᴛᴇsᴛ Sᴘᴇᴇᴅ\n 37 | 🔸 𝗪𝗔𝗥𝗡𝗜𝗡𝗚 🚸\n 38 | 🔞 Pʀᴏɴ ᴄᴏɴᴛᴇɴᴛꜱ ʟᴇᴀᴅꜱ ᴛᴏ ᴘᴇʀᴍᴀɴᴇɴᴛ ʙᴀɴ ʏᴏᴜ.\n 39 | Cᴏɴᴛᴀᴄᴛ ᴅᴇᴠᴇʟᴏᴘᴇʀ (ᴏʀ) ʀᴇᴘᴏʀᴛ ʙᴜɢꜱ : [ツAʙʜɪsʜᴇᴋ Kᴜᴍᴀʀ]""" 40 | 41 | ABOUT_TEXT = """ 42 | ⚜ Mʏ ɴᴀᴍᴇ : MdiskVideoBot\n 43 | 🔸Vᴇʀꜱɪᴏɴ : 3.0.1\n 44 | 🔹Sᴏᴜʀᴄᴇ : Cʟɪᴄᴋ Hᴇʀᴇ\n 45 | 🔸GitHub : ツAʙʜɪsʜᴇᴋ Kᴜᴍᴀʀ\n 46 | 🔹Dᴇᴠᴇʟᴏᴘᴇʀ : ツAʙʜɪsʜᴇᴋ Kᴜᴍᴀʀ \n 47 | 🔸Lᴀꜱᴛ ᴜᴘᴅᴀᴛᴇᴅ : [ 04 - March - 2023 ] 12:17 ᴀᴍ""" 48 | 49 | START_BUTTONS = InlineKeyboardMarkup( 50 | [[ 51 | InlineKeyboardButton('Hᴇʟᴘ', callback_data='help'), 52 | InlineKeyboardButton('Aʙᴏᴜᴛ', callback_data='about'), 53 | InlineKeyboardButton('Cʟᴏsᴇ', callback_data='close') 54 | ]] 55 | ) 56 | HELP_BUTTONS = InlineKeyboardMarkup( 57 | [[ 58 | InlineKeyboardButton('Hᴏᴍᴇ', callback_data='home'), 59 | InlineKeyboardButton('Aʙᴏᴜᴛ', callback_data='about'), 60 | InlineKeyboardButton('Cʟᴏsᴇ', callback_data='close') 61 | ]] 62 | ) 63 | ABOUT_BUTTONS = InlineKeyboardMarkup( 64 | [[ 65 | InlineKeyboardButton('Hᴏᴍᴇ', callback_data='home'), 66 | InlineKeyboardButton('Hᴇʟᴘ', callback_data='help'), 67 | InlineKeyboardButton('Cʟᴏsᴇ', callback_data='close') 68 | ]] 69 | ) 70 | 71 | @bot.on_callback_query() 72 | async def cb_data(bot, update): 73 | if update.data == "home": 74 | await update.message.edit_text( 75 | text=START_TEXT.format(update.from_user.mention), 76 | disable_web_page_preview=True, 77 | reply_markup=START_BUTTONS 78 | ) 79 | elif update.data == "help": 80 | await update.message.edit_text( 81 | text=HELP_TEXT, 82 | disable_web_page_preview=True, 83 | reply_markup=HELP_BUTTONS 84 | ) 85 | elif update.data == "about": 86 | await update.message.edit_text( 87 | text=ABOUT_TEXT, 88 | disable_web_page_preview=True, 89 | reply_markup=ABOUT_BUTTONS 90 | ) 91 | else: 92 | await update.message.delete() 93 | 94 | @bot.on_message(filters.command('start') & filters.private) 95 | async def start(bot, message): 96 | await message.reply( 97 | f"**Hola 👋{message.chat.first_name}!**\n\n" 98 | "**A Simple PDisk Uploader Bot.\n\n➠ Send Me Any Direct Link, YouTube Link Or Video Link I Will Upload To PDisk And Give Direct Link\n\nMade With ❤ BY @MoviesFlixers_DL**", 99 | disable_web_page_preview=True, 100 | reply_markup=START_BUTTONS 101 | ) 102 | 103 | @bot.on_message(filters.text & filters.private) 104 | async def Doodstream_uploader(bot, message): 105 | new_string = str(message.text) 106 | conv = await message.reply("Processing your given URL ⚡") 107 | dele = conv["message_id"] 108 | try: 109 | Doodstream_link = await multi_Doodstream_up(new_string) 110 | await bot.delete_messages(chat_id=message.chat.id, message_ids=dele) 111 | await message.reply(f'**{Doodstream_link}**' , quote=True) 112 | except Exception as e: 113 | await message.reply(f'Error: {e}', quote=True) 114 | 115 | 116 | @bot.on_message(filters.photo & filters.private) 117 | async def Doodstream_uploader(bot, message): 118 | new_string = str(message.caption) 119 | conv = await message.reply("Processing your given URL ⚡") 120 | dele = conv["message_id"] 121 | try: 122 | Doodstream_link = await multi_Doodstream_up(new_string) 123 | if(len(Doodstream_link) > 1020): 124 | await bot.delete_messages(chat_id=message.chat.id, message_ids=dele) 125 | await message.reply(f'{Doodstream_link}' , quote=True) 126 | else: 127 | await bot.delete_messages(chat_id=message.chat.id, message_ids=dele) 128 | await bot.send_photo(message.chat.id, message.photo.file_id, caption=f'**{Doodstream_link}**') 129 | except Exception as e: 130 | await message.reply(f'Error: {e}', quote=True) 131 | 132 | 133 | '''async def get_ptitle(url): 134 | if ('bit' in url ): 135 | url = urlopen(url).geturl() 136 | 137 | 138 | html_text = requests.get(url).text 139 | soup = BeautifulSoup(html_text, 'html.parser') 140 | for title in soup.find_all('title'): 141 | pass 142 | title = list(title.get_text()) 143 | title = title[8:] 144 | str = 't.me/' + CHANNEL + ' ' 145 | for i in title: 146 | str = str + i 147 | lst = list(html_text.split(",")) 148 | c = 0 149 | for i in lst: 150 | if ("""/e/""" in i): 151 | found = lst[c] 152 | break 153 | c += 1 154 | 155 | # Doodstream.com link 156 | Doodstream_video_id = list(found.split(":")) 157 | video_id = Doodstream_video_id[2] 158 | video_id = list(video_id.split(",")) 159 | v_id = video_id[0] 160 | #v_len = len(v_id) 161 | #v_id = v_id[1:v_len - 2] 162 | 163 | v_url = 'https://vidzoop.blogspot.com/p/share-video.html?vid=' + v_id + '&m=1' 164 | v_url = url 165 | res = [str, v_url] 166 | return res''' 167 | 168 | 169 | async def Doodstream_up(link): 170 | if ('bit' in link ): 171 | #link = urlopen(link).geturl() 172 | unshortener = UnshortenIt() 173 | link = unshortener.unshorten(link) 174 | 175 | title_new = urlparse(link) 176 | title_new = os.path.basename(title_new.path) 177 | title_Doodstream = '@' + CHANNEL + title_new 178 | realaurl = 'https://diskuploader.mypowerdisk.com/v1/tp/cp' 179 | param = {'token':f'{MDISK_TOKEN}','link':link} 180 | res = requests.post(realaurl, json = param) 181 | data = res.json() 182 | data = dict(data) 183 | print(data) 184 | #bot.delete_messages(con) 185 | v_url = data['sharelink'] 186 | return (v_url) 187 | 188 | 189 | async def multi_Doodstream_up(ml_string): 190 | list_string = ml_string.splitlines() 191 | ml_string = ' \n'.join(list_string) 192 | new_ml_string = list(map(str, ml_string.split(" "))) 193 | new_ml_string = await remove_username(new_ml_string) 194 | new_join_str = "".join(new_ml_string) 195 | 196 | urls = re.findall(r'(https?://[^\s]+)', new_join_str) 197 | 198 | nml_len = len(new_ml_string) 199 | u_len = len(urls) 200 | url_index = [] 201 | count = 0 202 | for i in range(nml_len): 203 | for j in range(u_len): 204 | if (urls[j] in new_ml_string[i]): 205 | url_index.append(count) 206 | count += 1 207 | new_urls = await new_Doodstream_url(urls) 208 | url_index = list(dict.fromkeys(url_index)) 209 | i = 0 210 | for j in url_index: 211 | new_ml_string[j] = new_ml_string[j].replace(urls[i], new_urls[i]) 212 | i += 1 213 | 214 | new_string = " ".join(new_ml_string) 215 | return await addFooter(new_string) 216 | 217 | 218 | async def new_Doodstream_url(urls): 219 | new_urls = [] 220 | for i in urls: 221 | time.sleep(0.2) 222 | new_urls.append(await Doodstream_up(i)) 223 | return new_urls 224 | 225 | 226 | async def remove_username(new_List): 227 | for i in new_List: 228 | if('@' in i or 't.me' in i or 'https://bit.ly/abcd' in i or 'https://bit.ly/123abcd' in i or 'telegra.ph' in i): 229 | new_List.remove(i) 230 | return new_List 231 | 232 | async def addFooter(str): 233 | footer = """ 234 | ━━━━━━━━━━━━━━━ 235 | ✪ »JOIN CHANNEL ➡️ t.me/""" + CHANNEL 236 | return str + footer 237 | 238 | bot.run() 239 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | bs4 2 | pyrogram 3 | tgcrypto 4 | aiohttp~>3.8.5 5 | requests 6 | pyshorteners 7 | #doodstream 8 | unshortenit 9 | -------------------------------------------------------------------------------- /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.9.9 2 | --------------------------------------------------------------------------------