diff --git a/README.md b/README.md index 611ff06..bba3f36 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,9 @@ This is a telegram bot writen in python for mirroring files on the internet to o - Delete files from drive - Shortener support - Custom Filename (Only for url, telegram files and ytdl. Not for mega links and magnet/torrents) -- Extracting password protected files and using custom filename see these examples: -> https://telegra.ph/Magneto-Python-Aria---Custom-Filename-Examples-01-20 +- Extracting password protected files, using custom filename and download from password protected index links see these examples: +
+ - Extract these filetypes and uploads to google drive ``` ZIP, RAR, TAR, 7z, ISO, WIM, CAB, GZIP, BZIP2, @@ -141,7 +142,7 @@ sudo docker run mirrorbot Fork this repo then upload **token.pickle** to your forks -**NOTE**: If you didn't upload **token.pickle**, uploading will not working. +**NOTE**: If you didn't upload **token.pickle**, uploading will not work. ## Deploying on Heroku using heroku-cli @@ -246,6 +247,9 @@ machine host login username password my_youtube_password ``` where host is the name of extractor (eg. youtube, twitch). Multiple accounts of different hosts can be added each separated by a new line +# Support Group + + # Credits Thanks to: diff --git a/bot/__main__.py b/bot/__main__.py index 1ac8dae..24ce9f4 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -38,7 +38,7 @@ def stats(update, context): f'CPU: {cpuUsage}%\n' \ f'RAM: {memory}%\n' \ f'Disk: {disk}%' - sendMessage(stats, context.bot, update) + update.effective_message.reply_photo("https://telegra.ph/file/db03910496f06094f1f7a.jpg", stats, parse_mode=ParseMode.HTML) @run_async @@ -60,7 +60,7 @@ def chat_list(update, context): def repo(update, context): bot.send_message(update.message.chat_id, reply_to_message_id=update.message.message_id, - text="Repo: https://github.com/breakdowns/slam-mirrorbot\nGroup: https://t.me/SlamMirrorSupportGroup", disable_web_page_preview=True) + text="Repo: https://github.com/breakdowns/slam-mirrorbot\nGroup: https://t.me/SlamMirrorSupport", disable_web_page_preview=True) @run_async diff --git a/bot/helper/mirror_utils/download_utils/direct_link_generator.py b/bot/helper/mirror_utils/download_utils/direct_link_generator.py index 9dabbcd..9917f11 100644 --- a/bot/helper/mirror_utils/download_utils/direct_link_generator.py +++ b/bot/helper/mirror_utils/download_utils/direct_link_generator.py @@ -42,6 +42,8 @@ def direct_link_generator(link: str): return osdn(link) elif 'github.com' in link: return github(link) + elif 'racaty.net' in link: + return racaty(link) else: raise DirectDownloadLinkException(f'No Direct link function found for {link}') @@ -173,6 +175,22 @@ def github(url: str) -> str: raise DirectDownloadLinkException("`Error: Can't extract the link`\n") +def racaty(url: str) -> str: + dl_url = '' + try: + link = re.findall(r'\bhttps?://.*racaty\.net\S+', url)[0] + except IndexError: + raise DirectDownloadLinkException("`No Racaty links found`\n") + reqs=requests.get(link) + bss=BeautifulSoup(reqs.text,'html.parser') + op=bss.find('input',{'name':'op'})['value'] + id=bss.find('input',{'name':'id'})['value'] + rep=requests.post(link,data={'op':op,'id':id}) + bss2=BeautifulSoup(rep.text,'html.parser') + dl_url=bss2.find('a',{'id':'uniqueExpirylink'})['href'] + return dl_url + + def useragent(): """ useragent random setter diff --git a/bot/helper/mirror_utils/upload_utils/gdriveTools.py b/bot/helper/mirror_utils/upload_utils/gdriveTools.py index ba5bf0f..19e06af 100644 --- a/bot/helper/mirror_utils/upload_utils/gdriveTools.py +++ b/bot/helper/mirror_utils/upload_utils/gdriveTools.py @@ -326,7 +326,8 @@ class GoogleDriveHelper: else: buttons.buildbutton("☁️Drive Link☁️", durl) if INDEX_URL is not None: - url = requests.utils.requote_uri(f'{INDEX_URL}/{meta.get("name")}/') + url_path = requests.utils.quote(f'{meta.get("name")}') + url = f'{INDEX_URL}/{url_path}/' if SHORTENER is not None and SHORTENER_API is not None: siurl = requests.get('https://{}/api?api={}&url={}&format=text'.format(SHORTENER, SHORTENER_API, url)).text buttons.buildbutton("⚡Index Link⚡", siurl) @@ -353,7 +354,8 @@ class GoogleDriveHelper: except TypeError: pass if INDEX_URL is not None: - url = requests.utils.requote_uri(f'{INDEX_URL}/{file.get("name")}') + url_path = requests.utils.quote(f'{file.get("name")}') + url = f'{INDEX_URL}/{url_path}' if SHORTENER is not None and SHORTENER_API is not None: siurl = requests.get('https://{}/api?api={}&url={}&format=text'.format(SHORTENER, SHORTENER_API, url)).text buttons.buildbutton("⚡Index Link⚡", siurl) @@ -515,12 +517,14 @@ class GoogleDriveHelper: else: msg += f"Drive Link" if INDEX_URL is not None: - url = requests.utils.requote_uri(f'{INDEX_URL}/{file.get("name")}/') + url_path = requests.utils.quote(f'{file.get("name")}') + url = f'{INDEX_URL}/{url_path}/' if SHORTENER is not None and SHORTENER_API is not None: siurl = requests.get('https://{}/api?api={}&url={}&format=text'.format(SHORTENER, SHORTENER_API, url)).text msg += f' | Index Link' else: msg += f' | Index Link' + else: furl = f"https://drive.google.com/uc?id={file.get('id')}&export=download" msg += f"⁍{file.get('name')}
({get_readable_file_size(int(file.get('size')))})📄