├── .github └── workflows │ ├── CodeFormatter.yml │ └── docker-publish.yml ├── .gitignore ├── Dockerfile ├── LICENSE ├── Procfile ├── README.md ├── app.json ├── bot ├── __init__.py ├── __main__.py ├── config.py ├── helpers │ ├── __init__.py │ ├── decorators.py │ └── functions.py ├── logging.py ├── modules │ ├── bypasser.py │ ├── direct_link.py │ ├── gdrive_direct.py │ ├── lists.py │ ├── pasting.py │ ├── regex.py │ ├── scraper.py │ └── shortener.py ├── plugins │ ├── __init__.py │ ├── developer │ │ ├── __init__.py │ │ ├── ipinfo.py │ │ ├── log.py │ │ ├── terminal.py │ │ └── updater.py │ ├── sudo │ │ ├── __init__.py │ │ ├── serverstats.py │ │ └── speedtest.py │ └── users │ │ ├── __init__.py │ │ ├── bifm.py │ │ ├── bypass.py │ │ ├── direct.py │ │ ├── gdfv.py │ │ ├── index.py │ │ ├── magnet.py │ │ ├── mkvcinema.py │ │ ├── ping.py │ │ ├── pybyp.py │ │ ├── scrape.py │ │ ├── shortener.py │ │ └── start.py └── version.py ├── captain-definition ├── chromedriver ├── docker-compose.yml ├── fly.toml ├── heroku.yml ├── okteto-stack.yaml ├── renovate.json ├── requirements.txt ├── sample_config.env ├── server.py └── start.sh /.github/workflows/CodeFormatter.yml: -------------------------------------------------------------------------------- 1 | name: Code Formatter 2 | on: [push, workflow_dispatch] 3 | jobs: 4 | PEP8: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - uses: actions/checkout@v3.1.0 8 | - name: Setup Python 9 | uses: actions/setup-python@v4.3.0 10 | with: 11 | python-version: 3.9 12 | - name: Install Python lint libraries 13 | run: | 14 | pip install autopep8 autoflake isort black 15 | - name: Check for Showstoppers 16 | run: > 17 | autopep8 --verbose --in-place --recursive --aggressive --aggressive 18 | --ignore=W605 bot/helpers/ bot/modules/ bot/plugins/developer bot/plugins/sudo bot/plugins/users bot/__init__.py bot/config.py bot/logging.py bot/version.py 19 | - name: Remove Unused Imports and Variables 20 | run: > 21 | autoflake --in-place --recursive --remove-all-unused-imports 22 | --remove-unused-variables --ignore-init-module-imports . 23 | - name: Lint with Isort and Black 24 | run: | 25 | isort bot/helpers/ bot/modules/ bot/plugins/developer bot/plugins/sudo bot/plugins/users bot/__init__.py bot/config.py bot/logging.py bot/version.py 26 | black bot/helpers/ bot/modules/ bot/plugins/developer bot/plugins/sudo bot/plugins/users bot/__init__.py bot/config.py bot/logging.py bot/version.py 27 | - uses: stefanzweifel/git-auto-commit-action@v4.15.4 28 | with: 29 | commit_message: "Auto: Code Formatted" 30 | commit_options: "--no-verify" 31 | repository: . 32 | commit_user_name: Ms Emily 33 | commit_user_email: emilymiss2022@gmail.com 34 | commit_author: MsEmily 35 | -------------------------------------------------------------------------------- /.github/workflows/docker-publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish Docker Image 2 | 3 | # This workflow uses actions that are not certified by GitHub. 4 | # They are provided by a third-party and are governed by separate terms of service, privacy policy, and support documentation. 5 | 6 | on: 7 | pull_request: 8 | branches: [ "main" ] 9 | 10 | env: 11 | # Use docker.io for Docker Hub if empty 12 | REGISTRY: ghcr.io 13 | # github.repository as / 14 | IMAGE_NAME: ${{ github.repository }} 15 | 16 | 17 | jobs: 18 | build: 19 | runs-on: ubuntu-latest 20 | permissions: 21 | contents: read 22 | packages: write 23 | # This is used to complete the identity challenge with sigstore/fulcio when running outside of PRs. 24 | id-token: write 25 | steps: 26 | - name: Checkout repository 27 | uses: actions/checkout@v3.1.0 28 | # Install the cosign tool except on PR (https://github.com/sigstore/cosign-installer) 29 | - name: Install cosign 30 | if: github.event_name != 'pull_request' 31 | uses: sigstore/cosign-installer@v2.8.1 32 | with: 33 | cosign-release: 'v1.10.0' 34 | # Workaround: https://github.com/docker/build-push-action/issues/461 35 | - name: Setup Docker buildx 36 | uses: docker/setup-buildx-action@v2.2.1 37 | # Login against a Docker registry except on PR (https://github.com/docker/login-action) 38 | - name: Log into registry ${{ env.REGISTRY }} 39 | if: github.event_name != 'pull_request' 40 | uses: docker/login-action@v2.1.0 41 | with: 42 | registry: ${{ env.REGISTRY }} 43 | username: ${{ github.actor }} 44 | password: ${{ secrets.GITHUB_TOKEN }} 45 | # Extract metadata (tags, labels) for Docker (https://github.com/docker/metadata-action) 46 | - name: Extract Docker metadata 47 | id: meta 48 | uses: docker/metadata-action@v4.1.1 49 | with: 50 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 51 | # Build and push Docker image with Buildx (don't push on PR) (https://github.com/docker/build-push-action) 52 | - name: Build and push Docker image 53 | id: build-and-push 54 | uses: docker/build-push-action@v3.2.0 55 | with: 56 | context: . 57 | push: ${{ github.event_name != 'pull_request' }} 58 | tags: ${{ steps.meta.outputs.tags }} 59 | labels: ${{ steps.meta.outputs.labels }} 60 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bot/__pycache__/* 2 | bot/helpers/__pycache__/* 3 | bot/modules/__pycache__/* 4 | bot/plugins/__pycache__/* 5 | bot/plugins/developer/__pycache__/* 6 | bot/plugins/sudo/__pycache__/* 7 | bot/plugins/users/__pycache__/* 8 | MultiFunctionBot.session 9 | MultiFunctionBot.session-journal 10 | bot/MultiFunctionBot.session 11 | bot/MultiFunctionBot.session-journal 12 | bot/helpers/utilities/__pycache__/* 13 | __pycache__/* 14 | .vscode 15 | .vscode/* 16 | .idea 17 | .idea/* 18 | venv/* 19 | *logs.txt 20 | git-filter-repo -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM missemily22/multifbot:latest 2 | 3 | WORKDIR /usr/src/app 4 | SHELL ["/bin/bash", "-c"] 5 | RUN chmod 777 /usr/src/app 6 | 7 | 8 | COPY requirements.txt requirements.txt 9 | RUN pip3 install --no-cache-dir -r requirements.txt 10 | 11 | COPY . . 12 | 13 | CMD ["bash","start.sh"] -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bash start.sh -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Telegram Bot to bypass Short Links, get direct DLs & also Shorten URLs 2 | 3 | > # Environment Variables 4 | 5 | - `API_HASH` Your API Hash from [my.telegram.org](https://my.telegram.org) 6 | - `API_ID` Your API ID from [my.telegram.org](https://my.telegram.org) 7 | - `BOT_TOKEN` Your bot token from [@BotFather](https://telegram.dog/BotFather) 8 | - `COMMAND_PREFIXES` Prefixes for running Bot Commands. Separate them by space such as "! . /" 9 | - `OWNER_ID` - User ID of the Bot Owner (controls sensitive Bot Information!) 10 | - `SUDO_USERS` Sudo Users who can control the Bot. Separate User IDs by space 11 | - `BOT_USERNAME` Your BotuserName Without `@`. Example `MultiFunctionUse_Bot` 12 | - `BIFM_URL` Your [BIFM](https://git.gay/a/bifm) instance Url. Default to `https://bifm.tacohitbox.com/api/bypass?url` 13 | - `GDTOT_CRYPT` Put your GDTot Crypt 14 | - `UNIFIED_EMAIL` Put your Generated Unified Email 15 | - `UNIFIED_PASS` Put your Generated Unified Pass 16 | - `HUBDRIVE_CRYPT` Put your HubDrive Crypt 17 | - `KATDRIVE_CRYPT` Put your KatDrive Crypt 18 | - `KOLOP_CRYPT` Put your Kolop Crypt 19 | - `DRIVEFIRE_CRYPT` Put your DriveFire Crypt 20 | - `DRIVEBUZZ_CRYPT` Put your DriveBuzz Crypt 21 | - `DRIVEHUB_CRYPT` Put your DriveHub Crypt 22 | - `GADRIVE_CRYPT` Put your GaDrive Crypt 23 | - `JIODRIVE_CRYPT` Put your JioDrive Crypt 24 | - `Sharerpw_XSRF` Put your Sharer XSRF Token 25 | - `Sharerpw_laravel` Put your Sharer Laravel Session 26 | - `UPTOBOX_TOKEN` Put your UptoBox Account Token (Free Account works too!) 27 | - `EMILY_API_URL` Your [Emily API](https://github.com/missemily2022/Emily-API) instance Urls. Separate API URLs by space 28 | - `UPSTREAM_REPO` Add the Upstream Repo of your Bot for automatic updation 29 | --- 30 | 31 | NOTE: Fill the above values in config.env or use them as Environment Variables.
32 | 33 | # BotFather Commands - 34 | ``` 35 | start - Bot Start Message 36 | help - Alias command for start 37 | bifm - Bypass Short Links using BIFM API 38 | direct - Get Direct Link for various Supported URLs 39 | bypass - Bypass Various Supported Shortened URLs 40 | multi - Bypass Short Links using PyBypass Library 41 | shorten - Get AdFree Shortened URLs of your Link 42 | magnet - Extract Magnet from Torrent Websites 43 | mkvcinema - Scrape MKV Cinemas URL for Direct Links 44 | index - Extract Direct Links from Bhadoo Index Folder URLs 45 | scrape - Extract Direct Links from Supported Sites 46 | gd - Get GDrive Links for various Drive File Sharer 47 | ``` 48 | 49 |
50 | Basic Bot Commands and it's usage 51 |
    52 |
    53 |
  • 54 | Users Commands

    55 | /start - To get the start message.
    56 | /help - Alias command for start.
    57 | /ping - Ping the telegram api server.
    58 | /bifm - Bypass Short Links using BIFM API
    59 | /direct - Get Direct Link for various Supported URLs
    60 | /bypass - Bypass Various Supported Shortened URLs
    61 | /multi - Bypass Short Links using PyBypass Library
    62 | /shorten - Get AdFree Shortened URLs of your Link
    63 | /magnet - Extract Magnet from Torrent Websites
    64 | /mkvcinema - Scrape MKV Cinemas URL for Direct Links
    65 | /index - Extract Direct Links from Bhadoo Index Folder URLs
    66 | /scrape - Extract Direct Links from Supported Sites
    67 | /gd - Get GDrive Links for various Drive File Sharer
    68 |
  • 69 |
    70 |
  • 71 | Sudo User Commands

    72 | /speedtest: Check the internet speed of bot server.
    73 | /serverstats: Get the stats of server.
    74 | /stats: Alias command for serverstats.
    75 |
  • 76 |
    77 |
  • 78 | Developer Commands

    79 | /shell: To run the terminal commands via bot.
    80 | /exec: To run the python commands via bot.
    81 | /update: To update the bot to latest commit from UpStream Repositorys.
    82 | /restart: Restart the bot.
    83 | /log: To get the log file of bot.
    84 |
85 |
86 |
87 | 88 | 89 | # Contributions - 90 | - Thanks to [Sanjit Sinha](https://github.com/sanjit-sinha) for [Telegram-Bot-Boilerplate](https://github.com/sanjit-sinha/Telegram-Bot-Boilerplate) Template 91 | - Thanks to [Yukki Senpai](https://github.com/xcscxr) for Bypassers as well as GDrive Sharer Directs 92 | - Thanks to [Jack](https://github.com/JohnWickKeanue) for Site Scraping Scripts 93 | - Thanks to [Miss Emily](https://github.com/missemily22) for maintaining the Repo as well as the API 94 | - Thanks to [zevtyardt](https://github.com/zevtyardt/lk21) for LK21 Bypasser 95 | - Thanks to [Disha Patel](https://github.com/dishapatel010) for ArtStation, MDisk and WeTransfer Direct link Gen 96 | - Thanks to [Bipin Krishna](https://github.com/bipinkrish) for OlaMovies, IGG Games and FileCrypt Site Scrapers 97 | 98 | # Deployment 99 | 100 | ## ⚛️ Deploying on Heroku 101 | - Click on the Button below to deploy this Bot to Heroku 102 | 103 | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/missemily22/MultiFunctionBot) 104 | 105 | 106 | 107 |

🐳Build or Deploy using Docker

108 |

MultiFunctionBot can be deployed almost everywhere using Docker

109 |

1.To pull MultiFunctionBot Docker Image:

110 |

->docker pull ghcr.io/missemily22/multifunctionbot:main

111 |

2.Or, to use as base Image:

112 |

->FROM ghcr.io/missemily22/multifunctionbot:main

113 |

⛔NOTE:

114 |

Docker Image only accepts the variables as stated before

115 |

Fly.io is platform and best alternative of Heroku (Salesforce) becuase here you can deploy your apps by just adding Credit Card (without being charged) or anyother payment methods, unlike Heroku, they offers you 2,340 running hours per month while Heroku only provides 550 running hours (dyno hours) to run your app! that means you don't have to worry about suddenly getting your app stopped like in the case of Heroku. Fly.io also not restarts your app each 24 hours which enables you to clone bigger data easily.

116 |

1.Create an account on Fly.io.

117 | 118 |

2.Install flyctl on your system.

119 |

MacOS / Linux:

120 |

curl -L https://fly.io/install.sh | sh

121 |

Using Brew:

122 |

brew install flyctl

123 |

Windows Powershell:

124 |

iwr https://fly.io/install.ps1 -useb | iex

125 |

Termux: (Refer #54)

126 |

pkg install flyctl

127 |

3.Download MultiFunctionBot Repository:

128 |

git clone https://github.com/missemily22/MultiFunctionBot

129 |

4.Now run following commands:

130 |

131 | cd MultiFunctionBot - To change directory.
132 | fly auth login - To login on Fly.io.
133 | fly launch - To configure basic things, like app name and data center as well as creating fly.toml. 134 |

135 |

5.Configure App:

136 |

1.For app name keep the field empty (Hit Enter), and for choosing data center! use arrow keys to select one. For attaching Postgres Database enter 137 | N including for Deploy Now.

138 |

2.Once you run the above command! It will say fly.toml file exists, open the fly.toml file with any text editor and under [env] section put your Env Variables !

139 | 140 |

3.Everything done! now run the final deploy command to deploy your app.

141 |

fly deploy - To deploy your app.

142 |

⛔NOTICE:
1. You can use flyctl instead of fly.
2. Choose yes to Use Exisiting Configurtion to avoid loss of fly.toml file

143 | 144 |

♦️Deploy on Clever Cloud

145 |

Clever Cloud is a Europe-based PaaS (Platform as a Service) company. They help developers deploy and run their apps with bulletproof infrastructure, automatic scaling as well as fair pricing. In my opinion! it is best choice to deploy MultiFunctionBot on Clever Cloud because pricing is excellent & fair as well as you can run MultiFunctionBot for days to clone large amount of data.

146 |

⛔NOTICE: Before deploying/running MultiFunctionBot on Clever Cloud! Don't forget to add payment method like credit card in your account to verify your account otherwise deploying and using MultiFunctionBot on Clever Cloud will cause suspension of your app/account.

147 |

1.First log in on Clever Cloud.

148 | 149 |

2.Now click on Create and then select an application from the list.

150 | 151 |

3.Once you reach "Application Creation" page, choose "Create an application from GitHub repository" and select the MultiFunctionBot Repository. Not visible? fork this!

152 | 153 |

4.Done? now specify the application type by choosing our beloved Docker.😘

154 | 155 |

5.After that! directly click Next on "How many number of instances?" page and keep the number of instance only 1. Additionally, you can keep instance type to Nano which is most cheap because MultiFunctionBot is designed to run on very low end systems.

156 | 157 |

6.Provide your instance a beautiful name, it can be "MultiFunctionBot" itself, and for instance location, you can choose Paris France for lower ping (tested!😉).

158 | 159 |

7.Now it will navigate to "Add-ons" page, simply click I DON'T NEED ANY ADD-ONS because... you already know it!🌟 still why? it is designed for low end systems.

160 | 161 |

8.Then enter Environment Variables one by one and Clever Cloud will start deploying your instance.

162 | 163 |

9.Finally! to check if MultiFunctionBot is working perfectly, you can open the domain (it will display the guide) provided by Clever Cloud for your instance which can be collected from Domain Names tab and for logs you can check Logs tab.

164 | 165 | 166 |

🪬Deploy on Okteto

167 |

Okteto is Kubernetes development platforms and used by many users and it is ideal for lightweight apps and it is perfect for MultiFunctionBot, Okteto is worst than Heroku, your bot will sleep after 24 hours and will not get back to online until you ping the provided ENDPOINT.

168 |

1.First Create your Okteto Account, You need one GitHub account as okteto supports only one Method to either Create or Login: Create/Login on Okteto

169 |

2.Now fork this repository, and go to Okteto Dashboard then press "Launch Dev Environment".

170 |

3.After it, select your forked repository and select branch main and add following value carefully:

171 |

172 | Add your Environment Variables one by one 173 |

174 |

4.Once done! press "Launch" and you successfully done it! Yes 😊

175 |

5.Okteto make your deployed app to sleep if provided ENDPOINT (Allotted URL) remain untouched for 24 Hours. So lets setup a simple cron-job to keep your app active.

176 |

6.First copy your app's ENDPOINT as shown in the image and go to Cron-Job.org and sign up!

177 |

7.Done? Nice! now click "CREATE CRONJOB" button and provide your copied ENDPOINT URL that you just copied and change execution schedule to every 5 minutes.Finally! click "CREATE" and you done it! 😌 Relax and use MultiFunctionBot freely.

178 |

⛔NOTE: Don't forget to setup Cron-Job for Okteto otherwise your deployed bot will go into sleep and you have to active it from Okteto Dashboard, while Cron-Job doing it on your behalf.

179 | 180 |

🖥️ Deploy on VPS or PC

181 |

Running MultiFunctionBot on your PC or VPS is very simple and takes very less efforts! It have very less load on your System and don't use your bandwidth or Internet connection for cloning Google Drive data but only for calling Telegram APIs to update the progress or to generate required response.

182 |

1.Download Requirements:

183 |

184 | ->Python 3 or above with pip
185 | ->Git 186 |

187 |

2.Download Repository:

188 |

189 | ->git clone https://github.com/missemily22/MultiFunctionBot
190 |

191 |

3.Install MultiFunctionBot Requirements:

192 |

193 | ->cd MultiFunctionBot
194 | ->pip install -r requirements.txt 195 |

196 |

4.Edit Config.ini file

197 |

198 | ->Renamesample_config.env to config.env and open the file in any text editor and enter the values of variables as described
199 |

200 |

5.Start MultiFunctionBot:

201 |

202 | ->cd MultiFunctionBot
203 | ->python -m bot 204 |

205 |

6.Stop MultiFunctionBot:

206 |

207 | ->Press CTRL + C keys 208 |

209 | 210 | ## Note: 211 | - I will soon add other Deployment Methods! 212 | 213 | ### Credits 214 | - Bot is purely based on [Disha Patel](https://github.com/dishapatel010) [MMBot](https://github.com/dishapatel010/mmbot) -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MultiFunctionBot", 3 | "description": "Telegram Bot to bypass Short Links, get direct DLs & also Shorten URLs", 4 | "keywords": [ 5 | "telegram", 6 | "bypass", 7 | "dlgen", 8 | "shortener", 9 | "adlinks", 10 | "python", 11 | "bot" 12 | ], 13 | "repository": "https://github.com/missemily22/MultiFunctionBot/", 14 | "success_url": "/", 15 | "env": { 16 | "API_ID": { 17 | "description": "Get this value from https://my.telegram.org", 18 | "value":"", 19 | "required": true 20 | }, 21 | "API_HASH": { 22 | "description": "Get this value from https://my.telegram.org", 23 | "value":"", 24 | "required": true 25 | }, 26 | "BOT_TOKEN": { 27 | "description": "Get this value from @BotFather", 28 | "value":"", 29 | "required": true 30 | }, 31 | "OWNER_ID": { 32 | "description": "User ID of the Bot Owner (controls sensitive Bot Information!). Add values seperated by space", 33 | "value":"", 34 | "required": true 35 | }, 36 | "SUDO_USERS": { 37 | "description": "Sudo Users who can control the Bot. Add values seperated by space", 38 | "value":"", 39 | "required": true 40 | }, 41 | "UPSTREAM_REPO": { 42 | "description": "Add the Upstream Repo of your Bot for automatic updation. Add values seperated by space", 43 | "value":"-1", 44 | "required": false 45 | }, 46 | "BOT_USERNAME": { 47 | "description": "Your Bot userName Without `@`", 48 | "value":"", 49 | "required": true 50 | }, 51 | "BIFM_URL": { 52 | "description": "Your BIFM Instance URL(Use Default)", 53 | "value":"https://bifm.tacohitbox.com/api/bypass?url", 54 | "required": true 55 | }, 56 | "EMILY_API_URL": { 57 | "description": "Your Emily Bypass API Instance URL(Use Default)", 58 | "value":"https://api.emilyx.in/api", 59 | "required": true 60 | }, 61 | "TELEGRAPH_NAME": { 62 | "description": "Put a Telegr.ph / graph.org UserName to generate Token", 63 | "value":"MultiFunction", 64 | "required": true 65 | }, 66 | "TELEGRAPH_LINK": { 67 | "description": "Put a Telegr.ph / graph.org Author Link to generate Token", 68 | "value":"https://github.com/missemily22", 69 | "required": true 70 | }, 71 | "GDTOT_CRYPT": { 72 | "description": "Put your GDTot Crypt", 73 | "value":"", 74 | "required": false 75 | }, 76 | "UNIFIED_EMAIL": { 77 | "description": "Put your Generated Unified Email", 78 | "value":"", 79 | "required": false 80 | }, 81 | "UNIFIED_PASS": { 82 | "description": "Put your Generated Unified Pass", 83 | "value":"", 84 | "required": false 85 | }, 86 | "HUBDRIVE_CRYPT": { 87 | "description": "Put your HubDrive Crypt", 88 | "value":"", 89 | "required": false 90 | }, 91 | "KATDRIVE_CRYPT": { 92 | "description": "Put your KatDrive Crypt", 93 | "value":"", 94 | "required": false 95 | }, 96 | "KOLOP_CRYPT": { 97 | "description": "Put your Kolop Crypt", 98 | "value":"", 99 | "required": false 100 | }, 101 | "DRIVEFIRE_CRYPT": { 102 | "description": "Put your DriveFire Crypt", 103 | "value":"", 104 | "required": false 105 | }, 106 | "DRIVEBUZZ_CRYPT": { 107 | "description": "Put your DriveBuzz Crypt", 108 | "value":"", 109 | "required": false 110 | }, 111 | "GADRIVE_CRYPT": { 112 | "description": "Put your GaDrive Crypt", 113 | "value":"", 114 | "required": false 115 | }, 116 | "JIODRIVE_CRYPT": { 117 | "description": "Put your JioDrive Crypt", 118 | "value":"", 119 | "required": false 120 | }, 121 | "Sharerpw_XSRF": { 122 | "description": "Put your Sharer XSRF Token", 123 | "value":"", 124 | "required": false 125 | }, 126 | "Sharerpw_laravel": { 127 | "description": "Put your Sharer Laravel Session", 128 | "value":"", 129 | "required": false 130 | }, 131 | "UPTOBOX_TOKEN": { 132 | "description": "Put your UptoBox Account Token (Free Account works too!)", 133 | "value":"", 134 | "required": false 135 | } 136 | }, 137 | "stack": "container", 138 | "buildpacks": [ 139 | { 140 | "url": "heroku/python" 141 | } 142 | ], 143 | "formation": { 144 | "web": { 145 | "quantity": 1, 146 | "size": "free" 147 | } 148 | } 149 | } -------------------------------------------------------------------------------- /bot/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import time 4 | 5 | from pyrogram import Client, __version__ 6 | from pyrogram.raw.all import layer 7 | 8 | from bot.config import API_HASH, API_ID, BOT_TOKEN, BOT_USERNAME 9 | from bot.logging import LOGGER 10 | 11 | BotStartTime = time.time() 12 | plugins = dict(root="bot/plugins") 13 | 14 | if sys.version_info[0] < 3 or sys.version_info[1] < 7: 15 | VERSION_ASCII = """ 16 | ============================================================= 17 | "You MUST need to be on python 3.7 or above, shutting down the bot... 18 | ============================================================= 19 | """ 20 | LOGGER(__name__).critical(VERSION_ASCII) 21 | sys.exit(1) 22 | 23 | 24 | BANNER = """ 25 | ________________________________________________________________________________________________________________ 26 | | _____ .__ __ .__ ___________ __ .__ __________ __ | 27 | | / \ __ __| |_/ |_|__| \_ _____/_ __ ____ _____/ |_|__| ____ ____ \______ \ _____/ |_ | 28 | | / \ / \| | \ |\ __\ | | __)| | \/ \_/ ___\ __\ |/ _ \ / \ | | _// _ \ __\ | 29 | | / Y \ | / |_| | | | | \ | | / | \ \___| | | ( <_> ) | \ | | ( <_> ) | | 30 | | \____|__ /____/|____/__| |__| \___ / |____/|___| /\___ >__| |__|\____/|___| / |______ /\____/|__| | 31 | | \/ \/ \/ \/ \/ \/ | 32 | |______________________________________________________________________________________________________________| 33 | """ 34 | # https://patorjk.com/software/taag/#p=display&f=Graffiti&t=Multi%20Function%20Bot 35 | 36 | un = f"@{BOT_USERNAME}" 37 | 38 | LOGGER(__name__).info(BANNER) 39 | LOGGER(__name__).info("Installing Bot Requirements...") 40 | os.system("pip3 install --no-cache-dir -r requirements.txt --upgrade") 41 | LOGGER(__name__).info(f"Pyrogram v{__version__} (Layer {layer}) started on {un}.") 42 | LOGGER(__name__).info("Telegram Bot Started.") 43 | 44 | bot = Client( 45 | "MultiFunctionBot", 46 | api_id=API_ID, 47 | api_hash=API_HASH, 48 | bot_token=BOT_TOKEN, 49 | plugins=plugins, 50 | ) # https://docs.pyrogram.org/topics/smart-plugins 51 | -------------------------------------------------------------------------------- /bot/__main__.py: -------------------------------------------------------------------------------- 1 | from bot import bot 2 | 3 | if __name__ == "__main__": 4 | bot.run() -------------------------------------------------------------------------------- /bot/config.py: -------------------------------------------------------------------------------- 1 | from os import environ 2 | 3 | from dotenv import load_dotenv 4 | 5 | from bot.logging import LOGGER 6 | 7 | load_dotenv("config.env", override=True) 8 | 9 | API_ID = int(environ.get("API_ID", 0)) 10 | API_HASH = environ.get("API_HASH", "") 11 | if API_ID is None or len(API_HASH) == 0: 12 | LOGGER(__name__).error("Telegram API is missing!") 13 | exit(1) 14 | 15 | BOT_TOKEN = environ.get("BOT_TOKEN", "") 16 | if len(BOT_TOKEN) == 0: 17 | LOGGER(__name__).error("BOT_TOKEN is missing!") 18 | exit(1) 19 | 20 | BOT_USERNAME = environ.get("BOT_USERNAME", "") 21 | if len(BOT_USERNAME) == 0: 22 | LOGGER(__name__).error("BOT_USERNAME not provided!") 23 | exit(1) 24 | if "@" in BOT_USERNAME: 25 | BOT_USERNAME = BOT_USERNAME.replace("@", "") 26 | 27 | list = [] 28 | cmd_prfx = environ.get("COMMAND_PREFIXES", "! / .") 29 | if len(cmd_prfx) != 0: 30 | for cmds in cmd_prfx.split(): 31 | list.append(cmds.strip()) 32 | COMMAND_PREFIXES = dict(prefixes=list) 33 | else: 34 | COMMAND_PREFIXES = set() 35 | 36 | owner = environ.get("OWNER_ID", "") 37 | if len(owner) != 0: 38 | OWNER_ID = {int(user.strip()) for user in owner.split()} 39 | else: 40 | LOGGER(__name__).error("OWNER_ID env variable is missing!") 41 | exit(1) 42 | 43 | users = environ.get("SUDO_USERS", "") 44 | if len(users) != 0: 45 | SUDO_USERS = {int(user.strip()) for user in users.split()} 46 | else: 47 | SUDO_USERS = set() 48 | 49 | UPTOBOX_TOKEN = environ.get("UPTOBOX_TOKEN", "") 50 | if len(UPTOBOX_TOKEN) == 0: 51 | LOGGER(__name__).warning("UPTOBOX_TOKEN not provided!") 52 | UPTOBOX_TOKEN = "" 53 | 54 | BIFM_URL = environ.get("BIFM_URL", "https://bifm.tacohitbox.com/api/bypass?url") 55 | if len(BIFM_URL) == 0: 56 | LOGGER(__name__).warning("BIFM_URL not provided! (Using Default)") 57 | BIFM_URL = "https://bifm.tacohitbox.com/api/bypass?url" 58 | 59 | EMILY_API_URL = environ.get("EMILY_API_URL", "") 60 | if len(EMILY_API_URL) == 0: 61 | LOGGER(__name__).warning("EMILY_API_URL not provided! (Using Default)") 62 | EMILY_API_URL = "https://api.emilyx.in/api https://emilyapi.fly.dev/api https://emily-api.fly.dev/api" 63 | 64 | GDTOT_CRYPT = environ.get("GDTOT_CRYPT", "") 65 | if len(GDTOT_CRYPT) == 0: 66 | LOGGER(__name__).warning("GDTOT_CRYPT not provided!") 67 | GDTOT_CRYPT = "" 68 | 69 | HUBDRIVE_CRYPT = environ.get("HUBDRIVE_CRYPT", "") 70 | if len(HUBDRIVE_CRYPT) == 0: 71 | LOGGER(__name__).warning("HUBDRIVE_CRYPT not provided!") 72 | HUBDRIVE_CRYPT = "" 73 | 74 | KATDRIVE_CRYPT = environ.get("KATDRIVE_CRYPT", "") 75 | if len(KATDRIVE_CRYPT) == 0: 76 | LOGGER(__name__).warning("KATDRIVE_CRYPT not provided!") 77 | KATDRIVE_CRYPT = "" 78 | 79 | KOLOP_CRYPT = environ.get("KOLOP_CRYPT", "") 80 | if len(KOLOP_CRYPT) == 0: 81 | LOGGER(__name__).warning("KOLOP_CRYPT not provided!") 82 | KOLOP_CRYPT = "" 83 | 84 | DRIVEFIRE_CRYPT = environ.get("DRIVEFIRE_CRYPT", "") 85 | if len(DRIVEFIRE_CRYPT) == 0: 86 | LOGGER(__name__).warning("DRIVEFIRE_CRYPT not provided!") 87 | DRIVEFIRE_CRYPT = "" 88 | 89 | DRIVEBUZZ_CRYPT = environ.get("DRIVEBUZZ_CRYPT", "") 90 | if len(UPTOBOX_TOKEN) == 0: 91 | LOGGER(__name__).warning("DRIVEBUZZ_CRYPT not provided!") 92 | DRIVEBUZZ_CRYPT = "" 93 | 94 | DRIVEHUB_CRYPT = environ.get("DRIVEHUB_CRYPT", "") 95 | if len(DRIVEHUB_CRYPT) == 0: 96 | LOGGER(__name__).warning("DRIVEHUB_CRYPT not provided!") 97 | DRIVEHUB_CRYPT = "" 98 | 99 | GADRIVE_CRYPT = environ.get("GADRIVE_CRYPT", "") 100 | if len(GADRIVE_CRYPT) == 0: 101 | LOGGER(__name__).warning("GADRIVE_CRYPT not provided!") 102 | GADRIVE_CRYPT = "" 103 | 104 | JIODRIVE_CRYPT = environ.get("JIODRIVE_CRYPT", "") 105 | if len(JIODRIVE_CRYPT) == 0: 106 | LOGGER(__name__).warning("JIODRIVE_CRYPT not provided!") 107 | JIODRIVE_CRYPT = "" 108 | 109 | Sharerpw_XSRF = environ.get("Sharerpw_XSRF", "") 110 | Sharerpw_laravel = environ.get("Sharerpw_laravel", "") 111 | if len(Sharerpw_XSRF) == 0 or len(Sharerpw_laravel) == 0: 112 | LOGGER(__name__).warning("Sharer Cookies not provided!") 113 | Sharerpw_XSRF = "" 114 | Sharerpw_laravel = "" 115 | 116 | UNIFIED_EMAIL = environ.get("UNIFIED_EMAIL", "") 117 | UNIFIED_PASS = environ.get("UNIFIED_PASS", "") 118 | if len(UNIFIED_EMAIL) == 0 or len(UNIFIED_PASS) == 0: 119 | LOGGER(__name__).warning("Unified Email/Pass not provided!") 120 | UNIFIED_EMAIL = "" 121 | UNIFIED_PASS = "" 122 | 123 | UPSTREAM_REPO = environ.get("UPSTREAM_REPO", "") 124 | if len(UPSTREAM_REPO) == 0: 125 | LOGGER(__name__).warning("UPSTREAM_REPO not provided!") 126 | UPSTREAM_REPO = "" 127 | -------------------------------------------------------------------------------- /bot/helpers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pk3011/scrap/f98015223ada84dbe055aca0a9ea4293afd904b7/bot/helpers/__init__.py -------------------------------------------------------------------------------- /bot/helpers/decorators.py: -------------------------------------------------------------------------------- 1 | """ 2 | About python decorators. 3 | https://www.geeksforgeeks.org/decorators-in-python/ 4 | https://realpython.com/primer-on-python-decorators/ 5 | """ 6 | 7 | from typing import Callable 8 | 9 | from pyrogram import Client 10 | from pyrogram.types import Message 11 | 12 | from bot.config import * 13 | from bot.helpers.functions import isAdmin 14 | 15 | 16 | def user_commands(func: Callable) -> Callable: 17 | """ 18 | Allows all user's' to use publicly available commands 19 | """ 20 | 21 | async def decorator(client: Client, message: Message): 22 | return await func(client, message) 23 | 24 | return decorator 25 | 26 | 27 | def sudo_commands(func: Callable) -> Callable: 28 | """ 29 | Restricts user's from executing certain sudo user's' related commands 30 | """ 31 | 32 | async def decorator(client: Client, message: Message): 33 | uid = message.from_user.id 34 | if uid in SUDO_USERS: 35 | return await func(client, message) 36 | 37 | return decorator 38 | 39 | 40 | def dev_commands(func: Callable) -> Callable: 41 | """ 42 | Restricts user's from executing certain developer's related commands 43 | """ 44 | 45 | async def decorator(client: Client, message: Message): 46 | uid = message.from_user.id 47 | if uid in OWNER_ID: 48 | return await func(client, message) 49 | 50 | return decorator 51 | 52 | 53 | def admin_commands(func: Callable) -> Callable: 54 | """ 55 | Restricts user's from using group admin commands. 56 | """ 57 | 58 | async def decorator(client: Client, message: Message): 59 | if await isAdmin(message): 60 | return await func(client, message) 61 | 62 | return decorator 63 | 64 | 65 | def errors(func: Callable) -> Callable: 66 | """ 67 | Try and catch error of any function. 68 | """ 69 | 70 | async def decorator(client: Client, message: Message): 71 | try: 72 | return await func(client, message) 73 | except Exception as error: 74 | await message.reply(f"{type(error).__name__}: {error}") 75 | 76 | return decorator 77 | -------------------------------------------------------------------------------- /bot/helpers/functions.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | import requests 4 | from pyrogram.enums import ChatMemberStatus, ChatType 5 | from pyrogram.types import Message 6 | 7 | from bot.config import * 8 | from bot.config import EMILY_API_URL 9 | 10 | 11 | async def isAdmin(message: Message) -> bool: 12 | """ 13 | Return True if the message is from owner or admin of the group or sudo of the bot. 14 | """ 15 | 16 | if not message.from_user: 17 | return False 18 | if message.chat.type not in [ChatType.SUPERGROUP, ChatType.CHANNEL]: 19 | return False 20 | 21 | client = message._client 22 | chat_id = message.chat.id 23 | user_id = message.from_user.id 24 | check_status = await client.get_chat_member(chat_id, user_id) 25 | 26 | if user_id in SUDO_USERS: 27 | return True 28 | elif check_status.status in [ 29 | ChatMemberStatus.OWNER, 30 | ChatMemberStatus.ADMINISTRATOR, 31 | ]: 32 | return True 33 | else: 34 | return False 35 | 36 | 37 | def get_readable_time(seconds: int) -> str: 38 | """ 39 | Return a human-readable time format 40 | """ 41 | 42 | result = "" 43 | (days, remainder) = divmod(seconds, 86400) 44 | days = int(days) 45 | 46 | if days != 0: 47 | result += f"{days}d" 48 | (hours, remainder) = divmod(remainder, 3600) 49 | hours = int(hours) 50 | 51 | if hours != 0: 52 | result += f"{hours}h" 53 | (minutes, seconds) = divmod(remainder, 60) 54 | minutes = int(minutes) 55 | 56 | if minutes != 0: 57 | result += f"{minutes}m" 58 | 59 | seconds = int(seconds) 60 | result += f"{seconds}s" 61 | return result 62 | 63 | 64 | def get_readable_bytes(value, digits=2, delim="", postfix=""): 65 | """ 66 | Return a human-readable file size. 67 | """ 68 | 69 | if value is None: 70 | return None 71 | chosen_unit = "B" 72 | for unit in ("KiB", "MiB", "GiB", "TiB"): 73 | if value > 1000: 74 | value /= 1024 75 | chosen_unit = unit 76 | else: 77 | break 78 | return f"{value:.{digits}f}" + delim + chosen_unit + postfix 79 | 80 | 81 | def get_readable_size(size): 82 | if not size: 83 | return "" 84 | power = 2**10 85 | raised_to_pow = 0 86 | dict_power_n = {0: "", 1: "Ki", 2: "Mi", 3: "Gi", 4: "Ti"} 87 | 88 | while size > power: 89 | size /= power 90 | raised_to_pow += 1 91 | return str(round(size, 2)) + " " + dict_power_n[raised_to_pow] + "B" 92 | 93 | 94 | def multi_api(): 95 | EMILY_API_LIST = [] 96 | emilyapi_urls = EMILY_API_URL.split(" ") 97 | for api in emilyapi_urls: 98 | EMILY_API_LIST.append(str(api)) 99 | return random.choice(EMILY_API_LIST) 100 | 101 | 102 | def api_checker(): 103 | api_url = multi_api() 104 | r = requests.head(api_url) 105 | if r.status_code == 200: 106 | LOGGER(__name__).info(f" Using API : {api_url}") 107 | return api_url 108 | else: 109 | api_checker() 110 | -------------------------------------------------------------------------------- /bot/logging.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import os 3 | from logging.handlers import RotatingFileHandler 4 | 5 | try: 6 | os.remove("logs.txt") 7 | except BaseException: 8 | pass 9 | 10 | logging.basicConfig( 11 | level=logging.INFO, 12 | format="[%(asctime)s - %(levelname)s] - %(name)s - %(message)s", 13 | datefmt="%d-%b-%y %H:%M:%S", 14 | handlers=[ 15 | RotatingFileHandler("logs.txt", mode="w+", maxBytes=5000000, backupCount=10), 16 | logging.StreamHandler(), 17 | ], 18 | ) 19 | 20 | # logging.getLogger("pyrogram").setLevel(logging.ERROR) 21 | 22 | 23 | def LOGGER(name: str) -> logging.Logger: 24 | return logging.getLogger(name) 25 | -------------------------------------------------------------------------------- /bot/modules/bypasser.py: -------------------------------------------------------------------------------- 1 | import re 2 | import time 3 | 4 | import cloudscraper 5 | import requests 6 | from bs4 import BeautifulSoup 7 | from PyBypass import bypass as pybyp 8 | from PyBypass.main import BypasserNotFoundError, UnableToBypassError, UrlConnectionError 9 | 10 | from bot.config import * 11 | from bot.helpers.functions import api_checker 12 | 13 | 14 | def adfly(url): 15 | dom = api_checker() 16 | api = f"{dom}/bypass" 17 | resp = requests.get(url) 18 | if resp.status_code == 404: 19 | return "File not found/The link you entered is wrong!" 20 | client = cloudscraper.create_scraper(allow_brotli=False) 21 | try: 22 | resp = client.post(api, json={"type": "adfly", "url": url}) 23 | res = resp.json() 24 | except BaseException: 25 | return "Emily API Unresponsive / Invalid Link!" 26 | if res["success"] is True: 27 | return res["url"] 28 | else: 29 | return res["msg"] 30 | 31 | 32 | def adrinolinks(url): 33 | dom = api_checker() 34 | api = f"{dom}/bypass" 35 | resp = requests.get(url) 36 | if resp.status_code == 404: 37 | return "File not found/The link you entered is wrong!" 38 | client = cloudscraper.create_scraper(allow_brotli=False) 39 | try: 40 | resp = client.post(api, json={"type": "adrinolinks", "url": url}) 41 | res = resp.json() 42 | except BaseException: 43 | return "Emily API Unresponsive / Invalid Link!" 44 | if res["success"] is True: 45 | return res["url"] 46 | else: 47 | return res["msg"] 48 | 49 | 50 | def bifm(url): 51 | client = cloudscraper.create_scraper(allow_brotli=False) 52 | headers = { 53 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36" 54 | } 55 | apix = f"{BIFM_URL}={url}" 56 | time.sleep(2) 57 | response = client.get(apix, headers=headers) 58 | try: 59 | query = response.json() 60 | except BaseException: 61 | return "Invalid Link" 62 | if "destination" in query: 63 | return query["destination"] 64 | else: 65 | return query["error"] 66 | 67 | 68 | def droplink(url): 69 | dom = api_checker() 70 | api = f"{dom}/bypass" 71 | resp = requests.get(url) 72 | if resp.status_code == 404: 73 | return "File not found/The link you entered is wrong!" 74 | client = cloudscraper.create_scraper(allow_brotli=False) 75 | try: 76 | resp = client.post(api, json={"type": "droplink", "url": url}) 77 | res = resp.json() 78 | except BaseException: 79 | return "Emily API Unresponsive / Invalid Link!" 80 | if res["success"] is True: 81 | return res["url"] 82 | else: 83 | return res["msg"] 84 | 85 | 86 | def gplinks(url): 87 | dom = api_checker() 88 | api = f"{dom}/bypass" 89 | resp = requests.get(url) 90 | if resp.status_code == 404: 91 | return "File not found/The link you entered is wrong!" 92 | client = cloudscraper.create_scraper(allow_brotli=False) 93 | try: 94 | resp = client.post(api, json={"type": "gplinks", "url": url}) 95 | res = resp.json() 96 | except BaseException: 97 | return "Emily API Unresponsive / Invalid Link!" 98 | if res["success"] is True: 99 | return res["url"] 100 | else: 101 | return res["msg"] 102 | 103 | 104 | def gtlinks(url): 105 | dom = api_checker() 106 | api = f"{dom}/bypass" 107 | resp = requests.get(url) 108 | if resp.status_code == 404: 109 | return "File not found/The link you entered is wrong!" 110 | client = cloudscraper.create_scraper(allow_brotli=False) 111 | try: 112 | resp = client.post(api, json={"type": "gtlinks", "url": url}) 113 | res = resp.json() 114 | except BaseException: 115 | return "Emily API Unresponsive / Invalid Link!" 116 | if res["success"] is True: 117 | return res["url"] 118 | else: 119 | return res["msg"] 120 | 121 | 122 | def gyanilinks(url): 123 | dom = api_checker() 124 | api = f"{dom}/bypass" 125 | resp = requests.get(url) 126 | if resp.status_code == 404: 127 | return "File not found/The link you entered is wrong!" 128 | client = cloudscraper.create_scraper(allow_brotli=False) 129 | try: 130 | resp = client.post(api, json={"type": "gyanilinks", "url": url}) 131 | res = resp.json() 132 | except BaseException: 133 | return "Emily API Unresponsive / Invalid Link!" 134 | if res["success"] is True: 135 | return res["url"] 136 | else: 137 | return res["msg"] 138 | 139 | 140 | def htpmovies(url): 141 | dom = api_checker() 142 | api = f"{dom}/bypass" 143 | resp = requests.get(url) 144 | if resp.status_code == 404: 145 | return "File not found/The link you entered is wrong!" 146 | client = cloudscraper.create_scraper(allow_brotli=False) 147 | try: 148 | resp = client.post(api, json={"type": "htpmovies", "url": url}) 149 | res = resp.json() 150 | except BaseException: 151 | return "Emily API Unresponsive / Invalid Link!" 152 | if res["success"] is True: 153 | return res["url"] 154 | else: 155 | return res["msg"] 156 | 157 | 158 | def hypershort(url): 159 | dom = api_checker() 160 | api = f"{dom}/bypass" 161 | resp = requests.get(url) 162 | if resp.status_code == 404: 163 | return "File not found/The link you entered is wrong!" 164 | client = cloudscraper.create_scraper(allow_brotli=False) 165 | try: 166 | resp = client.post(api, json={"type": "hypershort", "url": url}) 167 | res = resp.json() 168 | except BaseException: 169 | return "Emily API Unresponsive / Invalid Link!" 170 | if res["success"] is True: 171 | return res["url"] 172 | else: 173 | return res["msg"] 174 | 175 | 176 | def linkvertise(url): 177 | dom = api_checker() 178 | api = f"{dom}/bypass" 179 | resp = requests.get(url) 180 | if resp.status_code == 404: 181 | return "File not found/The link you entered is wrong!" 182 | client = cloudscraper.create_scraper(allow_brotli=False) 183 | try: 184 | resp = client.post(api, json={"type": "linkvertise", "url": url}) 185 | res = resp.json() 186 | except BaseException: 187 | return "Emily API Unresponsive / Invalid Link!" 188 | if res["success"] is True: 189 | return res["url"] 190 | else: 191 | return res["msg"] 192 | 193 | 194 | def multi_aio(url): 195 | dom = api_checker() 196 | f"{dom}/bypass" 197 | resp = requests.get(url) 198 | if resp.status_code == 404: 199 | return "File not found/The link you entered is wrong!" 200 | data = {"url": url} 201 | r = requests.post("https://api.bypass.vip/", data=data) 202 | time.sleep(1) 203 | try: 204 | return r.json()["destination"] 205 | except BaseException: 206 | return r.json()["response"] 207 | 208 | 209 | def multi_pybyp(url): 210 | try: 211 | f_url = pybyp(url) 212 | return f_url 213 | except UrlConnectionError: 214 | return "Not able to establish a successful connection with given URL. It is probably protected by Cloudfare!" 215 | except BypasserNotFoundError: 216 | return "Can not find a bypasser script found for this URL." 217 | except UnableToBypassError: 218 | return "Unable to bypass this link. Possible reason can be cloudfare protection, wrong link, expired link or script is patched!" 219 | 220 | 221 | def ouo(url): 222 | dom = api_checker() 223 | api = f"{dom}/bypass" 224 | resp = requests.get(url) 225 | if resp.status_code == 404: 226 | return "File not found/The link you entered is wrong!" 227 | client = cloudscraper.create_scraper(allow_brotli=False) 228 | try: 229 | resp = client.post(api, json={"type": "ouo", "url": url}) 230 | res = resp.json() 231 | except BaseException: 232 | return "Emily API Unresponsive / Invalid Link!" 233 | if res["success"] is True: 234 | return res["url"] 235 | else: 236 | return res["msg"] 237 | 238 | 239 | def privatemoviez(url): 240 | dom = api_checker() 241 | api = f"{dom}/bypass" 242 | resp = requests.get(url) 243 | if resp.status_code == 404: 244 | return "File not found/The link you entered is wrong!" 245 | client = cloudscraper.create_scraper(allow_brotli=False) 246 | try: 247 | resp = client.post(api, json={"type": "privatemoviez", "url": url}) 248 | res = resp.json() 249 | except BaseException: 250 | return "Emily API Unresponsive / Invalid Link!" 251 | if res["success"] is True: 252 | return res["url"] 253 | else: 254 | return res["msg"] 255 | 256 | 257 | ANCHOR_URL = "https://www.google.com/recaptcha/api2/anchor?ar=1&k=6Lcr1ncUAAAAAH3cghg6cOTPGARa8adOf-y9zv2x&co=aHR0cHM6Ly9vdW8uaW86NDQz&hl=en&v=1B_yv3CBEV10KtI2HJ6eEXhJ&size=invisible&cb=4xnsug1vufyr" 258 | 259 | 260 | def RecaptchaV3(ANCHOR_URL): 261 | url_base = "https://www.google.com/recaptcha/" 262 | post_data = "v={}&reason=q&c={}&k={}&co={}" 263 | client = cloudscraper.create_scraper(allow_brotli=False) 264 | client.headers.update({"content-type": "application/x-www-form-urlencoded"}) 265 | matches = re.findall("([api2|enterprise]+)\/anchor\?(.*)", ANCHOR_URL)[0] 266 | url_base += f"{matches[0]}/" 267 | params = matches[1] 268 | res = client.get(f"{url_base}anchor", params=params) 269 | token = re.findall(r'"recaptcha-token" value="(.*?)"', res.text)[0] 270 | params = dict(pair.split("=") for pair in params.split("&")) 271 | post_data = post_data.format(params["v"], token, params["k"], params["co"]) 272 | res = client.post(f"{url_base}reload", params=f'k={params["k"]}', data=post_data) 273 | return re.findall(r'"rresp","(.*?)"', res.text)[0] 274 | 275 | 276 | def rocklinks(url): 277 | dom = api_checker() 278 | api = f"{dom}/bypass" 279 | resp = requests.get(url) 280 | if resp.status_code == 404: 281 | return "File not found/The link you entered is wrong!" 282 | client = cloudscraper.create_scraper(allow_brotli=False) 283 | try: 284 | resp = client.post(api, json={"type": "rocklinks", "url": url}) 285 | res = resp.json() 286 | except BaseException: 287 | return "Emily API Unresponsive / Invalid Link!" 288 | if res["success"] is True: 289 | return res["url"] 290 | else: 291 | return res["msg"] 292 | 293 | 294 | def script(url): 295 | try: 296 | scriptb(url) 297 | except BaseException: 298 | client = requests.session() 299 | scripta(f"https://{url.split('/')[-2]}/", url, client) 300 | 301 | 302 | def scripta(domain, url, client): 303 | res = client.get(url) 304 | soup = BeautifulSoup(res.text, "html.parser") 305 | soup = soup.find("form").findAll("input") 306 | datalist = [] 307 | for ele in soup: 308 | datalist.append(ele.get("value")) 309 | data = { 310 | "_method": datalist[0], 311 | "_csrfToken": datalist[1], 312 | "ad_form_data": datalist[2], 313 | "_Token[fields]": datalist[3], 314 | "_Token[unlocked]": datalist[4], 315 | } 316 | client.headers = { 317 | "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0", 318 | "Accept": "application/json, text/javascript, */*; q=0.01", 319 | "Accept-Language": "en-US,en;q=0.5", 320 | "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", 321 | "X-Requested-With": "XMLHttpRequest", 322 | "Origin": domain, 323 | "Connection": "keep-alive", 324 | "Referer": url, 325 | "Sec-Fetch-Dest": "empty", 326 | "Sec-Fetch-Mode": "cors", 327 | "Sec-Fetch-Site": "same-origin", 328 | } 329 | time.sleep(10) # important 330 | response = client.post(domain + "/links/go", data=data).json() 331 | furl = response["url"] 332 | return furl 333 | 334 | 335 | def scriptb(url): 336 | client = requests.session() 337 | res = client.get(url) 338 | soup = BeautifulSoup(res.text, "html.parser") 339 | soup = soup.find("form") 340 | action = soup.get("action") 341 | soup = soup.findAll("input") 342 | datalist = [] 343 | for ele in soup: 344 | datalist.append(ele.get("value")) 345 | client.headers = { 346 | "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0", 347 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", 348 | "Accept-Language": "en-US,en;q=0.5", 349 | "Origin": action, 350 | "Connection": "keep-alive", 351 | "Referer": action, 352 | "Upgrade-Insecure-Requests": "1", 353 | "Sec-Fetch-Dest": "document", 354 | "Sec-Fetch-Mode": "navigate", 355 | "Sec-Fetch-Site": "same-origin", 356 | "Sec-Fetch-User": "?1", 357 | } 358 | data = { 359 | "newwpsafelink": datalist[1], 360 | "g-recaptcha-response": RecaptchaV3(ANCHOR_URL), 361 | } 362 | response = client.post(action, data=data) 363 | soup = BeautifulSoup(response.text, "html.parser") 364 | soup = soup.findAll("div", class_="wpsafe-bottom text-center") 365 | for ele in soup: 366 | rurl = ele.find("a").get("onclick")[13:-12] 367 | res = client.get(rurl) 368 | furl = res.url 369 | return scripta(f"https://{furl.split('/')[-2]}/", furl, client) 370 | 371 | 372 | def shareus(url): 373 | dom = api_checker() 374 | api = f"{dom}/bypass" 375 | resp = requests.get(url) 376 | if resp.status_code == 404: 377 | return "File not found/The link you entered is wrong!" 378 | client = cloudscraper.create_scraper(allow_brotli=False) 379 | try: 380 | resp = client.post(api, json={"type": "shareus", "url": url}) 381 | res = resp.json() 382 | except BaseException: 383 | return "Emily API Unresponsive / Invalid Link!" 384 | if res["success"] is True: 385 | return res["url"] 386 | else: 387 | return res["msg"] 388 | 389 | 390 | def shorte(url): 391 | dom = api_checker() 392 | api = f"{dom}/bypass" 393 | resp = requests.get(url) 394 | if resp.status_code == 404: 395 | return "File not found/The link you entered is wrong!" 396 | client = cloudscraper.create_scraper(allow_brotli=False) 397 | try: 398 | resp = client.post(api, json={"type": "shorte", "url": url}) 399 | res = resp.json() 400 | except BaseException: 401 | return "Emily API Unresponsive / Invalid Link!" 402 | if res["success"] is True: 403 | return res["url"] 404 | else: 405 | return res["msg"] 406 | 407 | 408 | def shortingly(url): 409 | dom = api_checker() 410 | api = f"{dom}/bypass" 411 | resp = requests.get(url) 412 | if resp.status_code == 404: 413 | return "File not found/The link you entered is wrong!" 414 | client = cloudscraper.create_scraper(allow_brotli=False) 415 | try: 416 | resp = client.post(api, json={"type": "shortingly", "url": url}) 417 | res = resp.json() 418 | except BaseException: 419 | return "Emily API Unresponsive / Invalid Link!" 420 | if res["success"] is True: 421 | return res["url"] 422 | else: 423 | return res["msg"] 424 | 425 | 426 | def sirigan(url): 427 | dom = api_checker() 428 | api = f"{dom}/bypass" 429 | resp = requests.get(url) 430 | if resp.status_code == 404: 431 | return "File not found/The link you entered is wrong!" 432 | client = cloudscraper.create_scraper(allow_brotli=False) 433 | try: 434 | resp = client.post(api, json={"type": "sirigan", "url": url}) 435 | res = resp.json() 436 | except BaseException: 437 | return "Emily API Unresponsive / Invalid Link!" 438 | if res["success"] is True: 439 | return res["url"] 440 | else: 441 | return res["msg"] 442 | 443 | 444 | def tnlink(url): 445 | dom = api_checker() 446 | api = f"{dom}/bypass" 447 | resp = requests.get(url) 448 | if resp.status_code == 404: 449 | return "File not found/The link you entered is wrong!" 450 | client = cloudscraper.create_scraper(allow_brotli=False) 451 | try: 452 | resp = client.post(api, json={"type": "tnlink", "url": url}) 453 | res = resp.json() 454 | except BaseException: 455 | return "Emily API Unresponsive / Invalid Link!" 456 | if res["success"] is True: 457 | return res["url"] 458 | else: 459 | return res["msg"] 460 | 461 | 462 | def xpshort(url): 463 | dom = api_checker() 464 | api = f"{dom}/bypass" 465 | resp = requests.get(url) 466 | if resp.status_code == 404: 467 | return "File not found/The link you entered is wrong!" 468 | client = cloudscraper.create_scraper(allow_brotli=False) 469 | try: 470 | resp = client.post(api, json={"type": "xpshort", "url": url}) 471 | res = resp.json() 472 | except BaseException: 473 | return "Emily API Unresponsive / Invalid Link!" 474 | if res["success"] is True: 475 | return res["url"] 476 | else: 477 | return res["msg"] 478 | -------------------------------------------------------------------------------- /bot/modules/direct_link.py: -------------------------------------------------------------------------------- 1 | import json 2 | import re 3 | from time import sleep 4 | 5 | import chromedriver_autoinstaller 6 | import cloudscraper 7 | import requests 8 | from bs4 import BeautifulSoup 9 | from lk21 import Bypass 10 | from selenium import webdriver 11 | from selenium.common.exceptions import TimeoutException 12 | from selenium.webdriver.common.by import By 13 | from selenium.webdriver.support import expected_conditions as ec 14 | from selenium.webdriver.support.ui import WebDriverWait 15 | 16 | from bot.config import * 17 | from bot.helpers.functions import api_checker 18 | from bot.modules.regex import is_sendcm_folder_link 19 | 20 | 21 | def androiddatahost(url): 22 | dom = api_checker() 23 | api = f"{dom}/direct" 24 | resp = requests.get(url) 25 | if resp.status_code == 404: 26 | return "File not found/The link you entered is wrong!" 27 | client = cloudscraper.create_scraper(allow_brotli=False) 28 | try: 29 | resp = client.post(api, json={"type": "androiddatahost", "url": url}) 30 | res = resp.json() 31 | except BaseException: 32 | return "Emily API Unresponsive / Invalid Link!" 33 | if res["success"] is True: 34 | return res["url"] 35 | else: 36 | return res["msg"] 37 | 38 | 39 | def anonfiles(url): 40 | try: 41 | return Bypass().bypass_anonfiles(url) 42 | except BaseException: 43 | return "Could not Generate Direct Link for your AnonFiles Link :(" 44 | 45 | 46 | def antfiles(url): 47 | try: 48 | return Bypass().bypass_antfiles(url) 49 | except BaseException: 50 | return "Could not Generate Direct Link for your AntFiles Link :(" 51 | 52 | 53 | def artstation(url): 54 | dom = api_checker() 55 | api = f"{dom}/direct" 56 | resp = requests.get(url) 57 | if resp.status_code == 404: 58 | return "File not found/The link you entered is wrong!" 59 | client = cloudscraper.create_scraper(allow_brotli=False) 60 | try: 61 | resp = client.post(api, json={"type": "artstation", "url": url}) 62 | res = resp.json() 63 | except BaseException: 64 | return "Emily API Unresponsive / Invalid Link!" 65 | if res["success"] is True: 66 | return res["url"] 67 | else: 68 | return res["msg"] 69 | 70 | 71 | def bunkr_cyber(url): 72 | count = 1 73 | dl_msg = "" 74 | resp = requests.get(url) 75 | if resp.status_code == 404: 76 | return "File not found/The link you entered is wrong!" 77 | link_type = "Bunkr" if "bunkr.is" in url else "CyberDrop" 78 | try: 79 | soup = BeautifulSoup(resp.content, "html.parser") 80 | if link_type == "Bunkr": 81 | if "stream.bunkr.is" in url: 82 | return url.replace("stream.bunkr.is/v", "media-files.bunkr.is") 83 | json_data_element = soup.find("script", {"id": "__NEXT_DATA__"}) 84 | json_data = json.loads(json_data_element.string) 85 | files = json_data["props"]["pageProps"]["files"] 86 | for file in files: 87 | item_url = "https://media-files.bunkr.is/" + file["name"] 88 | item_url = item_url.replace(" ", "%20") 89 | dl_msg += f"{count}. {item_url}
" 90 | count += 1 91 | else: 92 | items = soup.find_all("a", {"class": "image"}) 93 | for item in items: 94 | item_url = item["href"] 95 | item_url = item_url.replace(" ", "%20") 96 | dl_msg += f"{count}. {item_url}
" 97 | count += 1 98 | fld_msg = f"Your provided {link_type} link is of Folder and I've Found {count - 1} files in the Folder." 99 | fld_msg += f"I've generated Direct Links for all the files.

" 100 | return fld_msg + dl_msg 101 | except BaseException: 102 | return f"Could not Generate Direct Link for your {link_type} Link :(" 103 | 104 | 105 | def dropbox(url): 106 | return url.replace("dropbox.com", "dl.dropboxusercontent.com") 107 | 108 | 109 | def dropbox2(url): 110 | return url.replace("?dl=0", "?dl=1") 111 | 112 | 113 | def fembed(url): 114 | try: 115 | dl_url = Bypass().bypass_fembed(url) 116 | count = len(dl_url) 117 | lst_link = [dl_url[i] for i in dl_url] 118 | dl_url = lst_link[count - 1] 119 | return dl_url 120 | except BaseException: 121 | return "Could not Generate Direct Link for your FEmbed Link :(" 122 | 123 | 124 | def fichier(url): 125 | regex = r"^([http:\/\/|https:\/\/]+)?.*1fichier\.com\/\?.+" 126 | gan = re.match(regex, url) 127 | if not gan: 128 | return "The link you entered is wrong!" 129 | req = requests.post(url) 130 | if req.status_code == 404: 131 | return "File not found/The link you entered is wrong!" 132 | soup = BeautifulSoup(req.content, "lxml") 133 | if soup.find("a", {"class": "ok btn-general btn-orange"}) is not None: 134 | dl_url = soup.find("a", {"class": "ok btn-general btn-orange"})["href"] 135 | if dl_url is None: 136 | return "Unable to generate Direct Link for 1fichier!" 137 | else: 138 | return dl_url 139 | elif len(soup.find_all("div", {"class": "ct_warn"})) == 3: 140 | str_2 = soup.find_all("div", {"class": "ct_warn"})[-1] 141 | if "you must wait" in str(str_2).lower(): 142 | numbers = [int(word) for word in str(str_2).split() if word.isdigit()] 143 | if not numbers: 144 | return "1fichier is on a limit. Please wait a few minutes/hour." 145 | else: 146 | return f"1fichier is on a limit. Please wait {numbers[0]} minute." 147 | elif "protect access" in str(str_2).lower(): 148 | return f"This link requires a password!\n\nThis link requires a password!" 149 | else: 150 | print(str_2) 151 | return "Error trying to generate Direct Link from 1fichier!" 152 | elif len(soup.find_all("div", {"class": "ct_warn"})) == 4: 153 | str_1 = soup.find_all("div", {"class": "ct_warn"})[-2] 154 | str_3 = soup.find_all("div", {"class": "ct_warn"})[-1] 155 | if "you must wait" in str(str_1).lower(): 156 | numbers = [int(word) for word in str(str_1).split() if word.isdigit()] 157 | if not numbers: 158 | return "1fichier is on a limit. Please wait a few minutes/hour." 159 | else: 160 | return f"1fichier is on a limit. Please wait {numbers[0]} minute." 161 | elif "bad password" in str(str_3).lower(): 162 | return "The password you entered is wrong!" 163 | else: 164 | return "Error trying to generate Direct Link from 1fichier!" 165 | else: 166 | return "Error trying to generate Direct Link from 1fichier!" 167 | 168 | 169 | def filesIm(url): 170 | try: 171 | return Bypass().bypass_filesIm(url) 172 | except BaseException: 173 | return "Could not Generate Direct Link for your FilesIm Link :(" 174 | 175 | 176 | def github(url): 177 | dom = api_checker() 178 | api = f"{dom}/direct" 179 | resp = requests.get(url) 180 | if resp.status_code == 404: 181 | return "File not found/The link you entered is wrong!" 182 | client = cloudscraper.create_scraper(allow_brotli=False) 183 | try: 184 | resp = client.post(api, json={"type": "github", "url": url}) 185 | res = resp.json() 186 | except BaseException: 187 | return "Emily API Unresponsive / Invalid Link!" 188 | if res["success"] is True: 189 | return res["url"] 190 | else: 191 | return res["msg"] 192 | 193 | 194 | def gdbot(url): 195 | dom = api_checker() 196 | api = f"{dom}/direct" 197 | resp = requests.get(url) 198 | if resp.status_code == 404: 199 | return "File not found/The link you entered is wrong!" 200 | client = cloudscraper.create_scraper(allow_brotli=False) 201 | try: 202 | resp = client.post(api, json={"type": "gdbot", "url": url}) 203 | res = resp.json() 204 | except BaseException: 205 | return "Emily API Unresponsive / Invalid Link!" 206 | if res["success"] is True: 207 | return res["url"] 208 | else: 209 | return res["msg"] 210 | 211 | 212 | def gofile(url): 213 | dom = api_checker() 214 | api = f"{dom}/direct" 215 | resp = requests.get(url) 216 | if resp.status_code == 404: 217 | return "File not found/The link you entered is wrong!" 218 | client = cloudscraper.create_scraper(allow_brotli=False) 219 | try: 220 | resp = client.post(api, json={"type": "gofile", "url": url}) 221 | res = resp.json() 222 | except BaseException: 223 | return "Emily API Unresponsive / Invalid Link!" 224 | if res["success"] is True: 225 | return res["url"] 226 | else: 227 | return res["msg"] 228 | 229 | 230 | def hubcloud(url): 231 | chromedriver_autoinstaller.install() 232 | 233 | # Specifying Buttons 234 | btnshow = '//*[@id="btnshow"]/a/h4' 235 | verify_button2 = '//*[@id="verify_button2"]' 236 | verify_button = '//*[@id="verify_button"]' 237 | two_steps_btn = '//a[@class="rdr_btn block"]' 238 | workers = "/html/body/center/div[2]/div[1]/h2/a[1]" 239 | bgsora = '//*[@id="bgsora"]' 240 | 241 | # Selenium Set-Up 242 | chrome_options = webdriver.ChromeOptions() 243 | chrome_options.add_argument("--no-sandbox") 244 | chrome_options.add_argument("--headless") 245 | chrome_options.add_argument("--disable-dev-shm-usage") 246 | 247 | # Scrapping 248 | wd = webdriver.Chrome(options=chrome_options) 249 | wd.get(url) 250 | try: 251 | WebDriverWait(wd, 8).until( 252 | ec.element_to_be_clickable((By.XPATH, bgsora)) 253 | ).click() 254 | except TimeoutException: 255 | sleep(3) 256 | WebDriverWait(wd, 12).until( 257 | ec.element_to_be_clickable((By.XPATH, bgsora)) 258 | ).click() 259 | sleep(8) 260 | flink = wd.current_url 261 | pattern1 = re.compile(r"\bhttps?://.*(hubcloud)\S+", re.IGNORECASE) 262 | pattern2 = re.compile(r"\bhttps?://.*(newsongs)\S+", re.IGNORECASE) 263 | pattern3 = re.compile(r"\bhttps?://.*(hashhackers)\S+", re.IGNORECASE) 264 | if pattern1.match(flink): 265 | sleep(4) 266 | final_msg = wd.find_element(By.XPATH, workers).get_attribute("href") 267 | elif pattern2.match(flink) or pattern3.match(flink): 268 | WebDriverWait(wd, 20).until( 269 | ec.element_to_be_clickable((By.XPATH, btnshow)) 270 | ).click() 271 | WebDriverWait(wd, 20).until( 272 | ec.element_to_be_clickable((By.XPATH, verify_button2)) 273 | ).click() 274 | WebDriverWait(wd, 17).until( 275 | ec.element_to_be_clickable((By.XPATH, verify_button)) 276 | ).click() 277 | sleep(17) 278 | lastbutton = wd.find_element(By.XPATH, two_steps_btn) 279 | wd.execute_script("arguments[0].click();", lastbutton) 280 | sleep(5) 281 | wd.current_window_handle 282 | try: 283 | Itab = wd.window_handles[1] 284 | except IndexError: 285 | IItab = wd.window_handles[0] 286 | try: 287 | wd.switch_to.window(Itab) 288 | except IndexError: 289 | wd.switch_to.window(IItab) 290 | final_msg = wd.find_element(By.XPATH, workers).get_attribute("href") 291 | else: 292 | final_msg = "Could not any matching Links to Bypass from the Link!" 293 | return final_msg 294 | 295 | 296 | def hxfile(url): 297 | try: 298 | return Bypass().bypass_filesIm(url) 299 | except BaseException: 300 | return "Could not Generate Direct Link for your HXFile Link :(" 301 | 302 | 303 | def krakenfiles(url): 304 | dom = api_checker() 305 | api = f"{dom}/direct" 306 | resp = requests.get(url) 307 | if resp.status_code == 404: 308 | return "File not found/The link you entered is wrong!" 309 | client = cloudscraper.create_scraper(allow_brotli=False) 310 | try: 311 | resp = client.post(api, json={"type": "krakenfiles", "url": url}) 312 | res = resp.json() 313 | except BaseException: 314 | return "Emily API Unresponsive / Invalid Link!" 315 | if res["success"] is True: 316 | return res["url"] 317 | else: 318 | return res["msg"] 319 | 320 | 321 | def letsupload(url): 322 | try: 323 | return Bypass().bypass_url(url) 324 | except BaseException: 325 | return "Could not Generate Direct Link for your LetsUpload Link :(" 326 | 327 | 328 | def linkpoi(url): 329 | try: 330 | return Bypass().bypass_linkpoi(url) 331 | except BaseException: 332 | return "Could not Generate Direct Link for your Linkpoi Link :(" 333 | 334 | 335 | def mdisk(url): 336 | dom = api_checker() 337 | api = f"{dom}/direct" 338 | resp = requests.get(url) 339 | if resp.status_code == 404: 340 | return "File not found/The link you entered is wrong!" 341 | client = cloudscraper.create_scraper(allow_brotli=False) 342 | try: 343 | resp = client.post(api, json={"type": "mdisk", "url": url}) 344 | res = resp.json() 345 | except BaseException: 346 | return "Emily API Unresponsive / Invalid Link!" 347 | if res["success"] is True: 348 | return res["url"] 349 | else: 350 | return res["msg"] 351 | 352 | 353 | def mdisk_mpd(url): 354 | dom = api_checker() 355 | api = f"{dom}/direct" 356 | resp = requests.get(url) 357 | if resp.status_code == 404: 358 | return "File not found/The link you entered is wrong!" 359 | client = cloudscraper.create_scraper(allow_brotli=False) 360 | try: 361 | resp = client.post(api, json={"type": "mdisk_mpd", "url": url}) 362 | res = resp.json() 363 | except BaseException: 364 | return "Emily API Unresponsive / Invalid Link!" 365 | if res["success"] is True: 366 | return res["url"] 367 | else: 368 | return res["msg"] 369 | 370 | 371 | def mediafire(url): 372 | dom = api_checker() 373 | api = f"{dom}/direct" 374 | resp = requests.get(url) 375 | if resp.status_code == 404: 376 | return "File not found/The link you entered is wrong!" 377 | client = cloudscraper.create_scraper(allow_brotli=False) 378 | try: 379 | resp = client.post(api, json={"type": "mediafire", "url": url}) 380 | res = resp.json() 381 | except BaseException: 382 | return "Emily API Unresponsive / Invalid Link!" 383 | if res["success"] is True: 384 | return res["url"] 385 | else: 386 | return res["msg"] 387 | 388 | 389 | def megaup(url): 390 | dom = api_checker() 391 | api = f"{dom}/direct" 392 | resp = requests.get(url) 393 | if resp.status_code == 404: 394 | return "File not found/The link you entered is wrong!" 395 | client = cloudscraper.create_scraper(allow_brotli=False) 396 | try: 397 | resp = client.post(api, json={"type": "megaup", "url": url}) 398 | res = resp.json() 399 | except BaseException: 400 | return "Emily API Unresponsive / Invalid Link!" 401 | if res["success"] is True: 402 | return res["url"] 403 | else: 404 | return res["msg"] 405 | 406 | 407 | def mirrored(url): 408 | try: 409 | return Bypass().bypass_mirrored(url) 410 | except BaseException: 411 | return "Could not Generate Direct Link for your Mirrored Link :(" 412 | 413 | 414 | def osdn(url): 415 | dom = api_checker() 416 | api = f"{dom}/direct" 417 | resp = requests.get(url) 418 | if resp.status_code == 404: 419 | return "File not found/The link you entered is wrong!" 420 | client = cloudscraper.create_scraper(allow_brotli=False) 421 | try: 422 | resp = client.post(api, json={"type": "osdn", "url": url}) 423 | res = resp.json() 424 | except BaseException: 425 | return "Emily API Unresponsive / Invalid Link!" 426 | if res["success"] is True: 427 | return res["url"] 428 | else: 429 | return res["msg"] 430 | 431 | 432 | def pandafile(url): 433 | dom = api_checker() 434 | api = f"{dom}/direct" 435 | resp = requests.get(url) 436 | if resp.status_code == 404: 437 | return "File not found/The link you entered is wrong!" 438 | client = cloudscraper.create_scraper(allow_brotli=False) 439 | try: 440 | resp = client.post(api, json={"type": "pandafile", "url": url}) 441 | res = resp.json() 442 | except BaseException: 443 | return "Emily API Unresponsive / Invalid Link!" 444 | if res["success"] is True: 445 | return res["url"] 446 | else: 447 | return res["msg"] 448 | 449 | 450 | def pixeldrain(url): 451 | dom = api_checker() 452 | api = f"{dom}/direct" 453 | resp = requests.get(url) 454 | if resp.status_code == 404: 455 | return "File not found/The link you entered is wrong!" 456 | client = cloudscraper.create_scraper(allow_brotli=False) 457 | try: 458 | resp = client.post(api, json={"type": "pixeldrain", "url": url}) 459 | res = resp.json() 460 | except BaseException: 461 | return "Emily API Unresponsive / Invalid Link!" 462 | if res["success"] is True: 463 | return res["url"] 464 | else: 465 | return res["msg"] 466 | 467 | 468 | def pixl(url): 469 | resp = requests.get(url) 470 | if resp.status_code == 404: 471 | return "File not found/The link you entered is wrong!" 472 | try: 473 | currentpage = 1 474 | settotalimgs = True 475 | totalimages = "" 476 | soup = BeautifulSoup(resp.content, "html.parser") 477 | if "album" in url and settotalimgs: 478 | totalimages = soup.find("span", {"data-text": "image-count"}).text 479 | settotalimgs = False 480 | thmbnailanchors = soup.findAll(attrs={"class": "--media"}) 481 | links = soup.findAll(attrs={"data-pagination": "next"}) 482 | try: 483 | url = links[0].attrs["href"] 484 | except BaseException: 485 | url = None 486 | count = 1 487 | ddl_msg = "" 488 | for ref in thmbnailanchors: 489 | imgdata = requests.get(ref.attrs["href"]) 490 | if not imgdata.status_code == 200: 491 | sleep(3) 492 | continue 493 | imghtml = BeautifulSoup(imgdata.text, "html.parser") 494 | downloadanch = imghtml.find(attrs={"class": "btn-download"}) 495 | currentimg = downloadanch.attrs["href"] 496 | ddl_msg += f"{count}. {currentimg}
" 497 | count += 1 498 | currentpage += 1 499 | fld_msg = f"Your provided Pixl.is link is of Folder and I've Found {count - 1} files in the folder.
" 500 | fld_msg += f"I've generated Direct Links for all the files.

" 501 | return fld_msg + ddl_msg 502 | except BaseException: 503 | return "Could not Generate Direct Link for your Pixl.is Link :(" 504 | 505 | 506 | def reupload(url): 507 | try: 508 | return Bypass().bypass_reupload(url) 509 | except BaseException: 510 | return "Could not Generate Direct Link for your ReUpload Link :(" 511 | 512 | 513 | def sbembed(url): 514 | try: 515 | dl_url = Bypass().bypass_sbembed(url) 516 | count = len(dl_url) 517 | lst_link = [dl_url[i] for i in dl_url] 518 | dl_url = lst_link[count - 1] 519 | return dl_url 520 | except BaseException: 521 | return "Could not Generate Direct Link for your SBEmbed Link :(" 522 | 523 | 524 | def sendcm(url): 525 | res = requests.get(url) 526 | if res.status_code == 404: 527 | return "File not found/The link you entered is wrong!" 528 | base_url = "https://send.cm/" 529 | client = cloudscraper.create_scraper(allow_brotli=False) 530 | hs = { 531 | "Content-Type": "application/x-www-form-urlencoded", 532 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36", 533 | } 534 | is_sendcm_folder = is_sendcm_folder_link(url) 535 | if is_sendcm_folder: 536 | done = False 537 | msg = "" 538 | page_no = 0 539 | while not done: 540 | page_no += 1 541 | resp = client.get(url) 542 | soup = BeautifulSoup(resp.content, "lxml") 543 | table = soup.find("table", id="xfiles") 544 | files = table.find_all("a", class_="tx-dark") 545 | for file in files: 546 | file_url = file["href"] 547 | resp2 = client.get(file_url) 548 | scrape = BeautifulSoup(resp2.text, "html.parser") 549 | inputs = scrape.find_all("input") 550 | file_id = inputs[1]["value"] 551 | file_name = re.findall("URL=(.*?) - ", resp2.text)[0].split("]")[1] 552 | parse = {"op": "download2", "id": file_id, "referer": url} 553 | resp3 = client.post( 554 | base_url, data=parse, headers=hs, allow_redirects=False 555 | ) 556 | dl_url = resp3.headers["Location"] 557 | dl_url = dl_url.replace(" ", "%20") 558 | msg += f"File Name: {file_name}
File Link: {file_url}
Download Link: {dl_url}
" 559 | pages = soup.find("ul", class_="pagination") 560 | if pages is None: 561 | done = True 562 | else: 563 | current_page = pages.find( 564 | "li", "page-item actived", recursive=False 565 | ) 566 | next_page = current_page.next_sibling 567 | if next_page is None: 568 | done = True 569 | else: 570 | url = base_url + next_page["href"] 571 | return msg 572 | else: 573 | resp = client.get(url) 574 | scrape = BeautifulSoup(resp.text, "html.parser") 575 | inputs = scrape.find_all("input") 576 | file_id = inputs[1]["value"] 577 | file_name = re.findall("URL=(.*?) - ", resp.text)[0].split("]")[1] 578 | parse = {"op": "download2", "id": file_id, "referer": url} 579 | resp2 = client.post(base_url, data=parse, headers=hs, allow_redirects=False) 580 | dl_url = resp2.headers["Location"] 581 | dl_url = dl_url.replace(" ", "%20") 582 | return ( 583 | f"File Name: {file_name}\n File Link: {url}\n Download Link: {dl_url}\n\n" 584 | ) 585 | 586 | 587 | def solidfiles(url): 588 | dom = api_checker() 589 | api = f"{dom}/direct" 590 | resp = requests.get(url) 591 | if resp.status_code == 404: 592 | return "File not found/The link you entered is wrong!" 593 | client = cloudscraper.create_scraper(allow_brotli=False) 594 | try: 595 | resp = client.post(api, json={"type": "solidfiles", "url": url}) 596 | res = resp.json() 597 | except BaseException: 598 | return "Emily API Unresponsive / Invalid Link!" 599 | if res["success"] is True: 600 | return res["url"] 601 | else: 602 | return res["msg"] 603 | 604 | 605 | def sfile(url): 606 | dom = api_checker() 607 | api = f"{dom}/direct" 608 | resp = requests.get(url) 609 | if resp.status_code == 404: 610 | return "File not found/The link you entered is wrong!" 611 | client = cloudscraper.create_scraper(allow_brotli=False) 612 | try: 613 | resp = client.post(api, json={"type": "sfile", "url": url}) 614 | res = resp.json() 615 | except BaseException: 616 | return "Emily API Unresponsive / Invalid Link!" 617 | if res["success"] is True: 618 | return res["url"] 619 | else: 620 | return res["msg"] 621 | 622 | 623 | def sourceforge(url): 624 | dom = api_checker() 625 | api = f"{dom}/direct" 626 | resp = requests.get(url) 627 | if resp.status_code == 404: 628 | return "File not found/The link you entered is wrong!" 629 | client = cloudscraper.create_scraper(allow_brotli=False) 630 | try: 631 | resp = client.post(api, json={"type": "sourceforge", "url": url}) 632 | res = resp.json() 633 | except BaseException: 634 | return "Emily API Unresponsive / Invalid Link!" 635 | if res["success"] is True: 636 | return res["url"] 637 | else: 638 | return res["msg"] 639 | 640 | 641 | def sourceforge2(url): 642 | return f"{url}" + "?viasf=1" 643 | 644 | 645 | def streamlare(url): 646 | dom = api_checker() 647 | api = f"{dom}/direct" 648 | resp = requests.get(url) 649 | if resp.status_code == 404: 650 | return "File not found/The link you entered is wrong!" 651 | client = cloudscraper.create_scraper(allow_brotli=False) 652 | try: 653 | resp = client.post(api, json={"type": "streamlare", "url": url}) 654 | res = resp.json() 655 | except BaseException: 656 | return "Emily API Unresponsive / Invalid Link!" 657 | if res["success"] is True: 658 | return res["url"] 659 | else: 660 | return res["msg"] 661 | 662 | 663 | def streamtape(url): 664 | try: 665 | return Bypass().bypass_streamtape(url) 666 | except BaseException: 667 | return "Could not Generate Direct Link for your StreamTape Link :(" 668 | 669 | 670 | def uploadee(url): 671 | dom = api_checker() 672 | api = f"{dom}/direct" 673 | resp = requests.get(url) 674 | if resp.status_code == 404: 675 | return "File not found/The link you entered is wrong!" 676 | client = cloudscraper.create_scraper(allow_brotli=False) 677 | try: 678 | resp = client.post(api, json={"type": "uploadee", "url": url}) 679 | res = resp.json() 680 | except BaseException: 681 | return "Emily API Unresponsive / Invalid Link!" 682 | if res["success"] is True: 683 | return res["url"] 684 | else: 685 | return res["msg"] 686 | 687 | 688 | def uptobox(url): 689 | if UPTOBOX_TOKEN is None: 690 | LOGGER(__name__).info("UPTOBOX Error: Token not Provided!") 691 | return "UptoBox Token not Provided!" 692 | utb_tok = UPTOBOX_TOKEN 693 | try: 694 | link = re.findall(r"\bhttps?://.*uptobox\.com\S+", url)[0] 695 | except IndexError: 696 | return "No Uptobox links found" 697 | if utb_tok is None: 698 | LOGGER(__name__).error("UPTOBOX_TOKEN not provided!") 699 | dl_url = link 700 | else: 701 | try: 702 | link = re.findall(r"\bhttp?://.*uptobox\.com/dl\S+", url)[0] 703 | dl_url = link 704 | except BaseException: 705 | file_id = re.findall(r"\bhttps?://.*uptobox\.com/(\w+)", url)[0] 706 | file_link = ( 707 | f"https://uptobox.com/api/link?token={utb_tok}&file_code={file_id}" 708 | ) 709 | req = requests.get(file_link) 710 | result = req.json() 711 | if result["message"].lower() == "success": 712 | dl_url = result["data"]["dlLink"] 713 | elif result["message"].lower() == "waiting needed": 714 | waiting_time = result["data"]["waiting"] + 1 715 | waiting_token = result["data"]["waitingToken"] 716 | sleep(waiting_time) 717 | req2 = requests.get(f"{file_link}&waitingToken={waiting_token}") 718 | result2 = req2.json() 719 | dl_url = result2["data"]["dlLink"] 720 | elif ( 721 | result["message"].lower() 722 | == "you need to wait before requesting a new download link" 723 | ): 724 | waiting_time = result["data"]["waiting"] 725 | cooldown = divmod(waiting_time, 60) 726 | mins = cooldown[0] 727 | secs = cooldown[1] 728 | return f"Uptobox is being limited. Please wait {mins} min {secs} sec." 729 | else: 730 | err = result["message"] 731 | LOGGER(__name__).info(f"UPTOBOX Error: {err}") 732 | return f"{err}" 733 | return dl_url 734 | 735 | 736 | def uservideo(url): 737 | try: 738 | return Bypass().bypass_uservideo(url) 739 | except BaseException: 740 | return "Could not Generate Direct Link for your UserVideo Link :(" 741 | 742 | 743 | def wetransfer(url): 744 | dom = api_checker() 745 | api = f"{dom}/direct" 746 | resp = requests.get(url) 747 | if resp.status_code == 404: 748 | return "File not found/The link you entered is wrong!" 749 | client = cloudscraper.create_scraper(allow_brotli=False) 750 | try: 751 | resp = client.post(api, json={"type": "wetransfer", "url": url}) 752 | res = resp.json() 753 | except BaseException: 754 | return "Emily API Unresponsive / Invalid Link!" 755 | if res["success"] is True: 756 | return res["url"] 757 | else: 758 | return res["msg"] 759 | 760 | 761 | def yandex_disk(url): 762 | dom = api_checker() 763 | api = f"{dom}/direct" 764 | resp = requests.get(url) 765 | if resp.status_code == 404: 766 | return "File not found/The link you entered is wrong!" 767 | client = cloudscraper.create_scraper(allow_brotli=False) 768 | try: 769 | resp = client.post(api, json={"type": "yandex_disk", "url": url}) 770 | res = resp.json() 771 | except BaseException: 772 | return "Emily API Unresponsive / Invalid Link!" 773 | if res["success"] is True: 774 | return res["url"] 775 | else: 776 | return res["msg"] 777 | 778 | 779 | def zippyshare(url): 780 | try: 781 | return Bypass().bypass_zippyshare(url) 782 | except BaseException: 783 | return "Could not Generate Direct Link for your ZippyShare Link :(" 784 | -------------------------------------------------------------------------------- /bot/modules/gdrive_direct.py: -------------------------------------------------------------------------------- 1 | import base64 2 | import os 3 | import re 4 | from time import sleep 5 | from urllib.parse import parse_qs, urlparse 6 | 7 | import chromedriver_autoinstaller 8 | import requests 9 | from lxml import etree 10 | from selenium import webdriver 11 | from selenium.common.exceptions import TimeoutException 12 | from selenium.webdriver.common.by import By 13 | from selenium.webdriver.support import expected_conditions as ec 14 | from selenium.webdriver.support.ui import WebDriverWait 15 | 16 | from bot.config import * 17 | 18 | 19 | def gdtot(url: str) -> str: 20 | if GDTOT_CRYPT is None: 21 | return "GdTot Crypt not provided!" 22 | crypt = GDTOT_CRYPT 23 | client = requests.Session() 24 | match = re.findall(r"https?://(.+)\.gdtot\.(.+)\/\S+\/\S+", url)[0] 25 | client.cookies.update({"crypt": crypt}) 26 | res = client.get(url) 27 | res = client.get(f"https://{match[0]}.gdtot.{match[1]}/dld?id={url.split('/')[-1]}") 28 | url = re.findall(r'URL=(.*?)"', res.text)[0] 29 | info = {} 30 | info["error"] = False 31 | params = parse_qs(urlparse(url).query) 32 | if "gd" not in params or not params["gd"] or params["gd"][0] == "false": 33 | info["error"] = True 34 | if "msgx" in params: 35 | info["message"] = params["msgx"][0] 36 | else: 37 | info["message"] = "Invalid link" 38 | else: 39 | decoded_id = base64.b64decode(str(params["gd"][0])).decode("utf-8") 40 | drive_link = f"https://drive.google.com/open?id={decoded_id}" 41 | info["gdrive_link"] = drive_link 42 | if not info["error"]: 43 | return info["gdrive_link"] 44 | else: 45 | return f"{info['message']}" 46 | 47 | 48 | def unified(url: str) -> str: 49 | global response 50 | if (UNIFIED_EMAIL or UNIFIED_PASS) is None: 51 | return "AppDrive Look-Alike Credentials not Found!" 52 | try: 53 | account = {"email": UNIFIED_EMAIL, "passwd": UNIFIED_PASS} 54 | client = requests.Session() 55 | client.headers.update( 56 | { 57 | "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36" 58 | } 59 | ) 60 | data = {"email": account["email"], "password": account["passwd"]} 61 | client.post(f"https://{urlparse(url).netloc}/login", data=data) 62 | res = client.get(url) 63 | key = re.findall('"key",\s+"(.*?)"', res.text)[0] 64 | ddl_btn = etree.HTML(res.content).xpath("//button[@id='drc']") 65 | info = re.findall(">(.*?)<\/li>", res.text) 66 | info_parsed = {} 67 | for item in info: 68 | kv = [s.strip() for s in item.split(":", maxsplit=1)] 69 | info_parsed[kv[0].lower()] = kv[1] 70 | info_parsed = info_parsed 71 | info_parsed["error"] = False 72 | info_parsed["link_type"] = "login" 73 | headers = { 74 | "Content-Type": f"multipart/form-data; boundary={'-' * 4}_", 75 | } 76 | data = {"type": 1, "key": key, "action": "original"} 77 | if len(ddl_btn): 78 | info_parsed["link_type"] = "direct" 79 | data["action"] = "direct" 80 | while data["type"] <= 3: 81 | boundary = f'{"-" * 6}_' 82 | data_string = "" 83 | for item in data: 84 | data_string += f"{boundary}\r\n" 85 | data_string += f'Content-Disposition: form-data; name="{item}"\r\n\r\n{data[item]}\r\n' 86 | data_string += f"{boundary}--\r\n" 87 | gen_payload = data_string 88 | try: 89 | response = client.post(url, data=gen_payload, headers=headers).json() 90 | break 91 | except BaseException: 92 | data["type"] += 1 93 | if "url" in response: 94 | info_parsed["gdrive_link"] = response["url"] 95 | elif "error" in response and response["error"]: 96 | info_parsed["error"] = True 97 | info_parsed["error_message"] = response["message"] 98 | else: 99 | info_parsed["error"] = True 100 | info_parsed["error_message"] = "Something went wrong :(" 101 | if info_parsed["error"]: 102 | return f"{info_parsed}" 103 | info_parsed["src_url"] = url 104 | if "appdrive." in urlparse(url).netloc: 105 | flink = info_parsed["gdrive_link"] 106 | return flink 107 | elif urlparse(url).netloc in ( 108 | "driveapp.in", 109 | "drivehub.in", 110 | "gdflix.pro", 111 | "gdflix.top", 112 | "drivesharer.in", 113 | "drivebit.in", 114 | "drivelinks.in", 115 | "driveace.in", 116 | "drivepro.in", 117 | ): 118 | res = client.get(info_parsed["gdrive_link"]) 119 | drive_link = etree.HTML(res.content).xpath( 120 | "//a[contains(@class,'btn')]/@href" 121 | )[0] 122 | flink = drive_link 123 | return flink 124 | else: 125 | res = client.get(info_parsed["gdrive_link"]) 126 | drive_link = etree.HTML(res.content).xpath( 127 | "//a[contains(@class,'btn btn-primary')]/@href" 128 | )[0] 129 | flink = drive_link 130 | return flink 131 | except Exception as err: 132 | return f"Encountered Error while parsing Link : {err}" 133 | 134 | 135 | def udrive(url: str) -> str: 136 | client = requests.Session() 137 | if "hubdrive." in url: 138 | url = url.replace(".me", ".pw") 139 | if HUBDRIVE_CRYPT is None: 140 | return "HubDrive Crypt not provided!" 141 | client.cookies.update({"crypt": HUBDRIVE_CRYPT}) 142 | if "katdrive." in url: 143 | if KATDRIVE_CRYPT is None: 144 | return "KatDrive Crypt not provided!" 145 | client.cookies.update({"crypt": KATDRIVE_CRYPT}) 146 | if "kolop." in url: 147 | if KOLOP_CRYPT is None: 148 | return "Kolop Crypt not provided!" 149 | client.cookies.update({"crypt": KOLOP_CRYPT}) 150 | if "drivefire." in url: 151 | if DRIVEFIRE_CRYPT is None: 152 | return "DriveFire Crypt not provided!" 153 | client.cookies.update({"crypt": DRIVEFIRE_CRYPT}) 154 | if "drivebuzz." in url: 155 | if DRIVEBUZZ_CRYPT is None: 156 | return "DriveBuzz Crypt not provided!" 157 | client.cookies.update({"crypt": DRIVEBUZZ_CRYPT}) 158 | if "drivehub." in url: 159 | if DRIVEHUB_CRYPT is None: 160 | return "DriveHub Crypt not provided!" 161 | client.cookies.update({"crypt": DRIVEHUB_CRYPT}) 162 | if "gadrive." in url: 163 | if GADRIVE_CRYPT is None: 164 | return "GaDrive Crypt not provided!" 165 | client.cookies.update({"crypt": GADRIVE_CRYPT}) 166 | if "jiodrive." in url: 167 | if JIODRIVE_CRYPT is None: 168 | return "JioDrive Crypt not provided!" 169 | client.cookies.update({"crypt": JIODRIVE_CRYPT}) 170 | res = client.get(url) 171 | info_parsed = parse_info(res, url) 172 | info_parsed["error"] = False 173 | up = urlparse(url) 174 | req_url = f"{up.scheme}://{up.netloc}/ajax.php?ajax=download" 175 | file_id = url.split("/")[-1] 176 | data = {"id": file_id} 177 | headers = {"x-requested-with": "XMLHttpRequest"} 178 | try: 179 | res = client.post(req_url, headers=headers, data=data).json()["file"] 180 | except BaseException: 181 | return "File Not Found or User rate exceeded !!" 182 | if "drivefire." in url: 183 | gd_id = res.rsplit("/", 1)[-1] 184 | flink = f"https://drive.google.com/file/d/{gd_id}" 185 | return flink 186 | elif "drivehub." in url: 187 | gd_id = res.rsplit("=", 1)[-1] 188 | flink = f"https://drive.google.com/open?id={gd_id}" 189 | return flink 190 | elif "drivebuzz." in url: 191 | gd_id = res.rsplit("=", 1)[-1] 192 | flink = f"https://drive.google.com/open?id={gd_id}" 193 | return flink 194 | else: 195 | try: 196 | gd_id = re.findall("gd=(.*)", res, re.DOTALL)[0] 197 | except BaseException: 198 | return "Unknown Error Occurred!" 199 | flink = f"https://drive.google.com/open?id={gd_id}" 200 | return flink 201 | 202 | 203 | def parse_info(res, url): 204 | info_parsed = {} 205 | if "drivebuzz." in url: 206 | info_chunks = re.findall('(.*?)<\/td>', res.text) 207 | elif "sharer.pw" in url: 208 | f = re.findall(">(.*?)<\/td>", res.text) 209 | info_parsed = {} 210 | for i in range(0, len(f), 3): 211 | info_parsed[f[i].lower().replace(" ", "_")] = f[i + 2] 212 | return info_parsed 213 | else: 214 | info_chunks = re.findall(">(.*?)<\/td>", res.text) 215 | for i in range(0, len(info_chunks), 2): 216 | info_parsed[info_chunks[i]] = info_chunks[i + 1] 217 | return info_parsed 218 | 219 | 220 | def sharerpw(url: str, forced_login=False) -> str: 221 | if (Sharerpw_XSRF or Sharerpw_laravel) is None: 222 | return "Sharerpw Cookies not Found!" 223 | try: 224 | scraper = requests.Session() 225 | scraper.cookies.update( 226 | { 227 | "XSRF-TOKEN": Sharerpw_XSRF, 228 | "laravel_session": Sharerpw_laravel, 229 | } 230 | ) 231 | res = scraper.get(url) 232 | token = re.findall("_token\s=\s'(.*?)'", res.text, re.DOTALL)[0] 233 | ddl_btn = etree.HTML(res.content).xpath("//button[@id='btndirect']") 234 | info_parsed = parse_info(res, url) 235 | info_parsed["error"] = True 236 | info_parsed["src_url"] = url 237 | info_parsed["link_type"] = "login" 238 | info_parsed["forced_login"] = forced_login 239 | headers = { 240 | "content-type": "application/x-www-form-urlencoded; charset=UTF-8", 241 | "x-requested-with": "XMLHttpRequest", 242 | } 243 | data = {"_token": token} 244 | if len(ddl_btn): 245 | info_parsed["link_type"] = "direct" 246 | if not forced_login: 247 | data["nl"] = 1 248 | try: 249 | res = scraper.post(url + "/dl", headers=headers, data=data).json() 250 | except BaseException: 251 | return f"{info_parsed}" 252 | if "url" in res and res["url"]: 253 | info_parsed["error"] = False 254 | info_parsed["gdrive_link"] = res["url"] 255 | if len(ddl_btn) and not forced_login and "url" not in info_parsed: 256 | return sharerpw(url, forced_login=True) 257 | return info_parsed["gdrive_link"] 258 | except Exception as err: 259 | return f"Encountered Error while parsing Link : {err}" 260 | 261 | 262 | def drivehubs(url: str) -> str: 263 | chromedriver_autoinstaller.install() 264 | 265 | os.chmod("/usr/src/app/chromedriver", 755) 266 | chrome_options = webdriver.ChromeOptions() 267 | chrome_options.add_argument("--headless") 268 | chrome_options.add_argument("--no-sandbox") 269 | chrome_options.add_argument("--disable-dev-shm-usage") 270 | wd = webdriver.Chrome("/usr/src/app/chromedriver", chrome_options=chrome_options) 271 | wd.get(url) 272 | wd.find_element(By.XPATH, '//button[@id="fast"]').click() 273 | sleep(10) 274 | wd.switch_to.window(wd.window_handles[-1]) 275 | flink = wd.current_url 276 | wd.close() 277 | if "drive.google.com" in flink: 278 | return flink 279 | else: 280 | return f"ERROR! Maybe Direct Download is not working for this file !\n Retrived URL : {flink}" 281 | 282 | 283 | def pahe(url: str) -> str: 284 | chromedriver_autoinstaller.install() 285 | 286 | AGREE_BUTTON = "//*[contains(text(), 'AGREE')]" 287 | LINK_TYPE = ["//*[contains(text(), 'GD')]"] 288 | GENERATE = "#generater > img" 289 | SHOW_LINK = "showlink" 290 | CONTINUE = "Continue" 291 | 292 | os.chmod("/usr/src/app/chromedriver", 755) 293 | chrome_options = webdriver.ChromeOptions() 294 | chrome_options.binary_location = "/usr/bin/google-chrome" 295 | chrome_options.add_argument("--start-maximized") 296 | chrome_options.add_argument("--disable-dev-shm-usage") 297 | chrome_options.add_argument("--no-sandbox") 298 | chrome_options.add_argument("--headless") 299 | wd = webdriver.Chrome("/usr/src/app/chromedriver", chrome_options=chrome_options) 300 | wd.get(url) 301 | texts = [ 302 | y for x in [wd.find_elements("xpath", type) for type in LINK_TYPE] for y in x 303 | ] 304 | texts[1].click() 305 | if "intercelestial." not in wd.current_url: 306 | wd.close() 307 | wd.switch_to(wd.find_all(wd.switch_to.Window())[0]) 308 | LOGGER(__name__).info("Chrome Pahe: Website Switched!") 309 | try: 310 | WebDriverWait(wd, 10).until( 311 | ec.element_to_be_clickable((By.XPATH, AGREE_BUTTON)) 312 | ).click() 313 | except TimeoutException: 314 | LOGGER(__name__).info("Chrome Pahe: Browser Verification Error!") 315 | return "Chrome Pahe: Browser Verification Error!" 316 | wd.execute_script("document.getElementById('landing').submit();") 317 | WebDriverWait(wd, 30).until( 318 | ec.element_to_be_clickable((By.CSS_SELECTOR, GENERATE)) 319 | ).click() 320 | WebDriverWait(wd, 45).until(ec.element_to_be_clickable((By.ID, SHOW_LINK))).click() 321 | window_after = wd.window_handles[1] 322 | wd.switch_to.window(window_after) 323 | wd.execute_script("window.scrollTo(0,535.3499755859375)") 324 | WebDriverWait(wd, 30).until(ec.element_to_be_clickable((By.LINK_TEXT, CONTINUE))) 325 | last = wd.find_element("link text", CONTINUE) 326 | sleep(5) 327 | wd.execute_script("arguments[0].click();", last) 328 | flink = wd.current_url 329 | wd.close() 330 | gd_url = gdtot(flink) 331 | return gd_url 332 | -------------------------------------------------------------------------------- /bot/modules/lists.py: -------------------------------------------------------------------------------- 1 | yandisk_list = [ 2 | "yadi.sk", 3 | "disk.yandex.com", 4 | "disk.yandex.com.tr", 5 | "disk.yandex.ru", 6 | "disk.yandex.com.ru", 7 | ] 8 | fmed_list = [ 9 | "fembed.net", 10 | "fembed.com", 11 | "femax20.com", 12 | "fcdn.stream", 13 | "feurl.com", 14 | "layarkacaxxi.icu", 15 | "naniplay.nanime.in", 16 | "naniplay.nanime.biz", 17 | "naniplay.com", 18 | "mm9842.com", 19 | ] 20 | sbembed_list = ["sbembed.com", "watchsb.com", "streamsb.net", "sbplay.org"] 21 | linkvertise_list = [ 22 | "linkvertise.", 23 | "link-to.net", 24 | "direct-link.net", 25 | "up-to-down.net", 26 | "filemedia.net", 27 | "file-link.net", 28 | "link-hub.net", 29 | "link-center.net", 30 | "link-target.net", 31 | ] 32 | directdl_list = [ 33 | "artstation.", 34 | "mdisk.", 35 | "wetransfer.", 36 | "we.tl", 37 | "gdbot.", 38 | "gofile.io", 39 | "megaup.", 40 | "sfile.mobi", 41 | "osdn.", 42 | "github.com", 43 | "mediafire.", 44 | "zippyshare.", 45 | "files.im", 46 | "hxfile.", 47 | "anonfiles.", 48 | "letsupload.", 49 | "linkpoi.", 50 | "mirrored.", 51 | "reupload.", 52 | "uservideo.", 53 | "antfiles.", 54 | "streamtape.", 55 | "sourceforge.", 56 | "androidatahost.", 57 | "krakenfiles.", 58 | "dropbox.", 59 | "pixeldrain.", 60 | "streamlare.", 61 | "pandafiles.", 62 | "pjointe.", 63 | "dl4free.", 64 | "tenvoi.", 65 | "piecejointe.", 66 | "mesfichiers.", 67 | "desfichiers.", 68 | "megadl.", 69 | "dfichiers.", 70 | "alterupload.", 71 | "cjoint.", 72 | "1fichier.", 73 | "upload.ee", 74 | "uptobox.", 75 | "solidfiles.", 76 | "hubcloud.", 77 | "bunkr.is", 78 | "cyberdrop.", 79 | "pixl.is", 80 | "send.cm", 81 | ] 82 | bypass_list = [ 83 | "droplink.", 84 | "droplinks.", 85 | "gplink.", 86 | "gplinks.", 87 | "gp.link", 88 | "adfly.", 89 | "adf.ly", 90 | "gyanilinks.", 91 | "gtlinks.", 92 | "hypershort.", 93 | "sirigan.my.id", 94 | "ouo.io", 95 | "ouo.press", 96 | "shorte.st", 97 | "sh.st", 98 | "clkmein.com", 99 | "corneey.com", 100 | "gestyy.com", 101 | "viid.me", 102 | "xiw34.com", 103 | "cllkme.com", 104 | "festyy.com", 105 | "destyy.com", 106 | "cestyy.com", 107 | "rocklinks.", 108 | "gtlinks.", 109 | "shareus.", 110 | "shortingly.", 111 | "tnlink.", 112 | "xpshort.", 113 | "adrinolinks.", 114 | ] 115 | scrape_list = [ 116 | "atishmkv.", 117 | "cinevez.", 118 | "cinevood.", 119 | "filecrypt.", 120 | "htpmovies.", 121 | "igg-games.", 122 | "moviesdrama.", 123 | "privatemoviez.", 124 | "sharespark.", 125 | "olamovies.", 126 | "psa.", 127 | "toonworld4all.", 128 | ] 129 | shst_list = [ 130 | "shorte.st", 131 | "sh.st", 132 | "clkmein.com", 133 | "corneey.com", 134 | "gestyy.com", 135 | "viid.me", 136 | "xiw34.com", 137 | "cllkme.com", 138 | "festyy.com", 139 | "destyy.com", 140 | "cestyy.com", 141 | ] 142 | adfly_list = [ 143 | "adf.ly", 144 | "j.gs", 145 | "q.gs", 146 | "ay.gy", 147 | "zo.ee", 148 | "babblecase.com", 149 | "riffhold.com", 150 | "microify.com", 151 | "pintient.com", 152 | "tinyium.com", 153 | "atominik.com", 154 | "bluenik.com", 155 | "bitigee.com", 156 | "atomcurve.com", 157 | "picocurl.com", 158 | "tinyical.com", 159 | "casualient.com", 160 | "battleate.com", 161 | "mmoity.com", 162 | "simizer.com", 163 | "dataurbia.com", 164 | "viahold.com", 165 | "coginator.com", 166 | "cogismith.com", 167 | "kaitect.com", 168 | "yoalizer.com", 169 | "kibuilder.com", 170 | "kimechanic.com", 171 | "quainator.com", 172 | "tinyium.com", 173 | "pintient.com", 174 | "quamiller.com", 175 | "yobuilder.com", 176 | "skamason.com", 177 | "twineer.com", 178 | "vializer.com", 179 | "viwright.com", 180 | "yabuilder.com", 181 | "yamechanic.com", 182 | "kializer.com", 183 | "yoineer.com", 184 | "skamaker.com", 185 | "yoitect.com", 186 | "activeation.com", 187 | "brisktopia.com", 188 | "queuecosm.bid", 189 | "nimbleinity.com", 190 | "rapidtory.com", 191 | "swiftation.com", 192 | "velocicosm.com", 193 | "zipteria.com", 194 | "zipvale.com", 195 | "agileurbia.com", 196 | "briskrange.com", 197 | "threadsphere.bid", 198 | "dashsphere.com", 199 | "fasttory.com", 200 | "rapidteria.com", 201 | "sprysphere.com", 202 | "swifttopia.com", 203 | "restorecosm.bid", 204 | "bullads.net", 205 | "velociterium.com", 206 | "zipansion.com", 207 | "activeterium.com", 208 | "clearload.bid", 209 | "brightvar.bid", 210 | "activetect.net", 211 | "swiftviz.net", 212 | "kudoflow.com", 213 | "infopade.com", 214 | "linkjaunt.com", 215 | "combostruct.com", 216 | "turboagram.com", 217 | "wirecellar.com", 218 | "streamvoyage.com", 219 | "metastead.com", 220 | "briskgram.net", 221 | "swarife.com", 222 | "baymaleti.net", 223 | "dapalan.com", 224 | "cinebo.net", 225 | "stratoplot.com", 226 | "thouth.net", 227 | "atabencot.net", 228 | "ecleneue.com", 229 | "twiriock.com", 230 | "uclaut.net", 231 | "linkup.pro", 232 | "lopoteam.com", 233 | "keistaru.com", 234 | "gloyah.net", 235 | "cesinthi.com", 236 | "sluppend.com", 237 | "fainbory.com", 238 | "infopade.com", 239 | "onisedeo.com", 240 | "ethobleo.com", 241 | "evassmat.com", 242 | "aclabink.com", 243 | "optitopt.com", 244 | "tonancos.com", 245 | "clesolea.com", 246 | "thacorag.com", 247 | "xterca.net", 248 | "larati.net", 249 | "cowner.net", 250 | "scuseami.net", 251 | "gatustox.net", 252 | "hinafinea.com", 253 | "fiaharam.net", 254 | "libittarc.com", 255 | "raboninco.com", 256 | "gdanstum.net", 257 | "aporasal.net", 258 | "motriael.com", 259 | "smeartha.com", 260 | "apticirl.com", 261 | "onizatop.net", 262 | "anthargo.com", 263 | "fumacrom.com", 264 | "regecish.net", 265 | "hurirk.net", 266 | "usfinf.net", 267 | "fumacrom.com", 268 | "xervoo.net", 269 | "usheethe.com", 270 | "eloism.net", 271 | "magybu.net", 272 | "uhishado.com", 273 | "hadsucma.com", 274 | "lyksoomu.com", 275 | "neexulro.net", 276 | "shycmedi.com", 277 | "chathu.apkmania.co", 278 | "alien.apkmania.co", 279 | "adf.acb.im", 280 | "packs.redmusic.pl", 281 | "packs2.redmusic.pl", 282 | "dl.android-zone.org", 283 | "out.unionfansub.com", 284 | "sostieni.ilwebmaster21.com", 285 | "fuyukai-desu.garuda-raws.net", 286 | "st.uploadit.host", 287 | "vonasort.com", 288 | "atharori.net", 289 | "hideadew.com", 290 | "favoacew.com", 291 | "barsoocm.com", 292 | "chuxoast.com", 293 | ] 294 | -------------------------------------------------------------------------------- /bot/modules/pasting.py: -------------------------------------------------------------------------------- 1 | import cloudscraper 2 | 3 | from bot.helpers.functions import api_checker 4 | 5 | 6 | def telegraph_paste(res): 7 | dom = api_checker() 8 | api = f"{dom}/paste" 9 | client = cloudscraper.create_scraper(allow_brotli=False) 10 | try: 11 | resp = client.post(api, json={"type": "telegraph_paste", "text": res}) 12 | res = resp.json() 13 | except BaseException: 14 | return "API UnResponsive / Invalid Link!" 15 | if res["success"] is True: 16 | return res["url"] 17 | else: 18 | return res["msg"] 19 | -------------------------------------------------------------------------------- /bot/modules/regex.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | URL_REGEX = r"(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+" 4 | 5 | 6 | def is_a_url(url: str): 7 | url = re.match( 8 | r"((http|https)\:\/\/)?[a-zA-Z0-9\.\/\?\:@\-_=#]+\.([a-zA-Z]){2,6}([a-zA-Z0-9\.\&\/\?\:@\-_=#])*", 9 | url, 10 | ) 11 | return bool(url) 12 | 13 | 14 | def is_gdtot_link(url: str): 15 | url = re.match(r"https?://.+\.gdtot\.\S+", url) 16 | return bool(url) 17 | 18 | 19 | def is_unified_link(url: str): 20 | url = re.match( 21 | r"https?://(anidrive|driveroot|driveflix|indidrive|drivehub|appdrive|driveapp|driveace|gdflix|drivelinks|drivebit|drivesharer|drivepro)\.\S+", 22 | url, 23 | ) 24 | return bool(url) 25 | 26 | 27 | def is_udrive_link(url: str): 28 | url = re.match( 29 | r"https?://(hubdrive|katdrive|kolop|drivefire|drivebuzz|gadrive|jiodrive)\.\S+", 30 | url, 31 | ) 32 | return bool(url) 33 | 34 | 35 | def is_sharer_link(url: str): 36 | url = re.match(r"https?://(sharer)\.pw/\S+", url) 37 | return bool(url) 38 | 39 | 40 | def is_drivehubs_link(url: str): 41 | return "drivehubs." in url 42 | 43 | 44 | def is_artstation_link(url: str): 45 | url = re.match(r"artstation\.com/(?:artwork|projects)/([0-9a-zA-Z]+)", url) 46 | return bool(url) 47 | 48 | 49 | def is_fichier_link(url: str): 50 | url = re.match( 51 | r"https?://(pjointe|dl4free|tenvoi|piecejointe|mesfichiers|desfichiers|megadl|dfichiers|alterupload|cjoint|1fichier|\.com/\?)\S+", 52 | url, 53 | ) 54 | return bool(url) 55 | 56 | 57 | def is_sendcm_folder_link(url: str): 58 | return ( 59 | "https://send.cm/s/" in url 60 | or "https://send.cm/?sort" in url 61 | or "https://send.cm/?sort_field" in url 62 | or "https://send.cm/?sort_order" in url 63 | ) 64 | -------------------------------------------------------------------------------- /bot/modules/scraper.py: -------------------------------------------------------------------------------- 1 | import json 2 | import time 3 | import urllib.parse 4 | from base64 import b64decode 5 | 6 | import cloudscraper 7 | 8 | from bot.helpers.functions import api_checker 9 | 10 | next_page = False 11 | next_page_token = "" 12 | 13 | 14 | def index_scraper(payload, url): 15 | global next_page 16 | global next_page_token 17 | url = url + "/" if url[-1] != "/" else url 18 | client = cloudscraper.create_scraper(allow_brotli=False) 19 | resp = client.post(url, data=payload) 20 | time.sleep(1) 21 | if resp.status_code == 401: 22 | return "Could not Access your Entered URL!" 23 | try: 24 | resp2 = json.loads(b64decode(resp.text[::-1][24:-20]).decode("utf-8")) 25 | except BaseException: 26 | return "Something Went Wrong!" 27 | page_token = resp2["nextPageToken"] 28 | if page_token is None: 29 | next_page = False 30 | else: 31 | next_page = True 32 | next_page_token = page_token 33 | res = "" 34 | if list(resp2.get("data").keys())[0] == "error": 35 | pass 36 | else: 37 | file_len = len(resp2["data"]["files"]) 38 | time.sleep(1) 39 | for i, _ in enumerate(range(file_len)): 40 | file_type = resp2["data"]["files"][i]["mimeType"] 41 | file_name = resp2["data"]["files"][i]["name"] 42 | if file_type == "application/vnd.google-apps.folder": 43 | pass 44 | else: 45 | ddl = url + urllib.parse.quote(file_name) 46 | res += f"• {file_name}:-
{ddl}

" 47 | return res 48 | 49 | 50 | def index_scrap(url): 51 | x = 0 52 | payload = {"page_token": next_page_token, "page_index": x} 53 | msg = f"Index Link: {url}\n\n" 54 | msg += index_scraper(payload, url) 55 | while next_page: 56 | payload = {"page_token": next_page_token, "page_index": x} 57 | time.sleep(2) 58 | msg += index_scraper(payload, url) 59 | x += 1 60 | return msg 61 | 62 | 63 | def atishmkv_scrap(url): 64 | dom = api_checker() 65 | api = f"{dom}/scraper" 66 | client = cloudscraper.create_scraper(allow_brotli=False) 67 | try: 68 | resp = client.post(api, json={"type": "atishmkv_scrap", "url": url}) 69 | res = resp.json() 70 | except BaseException: 71 | return "API UnResponsive / Invalid Link!" 72 | if res["success"] is True: 73 | return res["url"] 74 | else: 75 | return res["msg"] 76 | 77 | 78 | def cinevez_scrap(url): 79 | dom = api_checker() 80 | api = f"{dom}/scraper" 81 | client = cloudscraper.create_scraper(allow_brotli=False) 82 | try: 83 | resp = client.post(api, json={"type": "cinevez_scrap", "url": url}) 84 | res = resp.json() 85 | except BaseException: 86 | return "API UnResponsive / Invalid Link!" 87 | if res["success"] is True: 88 | return res["url"] 89 | else: 90 | return res["msg"] 91 | 92 | 93 | def cinevood_scrap(url): 94 | dom = api_checker() 95 | api = f"{dom}/scraper" 96 | client = cloudscraper.create_scraper(allow_brotli=False) 97 | try: 98 | resp = client.post(api, json={"type": "cinevood_scrap", "url": url}) 99 | res = resp.json() 100 | except BaseException: 101 | return "API UnResponsive / Invalid Link!" 102 | if res["success"] is True: 103 | return res["url"] 104 | else: 105 | return res["msg"] 106 | 107 | 108 | def filecrypt_scrap(url): 109 | dom = api_checker() 110 | api = f"{dom}/scraper" 111 | client = cloudscraper.create_scraper(allow_brotli=False) 112 | try: 113 | resp = client.post(api, json={"type": "filecrypt_scrap", "url": url}) 114 | res = resp.json() 115 | except BaseException: 116 | return "API UnResponsive / Invalid Link!" 117 | if res["success"] is True: 118 | return res["url"] 119 | else: 120 | return res["msg"] 121 | 122 | 123 | def htpmovies_scrap(url): 124 | dom = api_checker() 125 | api = f"{dom}/scraper" 126 | client = cloudscraper.create_scraper(allow_brotli=False) 127 | try: 128 | resp = client.post(api, json={"type": "htpmovies_scrap", "url": url}) 129 | res = resp.json() 130 | except BaseException: 131 | return "API UnResponsive / Invalid Link!" 132 | if res["success"] is True: 133 | return res["url"] 134 | else: 135 | return res["msg"] 136 | 137 | 138 | def igggames_scrape(url): 139 | dom = api_checker() 140 | api = f"{dom}/scraper" 141 | client = cloudscraper.create_scraper(allow_brotli=False) 142 | try: 143 | resp = client.post(api, json={"type": "igggames_scrape", "url": url}) 144 | res = resp.json() 145 | except BaseException: 146 | return "API UnResponsive / Invalid Link!" 147 | if res["success"] is True: 148 | return res["url"] 149 | else: 150 | return res["msg"] 151 | 152 | 153 | def moviesdrama_scrap(url): 154 | dom = api_checker() 155 | api = f"{dom}/scraper" 156 | client = cloudscraper.create_scraper(allow_brotli=False) 157 | try: 158 | resp = client.post(api, json={"type": "moviesdrama_scrap", "url": url}) 159 | res = resp.json() 160 | except BaseException: 161 | return "API UnResponsive / Invalid Link!" 162 | if res["success"] is True: 163 | return res["url"] 164 | else: 165 | return res["msg"] 166 | 167 | 168 | def privatemoviez_scrape(url): 169 | dom = api_checker() 170 | api = f"{dom}/scraper" 171 | client = cloudscraper.create_scraper(allow_brotli=False) 172 | try: 173 | resp = client.post(api, json={"type": "privatemoviez_scrape", "url": url}) 174 | res = resp.json() 175 | except BaseException: 176 | return "API UnResponsive / Invalid Link!" 177 | if res["success"] is True: 178 | return res["url"] 179 | else: 180 | return res["msg"] 181 | 182 | 183 | def magnet_scrap(url): 184 | dom = api_checker() 185 | api = f"{dom}/scraper" 186 | client = cloudscraper.create_scraper(allow_brotli=False) 187 | try: 188 | resp = client.post(api, json={"type": "magnet_scrap", "url": url}) 189 | res = resp.json() 190 | except BaseException: 191 | return "API UnResponsive / Invalid Link!" 192 | if res["success"] is True: 193 | return res["url"] 194 | else: 195 | return res["msg"] 196 | 197 | 198 | def sharespark_scrap(url): 199 | dom = api_checker() 200 | api = f"{dom}/scraper" 201 | client = cloudscraper.create_scraper(allow_brotli=False) 202 | try: 203 | resp = client.post(api, json={"type": "sharespark_scrap", "url": url}) 204 | res = resp.json() 205 | except BaseException: 206 | return "API UnResponsive / Invalid Link!" 207 | if res["success"] is True: 208 | return res["url"] 209 | else: 210 | return res["msg"] 211 | 212 | 213 | def olamovies_scrap(url): 214 | dom = api_checker() 215 | api = f"{dom}/scraper" 216 | client = cloudscraper.create_scraper(allow_brotli=False) 217 | try: 218 | resp = client.post(api, json={"type": "olamovies_scrap", "url": url}) 219 | res = resp.json() 220 | except BaseException: 221 | return "API UnResponsive / Invalid Link!" 222 | if res["success"] is True: 223 | return res["url"] 224 | else: 225 | return res["msg"] 226 | 227 | 228 | def psa_scrap(url): 229 | dom = api_checker() 230 | api = f"{dom}/scraper" 231 | client = cloudscraper.create_scraper(allow_brotli=False) 232 | try: 233 | resp = client.get(api, json={"type": "psa_scrap", "url": url}) 234 | res = resp.json() 235 | except BaseException: 236 | return "API UnResponsive / Invalid Link!" 237 | if res["success"] is True: 238 | return res["url"] 239 | else: 240 | return res["msg"] 241 | 242 | 243 | def toonworld4all_scrap(url): 244 | dom = api_checker() 245 | api = f"{dom}/scraper" 246 | client = cloudscraper.create_scraper(allow_brotli=False) 247 | try: 248 | resp = client.post(api, json={"type": "toonworld4all_scrap", "url": url}) 249 | res = resp.json() 250 | except BaseException: 251 | return "API UnResponsive / Invalid Link!" 252 | if res["success"] is True: 253 | return res["url"] 254 | else: 255 | return res["msg"] 256 | -------------------------------------------------------------------------------- /bot/modules/shortener.py: -------------------------------------------------------------------------------- 1 | import cloudscraper 2 | import requests 3 | 4 | from bot.helpers.functions import api_checker 5 | 6 | 7 | def bitly(url): 8 | dom = api_checker() 9 | api = f"{dom}/shorten" 10 | resp = requests.get(url) 11 | if resp.status_code == 404: 12 | return "File not found/The link you entered is wrong!" 13 | client = cloudscraper.create_scraper(allow_brotli=False) 14 | try: 15 | resp = client.post(api, json={"type": "bitly_shorten", "url": url}) 16 | res = resp.json() 17 | except BaseException: 18 | return "Emily API Unresponsive / Invalid Link!" 19 | if res["success"] is True: 20 | return res["url"] 21 | else: 22 | return res["msg"] 23 | 24 | 25 | def dagd(url): 26 | dom = api_checker() 27 | api = f"{dom}/shorten" 28 | resp = requests.get(url) 29 | if resp.status_code == 404: 30 | return "File not found/The link you entered is wrong!" 31 | client = cloudscraper.create_scraper(allow_brotli=False) 32 | try: 33 | resp = client.post(api, json={"type": "dagd_shorten", "url": url}) 34 | res = resp.json() 35 | except BaseException: 36 | return "Emily API Unresponsive / Invalid Link!" 37 | if res["success"] is True: 38 | return res["url"] 39 | else: 40 | return res["msg"] 41 | 42 | 43 | def tinyurl(url): 44 | dom = api_checker() 45 | api = f"{dom}/shorten" 46 | resp = requests.get(url) 47 | if resp.status_code == 404: 48 | return "File not found/The link you entered is wrong!" 49 | client = cloudscraper.create_scraper(allow_brotli=False) 50 | try: 51 | resp = client.post(api, json={"type": "tinyurl_shorten", "url": url}) 52 | res = resp.json() 53 | except BaseException: 54 | return "Emily API Unresponsive / Invalid Link!" 55 | if res["success"] is True: 56 | return res["url"] 57 | else: 58 | return res["msg"] 59 | 60 | 61 | def osdb(url): 62 | dom = api_checker() 63 | api = f"{dom}/shorten" 64 | resp = requests.get(url) 65 | if resp.status_code == 404: 66 | return "File not found/The link you entered is wrong!" 67 | client = cloudscraper.create_scraper(allow_brotli=False) 68 | try: 69 | resp = client.post(api, json={"type": "osdb_shorten", "url": url}) 70 | res = resp.json() 71 | except BaseException: 72 | return "Emily API Unresponsive / Invalid Link!" 73 | if res["success"] is True: 74 | return res["url"] 75 | else: 76 | return res["msg"] 77 | 78 | 79 | def ttm(url): 80 | dom = api_checker() 81 | api = f"{dom}/shorten" 82 | resp = requests.get(url) 83 | if resp.status_code == 404: 84 | return "File not found/The link you entered is wrong!" 85 | client = cloudscraper.create_scraper(allow_brotli=False) 86 | try: 87 | resp = client.post(api, json={"type": "ttm_shorten", "url": url}) 88 | res = resp.json() 89 | except BaseException: 90 | return "Emily API Unresponsive / Invalid Link!" 91 | if res["success"] is True: 92 | return res["url"] 93 | else: 94 | return res["msg"] 95 | 96 | 97 | def isgd(url): 98 | dom = api_checker() 99 | api = f"{dom}/shorten" 100 | resp = requests.get(url) 101 | if resp.status_code == 404: 102 | return "File not found/The link you entered is wrong!" 103 | client = cloudscraper.create_scraper(allow_brotli=False) 104 | try: 105 | resp = client.post(api, json={"type": "isgd_shorten", "url": url}) 106 | res = resp.json() 107 | except BaseException: 108 | return "Emily API Unresponsive / Invalid Link!" 109 | if res["success"] is True: 110 | return res["url"] 111 | else: 112 | return res["msg"] 113 | 114 | 115 | def vgd(url): 116 | dom = api_checker() 117 | api = f"{dom}/shorten" 118 | resp = requests.get(url) 119 | if resp.status_code == 404: 120 | return "File not found/The link you entered is wrong!" 121 | client = cloudscraper.create_scraper(allow_brotli=False) 122 | try: 123 | resp = client.post(api, json={"type": "vgd_shorten", "url": url}) 124 | res = resp.json() 125 | except BaseException: 126 | return "Emily API Unresponsive / Invalid Link!" 127 | if res["success"] is True: 128 | return res["url"] 129 | else: 130 | return res["msg"] 131 | 132 | 133 | def clickru(url): 134 | dom = api_checker() 135 | api = f"{dom}/shorten" 136 | resp = requests.get(url) 137 | if resp.status_code == 404: 138 | return "File not found/The link you entered is wrong!" 139 | client = cloudscraper.create_scraper(allow_brotli=False) 140 | try: 141 | resp = client.post(api, json={"type": "clckru_shorten", "url": url}) 142 | res = resp.json() 143 | except BaseException: 144 | return "Emily API Unresponsive / Invalid Link!" 145 | if res["success"] is True: 146 | return res["url"] 147 | else: 148 | return res["msg"] 149 | 150 | 151 | def clilp(url): 152 | dom = api_checker() 153 | api = f"{dom}/shorten" 154 | resp = requests.get(url) 155 | if resp.status_code == 404: 156 | return "File not found/The link you entered is wrong!" 157 | client = cloudscraper.create_scraper(allow_brotli=False) 158 | try: 159 | resp = client.post(api, json={"type": "clilp_shorten", "url": url}) 160 | res = resp.json() 161 | except BaseException: 162 | return "Emily API Unresponsive / Invalid Link!" 163 | if res["success"] is True: 164 | return res["url"] 165 | else: 166 | return res["msg"] 167 | -------------------------------------------------------------------------------- /bot/plugins/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pk3011/scrap/f98015223ada84dbe055aca0a9ea4293afd904b7/bot/plugins/__init__.py -------------------------------------------------------------------------------- /bot/plugins/developer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pk3011/scrap/f98015223ada84dbe055aca0a9ea4293afd904b7/bot/plugins/developer/__init__.py -------------------------------------------------------------------------------- /bot/plugins/developer/ipinfo.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from pyrogram import Client, filters 3 | from pyrogram.types import Message 4 | 5 | from bot.config import * 6 | from bot.helpers.decorators import dev_commands 7 | 8 | prefixes = COMMAND_PREFIXES 9 | commands = ["ip", f"ip@{BOT_USERNAME}"] 10 | 11 | 12 | @Client.on_message(filters.command(commands, **prefixes)) 13 | @dev_commands 14 | async def ipinfo(client, message: Message): 15 | """ 16 | Give ip of the server where bot is running. 17 | """ 18 | 19 | response = requests.get("http://ipinfo.io/ip").text 20 | await message.reply_text(f"IP Address of the server is: `{response}`", quote=True) 21 | -------------------------------------------------------------------------------- /bot/plugins/developer/log.py: -------------------------------------------------------------------------------- 1 | from pyrogram import Client, filters 2 | from pyrogram.types import Message 3 | 4 | from bot.config import * 5 | from bot.helpers.decorators import dev_commands 6 | 7 | prefixes = COMMAND_PREFIXES 8 | commands = ["log", "logs", f"log@{BOT_USERNAME}", f"logs@{BOT_USERNAME}"] 9 | 10 | 11 | @Client.on_message(filters.command(commands, **prefixes)) 12 | @dev_commands 13 | async def log(client, message: Message): 14 | """ 15 | upload log file of the bot. 16 | """ 17 | try: 18 | await client.send_document(message.chat.id, "logs.txt", caption="logs.txt") 19 | except Exception as error: 20 | await message.reply_text(f"{error}", quote=True) 21 | -------------------------------------------------------------------------------- /bot/plugins/developer/terminal.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | import sys 4 | import traceback 5 | from io import BytesIO, StringIO 6 | 7 | from pyrogram import Client, filters 8 | from pyrogram.types import Message 9 | 10 | from bot.config import * 11 | from bot.helpers.decorators import dev_commands 12 | from bot.logging import LOGGER 13 | 14 | prefixes = COMMAND_PREFIXES 15 | 16 | shell_usage = f"**USAGE:** Executes terminal commands directly via bot.\n\n
/shell pip install requests
" 17 | commands = ["shell", f"shell@{BOT_USERNAME}"] 18 | 19 | 20 | @Client.on_message(filters.command(commands, **prefixes)) 21 | @dev_commands 22 | async def shell(client, message: Message): 23 | """ 24 | Executes terminal commands via bot. 25 | """ 26 | if len(message.command) < 2: 27 | return await message.reply_text(shell_usage, quote=True) 28 | 29 | user_input = message.text.split(None, 1)[1].split(" ") 30 | 31 | try: 32 | shell = subprocess.Popen( 33 | user_input, stdout=subprocess.PIPE, stderr=subprocess.PIPE 34 | ) 35 | 36 | stdout, stderr = shell.communicate() 37 | result = str(stdout.decode().strip()) + str(stderr.decode().strip()) 38 | 39 | except Exception as error: 40 | LOGGER(__name__).warning(f"{error}") 41 | return await message.reply_text(f"**Error**:\n\n{error}", quote=True) 42 | 43 | if len(result) > 2000: 44 | file = BytesIO(result.encode()) 45 | file.name = "output.txt" 46 | await message.reply_text("Output is too large (Sending it as File)", quote=True) 47 | await client.send_document(message.chat.id, file, caption=file.name) 48 | else: 49 | await message.reply_text(f"**Output:**:\n\n{result}", quote=True) 50 | 51 | 52 | async def aexec(code, client, message): 53 | exec( 54 | "async def __aexec(client, message): " 55 | + "".join(f"\n {a}" for a in code.split("\n")) 56 | ) 57 | return await locals()["__aexec"](client, message) 58 | 59 | 60 | exec_usage = f"**USAGE:** Executes python commands directly via bot.\n\n
/exec print('hello world')
" 61 | commands = ["exec", f"exec@{BOT_USERNAME}", "execute"] 62 | 63 | 64 | @Client.on_message(filters.command(commands, **prefixes)) 65 | @dev_commands 66 | async def executor(client, message: Message): 67 | if len(message.command) < 2: 68 | return await message.reply_text(exec_usage) 69 | 70 | try: 71 | code = message.text.split(None, 1)[1] 72 | print(message.text) 73 | except IndexError: 74 | return await message.delete() 75 | 76 | old_stderr = sys.stderr 77 | old_stdout = sys.stdout 78 | redirected_output = sys.stdout = StringIO() 79 | redirected_error = sys.stderr = StringIO() 80 | stdout, stderr, exc = None, None, None 81 | 82 | try: 83 | await aexec(code, client, message) 84 | except Exception: 85 | exc = traceback.format_exc() 86 | 87 | stdout = redirected_output.getvalue() 88 | stderr = redirected_error.getvalue() 89 | sys.stdout = old_stdout 90 | sys.stderr = old_stderr 91 | 92 | if exc: 93 | evaluation = exc 94 | elif stderr: 95 | evaluation = stderr 96 | elif stdout: 97 | evaluation = stdout 98 | else: 99 | evaluation = "Success" 100 | 101 | final_output = f"**OUTPUT**: \n\n{evaluation.strip()}" 102 | if len(final_output) > 2000: 103 | with open("output.txt", "w+", encoding="utf8") as file: 104 | file.write(str(evaluation.strip())) 105 | 106 | await message.reply_text("Output is too large (Sending it as File)", quote=True) 107 | await client.send_document(message.chat.id, "output.txt", caption="output.txt") 108 | os.remove("output.txt") 109 | 110 | else: 111 | await message.reply_text(final_output) 112 | -------------------------------------------------------------------------------- /bot/plugins/developer/updater.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | import sys 4 | import time 5 | 6 | from pyrogram import Client, filters 7 | from pyrogram.types import Message 8 | 9 | from bot.config import * 10 | from bot.helpers.decorators import dev_commands 11 | from bot.logging import LOGGER 12 | 13 | prefixes = COMMAND_PREFIXES 14 | 15 | commands = ["update", f"update@{BOT_USERNAME}"] 16 | 17 | 18 | @Client.on_message(filters.command(commands, **prefixes)) 19 | @dev_commands 20 | async def update(client, message: Message): 21 | """ 22 | Update the bot with latest commit changes from GitHub. 23 | """ 24 | 25 | msg = await message.reply_text( 26 | "**Pulling changes with latest commits...**", quote=True 27 | ) 28 | if UPSTREAM_REPO is not None: 29 | if os.path.exists(".git"): 30 | subprocess.run(["rm", "-rf", ".git"]) 31 | update = subprocess.run( 32 | [ 33 | f"git init -q \ 34 | && git config --global user.email emilymiss22@gmail.com \ 35 | && git config --global user.name multifbot \ 36 | && git add . \ 37 | && git commit -sm update -q \ 38 | && git remote add origin {UPSTREAM_REPO} \ 39 | && git fetch origin -q \ 40 | && git reset --hard origin/main -q" 41 | ], 42 | shell=True, 43 | ) 44 | time.sleep(1.5) 45 | if update.returncode == 0: 46 | LOGGER(__name__).info( 47 | "Successfully updated with latest commit from UPSTREAM_REPO" 48 | ) 49 | else: 50 | LOGGER(__name__).error( 51 | "Something went wrong while updating, check UPSTREAM_REPO if valid or not!" 52 | ) 53 | time.sleep(2) 54 | LOGGER(__name__).info("Bot Updated with latest commits. Restarting now..") 55 | await msg.edit( 56 | "**Changes pulled with latest commits. Restarting bot now... 🌟**" 57 | ) 58 | os.execl(sys.executable, sys.executable, "-m", "bot") 59 | sys.exit() 60 | else: 61 | await msg.edit( 62 | "**UpStream Repo not Provided, so could not fetch updates... 🌟**" 63 | ) 64 | 65 | 66 | commands = ["restart", f"restart@{BOT_USERNAME}"] 67 | 68 | 69 | @Client.on_message(filters.command(commands, **prefixes)) 70 | @dev_commands 71 | async def restart(client, message: Message): 72 | """ 73 | Restart the bot. 74 | """ 75 | 76 | LOGGER(__name__).info("Restarting the bot. Shutting down this instance") 77 | print("ok") 78 | await message.reply_text( 79 | "`Starting a new instance and shutting down this one`", quote=True 80 | ) 81 | os.execl(sys.executable, sys.executable, "-m", "bot") 82 | sys.exit() 83 | -------------------------------------------------------------------------------- /bot/plugins/sudo/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pk3011/scrap/f98015223ada84dbe055aca0a9ea4293afd904b7/bot/plugins/sudo/__init__.py -------------------------------------------------------------------------------- /bot/plugins/sudo/serverstats.py: -------------------------------------------------------------------------------- 1 | import shutil 2 | import time 3 | 4 | import psutil 5 | from pyrogram import Client, filters 6 | from pyrogram.types import Message 7 | 8 | from bot import BotStartTime 9 | from bot.config import * 10 | from bot.helpers.decorators import sudo_commands 11 | from bot.helpers.functions import get_readable_size, get_readable_time 12 | 13 | prefixes = COMMAND_PREFIXES 14 | 15 | 16 | commands = [ 17 | "stats", 18 | f"stats@{BOT_USERNAME}", 19 | "serverstats", 20 | f"serverstats@{BOT_USERNAME}", 21 | ] 22 | 23 | 24 | @Client.on_message(filters.command(commands, **prefixes)) 25 | @sudo_commands 26 | async def update(client, message: Message): 27 | 28 | currentTime = get_readable_time(time.time() - BotStartTime) 29 | total, used, free = shutil.disk_usage(".") 30 | total = get_readable_size(total) 31 | used = get_readable_size(used) 32 | free = get_readable_size(free) 33 | 34 | cpu_usage = psutil.cpu_percent() 35 | ram_usage = psutil.virtual_memory().percent 36 | disk_usage = psutil.disk_usage("/").percent 37 | 38 | await message.reply_text( 39 | f"**≧◉◡◉≦ Bot is Up and Running successfully.**\n\n× Bot Uptime: `{currentTime}`\n× Total Disk Space: `{total}`\n× Used: `{used}({disk_usage}%)`\n× Free: `{free}`\n× CPU Usage: `{cpu_usage}%`\n× RAM Usage: `{ram_usage}%`", 40 | quote=True, 41 | ) 42 | -------------------------------------------------------------------------------- /bot/plugins/sudo/speedtest.py: -------------------------------------------------------------------------------- 1 | from pyrogram import Client, filters 2 | from pyrogram.types import Message 3 | from speedtest import Speedtest 4 | 5 | from bot.config import * 6 | from bot.helpers.decorators import sudo_commands 7 | from bot.helpers.functions import get_readable_bytes 8 | from bot.logging import LOGGER 9 | 10 | prefixes = COMMAND_PREFIXES 11 | commands = ["speedtest", f"speedtest@{BOT_USERNAME}"] 12 | 13 | 14 | @Client.on_message(filters.command(commands, **prefixes)) 15 | @sudo_commands 16 | async def speedtest(_, message: Message): 17 | """ 18 | Give speedtest of server where bot is running 19 | """ 20 | speed = await message.reply("**Running speedtest ....**", quote=True) 21 | LOGGER(__name__).info("Started SpeedTest!") 22 | 23 | test = Speedtest() 24 | test.get_best_server() 25 | test.download() 26 | test.upload() 27 | test.results.share() 28 | result = test.results.dict() 29 | photo = result["share"] 30 | 31 | string_speed = f""" 32 | × Upload: {get_readable_bytes(result["upload"] / 8)}/s 33 | × Download: {get_readable_bytes(result["download"] / 8)}/s 34 | × Ping: {result["ping"]} ms 35 | × ISP: {result["client"]["isp"]} 36 | """ 37 | await speed.delete() 38 | await message.reply_photo(photo=photo, caption=string_speed, quote=True) 39 | -------------------------------------------------------------------------------- /bot/plugins/users/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pk3011/scrap/f98015223ada84dbe055aca0a9ea4293afd904b7/bot/plugins/users/__init__.py -------------------------------------------------------------------------------- /bot/plugins/users/bifm.py: -------------------------------------------------------------------------------- 1 | from re import search 2 | from time import time 3 | 4 | from pyrogram import Client, filters 5 | from pyrogram.types import Message 6 | 7 | from bot.config import * 8 | from bot.helpers.decorators import user_commands 9 | from bot.helpers.functions import get_readable_time 10 | from bot.logging import LOGGER 11 | from bot.modules import bypasser 12 | from bot.modules.regex import URL_REGEX, is_a_url 13 | 14 | prefixes = COMMAND_PREFIXES 15 | commands = ["bifm", f"bifm@{BOT_USERNAME}"] 16 | 17 | 18 | @Client.on_message(filters.command(commands, **prefixes)) 19 | @user_commands 20 | async def bifm(_, message: Message): 21 | """ 22 | Bypass Short Links using BIFM API 23 | """ 24 | msg_arg = message.text.replace(" ", " ") 25 | msg_args = msg_arg.split(" ", maxsplit=1) 26 | reply_to = message.reply_to_message 27 | if len(msg_args) > 1: 28 | cmd = msg_args[0] 29 | url = msg_args[1] 30 | elif reply_to is not None: 31 | try: 32 | reply_text = search(URL_REGEX, reply_to.text)[0] 33 | except BaseException: 34 | reply_text = ( 35 | search(URL_REGEX, str(reply_to.caption))[0] 36 | .replace("\\", "") 37 | .split("*")[0] 38 | ) 39 | url = reply_text.strip() 40 | cmd = msg_args[0] 41 | elif msg_args.count == (0 or 1) or reply_to is None: 42 | return "Bot could not retrieve your Input!" 43 | 44 | if url is not None: 45 | if url.startswith("http://"): 46 | url = url.replace("http://", "https://") 47 | elif not url.startswith("https://"): 48 | url = "https://" + url 49 | else: 50 | return "Bot could not retrieve your URL!" 51 | 52 | valid_url = is_a_url(url) 53 | if valid_url is not True: 54 | return "You did not seem to have entered a valid URL!" 55 | uname = message.from_user.mention 56 | uid = f"{message.from_user.id}" 57 | start = time() 58 | LOGGER(__name__).info(f" Received : {cmd} - {url}") 59 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}" 60 | await message.reply_text(text=abc, disable_web_page_preview=True, quote=True) 61 | res = bypasser.bifm(url) 62 | time_taken = get_readable_time(time() - start) 63 | LOGGER(__name__).info(f" Destination : {cmd} - {res}") 64 | xyz = f"Bypassed Link :\n{res}\n\nTime Taken : {time_taken}" 65 | await message.reply_text(text=xyz, disable_web_page_preview=True, quote=True) 66 | -------------------------------------------------------------------------------- /bot/plugins/users/bypass.py: -------------------------------------------------------------------------------- 1 | from re import search 2 | from time import sleep, time 3 | 4 | from pyrogram import Client, filters 5 | from pyrogram.types import Message 6 | 7 | from bot.config import * 8 | from bot.helpers.decorators import user_commands 9 | from bot.helpers.functions import get_readable_time 10 | from bot.logging import LOGGER 11 | from bot.modules import bypasser 12 | from bot.modules.lists import * 13 | from bot.modules.regex import * 14 | 15 | prefixes = COMMAND_PREFIXES 16 | commands = ["bypass", f"bypass@{BOT_USERNAME}"] 17 | 18 | 19 | @Client.on_message(filters.command(commands, **prefixes)) 20 | @user_commands 21 | async def bypass(_, message: Message): 22 | """ 23 | Bypass Various Supported Shortened URLs 24 | """ 25 | msg_arg = message.text.replace(" ", " ") 26 | msg_args = msg_arg.split(" ", maxsplit=1) 27 | reply_to = message.reply_to_message 28 | if len(msg_args) > 1: 29 | cmd = msg_args[0] 30 | url = msg_args[1] 31 | elif reply_to is not None: 32 | try: 33 | reply_text = search(URL_REGEX, reply_to.text)[0] 34 | except BaseException: 35 | reply_text = ( 36 | search(URL_REGEX, str(reply_to.caption))[0] 37 | .replace("\\", "") 38 | .split("*")[0] 39 | ) 40 | url = reply_text.strip() 41 | cmd = msg_args[0] 42 | elif msg_args.count == (0 or 1) or reply_to is None: 43 | return "Bot could not retrieve your Input!" 44 | 45 | if url is not None: 46 | if url.startswith("http://"): 47 | url = url.replace("http://", "https://") 48 | elif not url.startswith("https://"): 49 | url = "https://" + url 50 | else: 51 | return "Bot could not retrieve your URL!" 52 | 53 | valid_url = is_a_url(url) 54 | if valid_url is not True: 55 | return "You did not seem to have entered a valid URL!" 56 | uname = message.from_user.mention 57 | uid = f"{message.from_user.id}" 58 | start = time() 59 | msg_text = f"Dear {uname} (ID: {uid}),\n\nProcessing your URL....." 60 | msg = await message.reply_text( 61 | text=msg_text, disable_web_page_preview=True, quote=True 62 | ) 63 | sleep(1) 64 | if "droplink." in url or "droplinks." in url: 65 | link_type = "DropLinks" 66 | res = bypasser.droplink(url) 67 | elif "gplink." in url or "gplinks." in url: 68 | link_type = "GPLinks" 69 | res = bypasser.gplinks(url) 70 | elif any(x in url for x in linkvertise_list): 71 | link_type = "Linkvertise" 72 | res = bypasser.linkvertise(url) 73 | elif any(x in url for x in adfly_list): 74 | link_type = "AdFly" 75 | res = bypasser.adfly(url) 76 | elif "gyanilinks." in url or "gyanilink" in url: 77 | link_type = "GyaniLinks" 78 | res = bypasser.gyanilinks(url) 79 | elif "htpmovies." in url and "/exit.php?url" in url: 80 | link_type = "HTPMovies GDL" 81 | res = bypasser.htpmovies(url) 82 | elif "privatemoviez." in url and "/secret?data=" in url: 83 | link_type = "PrivateMoviez DL" 84 | res = bypasser.privatemoviez(url) 85 | elif "hypershort." in url: 86 | link_type = "HyperShort" 87 | res = bypasser.hypershort(url) 88 | elif "sirigan.my.id" in url: 89 | link_type = "Sirigan.my.id" 90 | res = bypasser.sirigan(url) 91 | elif "ouo.io" in url or "ouo.press" in url: 92 | link_type = "Ouo" 93 | res = bypasser.ouo(url) 94 | elif any(x in url for x in shst_list): 95 | link_type = "Shorte.st" 96 | res = bypasser.shorte(url) 97 | elif "rocklinks." in url: 98 | link_type = "RockLinks" 99 | res = bypasser.rocklinks(url) 100 | elif ("gtlinks." or "loan.kinemaster.cc/?token=" or "theforyou.in/?token=") in url: 101 | url = url.replace("&m=1", "") 102 | link_type = "GTLinks" 103 | res = bypasser.gtlinks(url) 104 | elif "gyanilinks." in url: 105 | link_type = "GyaniLinks" 106 | res = bypasser.gyanilinks(url) 107 | elif "shareus." in url: 108 | link_type = "Shareus" 109 | res = bypasser.shareus(url) 110 | elif "shortingly." in url: 111 | link_type = "Shortingly" 112 | res = bypasser.shortingly(url) 113 | elif "tnlink." in url: 114 | link_type = "TnLink" 115 | res = bypasser.tnlink(url) 116 | elif "xpshort." in url: 117 | link_type = "XpShort" 118 | res = bypasser.xpshort(url) 119 | elif "adrinolinks." in url: 120 | link_type = "AdrinoLinks" 121 | res = bypasser.adrinolinks(url) 122 | elif any(x in url for x in yandisk_list): 123 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Direct Link Generator\n\nUse it with /direct command followed by Link" 124 | await msg.edit(text=err) 125 | return 126 | elif any(x in url for x in fmed_list): 127 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Direct Link Generator\n\nUse it with /direct command followed by Link" 128 | await msg.edit(text=err) 129 | return 130 | elif any(x in url for x in sbembed_list): 131 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Direct Link Generator\n\nUse it with /direct command followed by Link" 132 | await msg.edit(text=err) 133 | return 134 | elif any(x in url for x in directdl_list): 135 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Direct Link Generator\n\nUse it with /direct command followed by Link" 136 | await msg.edit(text=err) 137 | return 138 | elif any(x in url for x in scrape_list): 139 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Site Scraper\n\nUse it with /scrape command followed by Link" 140 | await msg.edit(text=err) 141 | return 142 | else: 143 | if url is not None: 144 | try: 145 | link_type = "Script Generic" 146 | res = bypasser.script(url) 147 | except BaseException: 148 | err = "Could not find Bypass for your URL!" 149 | await msg.edit(text=err) 150 | return 151 | else: 152 | err = "Could not find your URL!" 153 | await msg.edit(text=err) 154 | return 155 | LOGGER(__name__).info(f" Received : {cmd} - {link_type} - {url}") 156 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\nLink Type : {link_type}" 157 | await msg.edit(text=abc) 158 | sleep(1) 159 | time_taken = get_readable_time(time() - start) 160 | LOGGER(__name__).info(f" Destination : {cmd} - {res}") 161 | xyz = f"Bypassed Result :\n{res}\n\nTime Taken : {time_taken}" 162 | await message.reply_text(text=xyz, disable_web_page_preview=True, quote=True) 163 | -------------------------------------------------------------------------------- /bot/plugins/users/direct.py: -------------------------------------------------------------------------------- 1 | from re import search 2 | from time import sleep, time 3 | 4 | from pyrogram import Client, filters 5 | from pyrogram.types import Message 6 | 7 | from bot.config import * 8 | from bot.helpers.decorators import user_commands 9 | from bot.helpers.functions import get_readable_time 10 | from bot.logging import LOGGER 11 | from bot.modules import direct_link 12 | from bot.modules.lists import * 13 | from bot.modules.pasting import telegraph_paste 14 | from bot.modules.regex import * 15 | 16 | prefixes = COMMAND_PREFIXES 17 | commands = ["direct", f"direct@{BOT_USERNAME}"] 18 | 19 | 20 | @Client.on_message(filters.command(commands, **prefixes)) 21 | @user_commands 22 | async def direct(_, message: Message): 23 | """ 24 | Get Direct Link for various Supported URLs 25 | """ 26 | msg_arg = message.text.replace(" ", " ") 27 | msg_args = msg_arg.split(" ", maxsplit=1) 28 | reply_to = message.reply_to_message 29 | if len(msg_args) > 1: 30 | cmd = msg_args[0] 31 | url = msg_args[1] 32 | elif reply_to is not None: 33 | try: 34 | reply_text = search(URL_REGEX, reply_to.text)[0] 35 | except BaseException: 36 | reply_text = ( 37 | search(URL_REGEX, str(reply_to.caption))[0] 38 | .replace("\\", "") 39 | .split("*")[0] 40 | ) 41 | url = reply_text.strip() 42 | cmd = msg_args[0] 43 | elif msg_args.count == (0 or 1) or reply_to is None: 44 | return "Bot could not retrieve your Input!" 45 | 46 | if url is not None: 47 | if url.startswith("http://"): 48 | url = url.replace("http://", "https://") 49 | elif not url.startswith("https://"): 50 | url = "https://" + url 51 | else: 52 | return "Bot could not retrieve your URL!" 53 | 54 | valid_url = is_a_url(url) 55 | if valid_url is not True: 56 | return "You did not seem to have entered a valid URL!" 57 | uname = message.from_user.mention 58 | uid = f"{message.from_user.id}" 59 | start = time() 60 | msg_text = f"Dear {uname} (ID: {uid}),\n\nProcessing your URL....." 61 | msg = await message.reply_text( 62 | text=msg_text, disable_web_page_preview=True, quote=True 63 | ) 64 | sleep(1) 65 | is_artstation = is_artstation_link(url) 66 | is_fichier = is_fichier_link(url) 67 | if is_artstation: 68 | link_type = "ArtStation" 69 | res = direct_link.artstation(url) 70 | elif "mdisk." in url: 71 | link_type = "MDisk" 72 | res = direct_link.mdisk(url) 73 | res2 = direct_link.mdisk_mpd(url) 74 | elif "wetransfer." in url or "we.tl" in url: 75 | link_type = "WeTransfer" 76 | res = direct_link.wetransfer(url) 77 | elif "gdbot." in url: 78 | link_type = "GDBot" 79 | res = direct_link.gdbot(url) 80 | elif "gofile." in url: 81 | link_type = "GoFile" 82 | # res = direct_link.gofile(url) 83 | res = url # Temporary Solution 84 | elif "megaup." in url: 85 | link_type = "MegaUp" 86 | res = direct_link.megaup(url) 87 | elif "sfile.mobi" in url: 88 | link_type = "Sfile.mobi" 89 | res = direct_link.sfile(url) 90 | elif any(x in url for x in yandisk_list): 91 | link_type = "Yandex Disk" 92 | res = direct_link.yandex_disk(url) 93 | elif "osdn." in url: 94 | link_type = "OSDN" 95 | res = direct_link.osdn(url) 96 | elif "github.com" in url: 97 | link_type = "Github" 98 | res = direct_link.github(url) 99 | elif "mediafire." in url: 100 | link_type = "MediaFire" 101 | res = direct_link.mediafire(url) 102 | elif "zippyshare." in url: 103 | link_type = "ZippyShare" 104 | res = direct_link.zippyshare(url) 105 | elif "hxfile." in url: 106 | link_type = "HXFile" 107 | res = direct_link.hxfile(url) 108 | elif "files.im" in url: 109 | link_type = "FilesIm" 110 | res = direct_link.filesIm(url) 111 | elif "anonfiles." in url: 112 | link_type = "AnonFiles" 113 | res = direct_link.anonfiles(url) 114 | elif "letsupload." in url: 115 | link_type = "LetsUpload" 116 | res = direct_link.letsupload(url) 117 | elif "linkpoi." in url: 118 | link_type = "LinkPoi" 119 | res = direct_link.linkpoi(url) 120 | elif any(x in url for x in fmed_list): 121 | link_type = "Fembed" 122 | res = direct_link.fembed(url) 123 | elif any(x in url for x in sbembed_list): 124 | link_type = "SBEmbed" 125 | res = direct_link.sbembed(url) 126 | elif "mirrored." in url: 127 | link_type = "Mirrored" 128 | res = direct_link.mirrored(url) 129 | elif "reupload." in url: 130 | link_type = "ReUpload" 131 | res = direct_link.reupload(url) 132 | elif "uservideo." in url: 133 | link_type = "UserVideo" 134 | res = direct_link.uservideo(url) 135 | elif "antfiles." in url: 136 | link_type = "AntFiles" 137 | res = direct_link.antfiles(url) 138 | elif "streamtape." in url: 139 | link_type = "StreamTape" 140 | res = direct_link.streamtape(url) 141 | elif "sourceforge" in url: 142 | link_type = "SourceForge" 143 | if "master.dl.sourceforge.net" in url: 144 | res = direct_link.sourceforge2(url) 145 | else: 146 | res = direct_link.sourceforge(url) 147 | elif "androidatahost." in url: 148 | link_type = "AndroidataHost" 149 | res = direct_link.androiddatahost(url) 150 | elif "krakenfiles." in url: 151 | link_type = "KrakenFiles" 152 | res = direct_link.krakenfiles(url) 153 | elif "dropbox." in url: 154 | link_type = "DropBox" 155 | if "dropbox.com/s/" in url: 156 | res = direct_link.dropbox(url) 157 | else: 158 | res = direct_link.dropbox2(url) 159 | elif "pixeldrain." in url: 160 | link_type = "PixelDrain" 161 | res = direct_link.pixeldrain(url) 162 | elif ("streamlare." or "sltube.") in url: 163 | link_type = "Streamlare" 164 | res = direct_link.streamlare(url) 165 | elif "pandafiles." in url: 166 | link_type = "PandaFiles" 167 | res = direct_link.pandafile(url) 168 | elif is_fichier: 169 | link_type = "Fichier" 170 | res = direct_link.fichier(url) 171 | elif "upload.ee" in url: 172 | link_type = "UploadEE" 173 | res = direct_link.uploadee(url) 174 | elif "uptobox." in url: 175 | link_type = "Uptobox" 176 | res = direct_link.uptobox(url) 177 | elif "solidfiles." in url: 178 | link_type = "SolidFiles" 179 | res = direct_link.solidfiles(url) 180 | elif "hubcloud." in url: 181 | link_type = "HubCloud" 182 | res = direct_link.hubcloud(url) 183 | elif "bunkr.is" in url: 184 | link_type = "Bunkr.is" 185 | res = direct_link.bunkr_cyber(url) 186 | res = telegraph_paste(res) 187 | elif "cyberdrop." in url: 188 | link_type = "CyberDrop" 189 | res = direct_link.bunkr_cyber(url) 190 | res = telegraph_paste(res) 191 | elif "pixl.is" in url: 192 | link_type = "Pixl.is" 193 | res = direct_link.pixl(url) 194 | res = telegraph_paste(res) 195 | elif "send.cm" in url: 196 | is_sendcm_folder = is_sendcm_folder_link(url) 197 | if is_sendcm_folder: 198 | link_type = "Sendcm Folder" 199 | res = direct_link.sendcm(url) 200 | res = telegraph_paste(res) 201 | else: 202 | link_type = "Sendcm File" 203 | res = direct_link.sendcm(url) 204 | elif any(x in url for x in linkvertise_list): 205 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Short Link Bypasser\n\nUse it with /bypass command followed by Link" 206 | await msg.edit(text=err) 207 | return 208 | elif any(x in url for x in bypass_list): 209 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Short Link Bypasser\n\nUse it with /bypass command followed by Link" 210 | await msg.edit(text=err) 211 | return 212 | elif any(x in url for x in adfly_list): 213 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Short Link Bypasser\n\nUse it with /bypass command followed by Link" 214 | await msg.edit(text=err) 215 | return 216 | elif any(x in url for x in scrape_list): 217 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Site Scraper\n\nUse it with /scrape command followed by Link" 218 | await msg.edit(text=err) 219 | return 220 | else: 221 | err = f"Dear {uname} (ID: {uid}),\n\nCould not generate Direct Link for your URL" 222 | await message.reply_text(text=err, disable_web_page_preview=True, quote=True) 223 | return 224 | LOGGER(__name__).info(f" Received : {cmd} - {link_type} - {url}") 225 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\nLink Type : {link_type}" 226 | await msg.edit(text=abc) 227 | sleep(1) 228 | time_taken = get_readable_time(time() - start) 229 | LOGGER(__name__).info(f" Destination : {cmd} - {res}") 230 | if link_type == "GoFile": 231 | xyz = f"Sorry! GoFile Bypass is not supported anymore" 232 | elif link_type == "MDisk": 233 | xyz = f"Download Link: {res}\n MPD Link: {res2}\n\nTime Taken : {time_taken}" 234 | elif link_type == "MegaUp": 235 | xyz = ( 236 | f"Dear {uname} (ID: {uid}),\n\nYour Direct-Download Link is :\n{res}\n\n" 237 | f"NOTE : \nMegaUp has Cloudflare Protection Enabled.So Do not use this Link in Mirror Bots.Use it from your Device and downloading will start." 238 | ) 239 | elif ( 240 | link_type == "Bunkr.is" 241 | or link_type == "CyberDrop" 242 | or link_type == "Pixl.is" 243 | or link_type == "Sendcm Folder" 244 | ): 245 | xyz = f"Dear {uname} (ID: {uid}),\n\nYour Telegraph URL (containing Result) is :\n{res}\n\nTime Taken : {time_taken}" 246 | else: 247 | xyz = f"Dear {uname} (ID: {uid}),\n\nYour Direct-Download Link is :\n{res}\n\nTime Taken : {time_taken}" 248 | await message.reply_text(text=xyz, disable_web_page_preview=True, quote=True) 249 | -------------------------------------------------------------------------------- /bot/plugins/users/gdfv.py: -------------------------------------------------------------------------------- 1 | from re import search 2 | from time import sleep, time 3 | 4 | from pyrogram import Client, filters 5 | from pyrogram.types import Message 6 | 7 | from bot.helpers.decorators import user_commands 8 | from bot.helpers.functions import get_readable_time 9 | from bot.logging import LOGGER 10 | from bot.modules.gdrive_direct import * 11 | from bot.modules.regex import * 12 | 13 | prefixes = COMMAND_PREFIXES 14 | commands = ["gd", f"gd@{BOT_USERNAME}"] 15 | 16 | 17 | @Client.on_message(filters.command(commands, **prefixes)) 18 | @user_commands 19 | async def gd(_, message: Message): 20 | """ 21 | Get GDrive Links for various Drive File Sharer 22 | """ 23 | msg_arg = message.text.replace(" ", " ") 24 | msg_args = msg_arg.split(" ", maxsplit=1) 25 | reply_to = message.reply_to_message 26 | if len(msg_args) > 1: 27 | cmd = msg_args[0] 28 | url = msg_args[1] 29 | elif reply_to is not None: 30 | try: 31 | reply_text = search(URL_REGEX, reply_to.text)[0] 32 | except BaseException: 33 | reply_text = ( 34 | search(URL_REGEX, str(reply_to.caption))[0] 35 | .replace("\\", "") 36 | .split("*")[0] 37 | ) 38 | url = reply_text.strip() 39 | cmd = msg_args[0] 40 | elif msg_args.count == (0 or 1) or reply_to is None: 41 | return "Bot could not retrieve your Input!" 42 | 43 | if url is not None: 44 | if url.startswith("http://"): 45 | url = url.replace("http://", "https://") 46 | elif not url.startswith("https://"): 47 | url = "https://" + url 48 | else: 49 | return "Bot could not retrieve your URL!" 50 | 51 | valid_url = is_a_url(url) 52 | if valid_url is not True: 53 | return "You did not seem to have entered a valid URL!" 54 | uname = message.from_user.mention 55 | uid = f"{message.from_user.id}" 56 | start = time() 57 | msg_text = f"Dear {uname} (ID: {uid}),\n\nProcessing your URL....." 58 | msg = await message.reply_text( 59 | text=msg_text, disable_web_page_preview=True, quote=True 60 | ) 61 | LOGGER(__name__).info(f" Received : {cmd} - {url}") 62 | sleep(1) 63 | is_gdtot = is_gdtot_link(url) 64 | is_drivehubs = is_drivehubs_link(url) 65 | is_unified = is_unified_link(url) 66 | is_udrive = is_udrive_link(url) 67 | is_sharer = is_sharer_link(url) 68 | if is_gdtot: 69 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : GDTot" 70 | await msg.edit(text=abc) 71 | res = gdtot(url) 72 | time_taken = get_readable_time(time() - start) 73 | LOGGER(__name__).info(f" Destination : {cmd} - {res}") 74 | xyz = f"Direct Gdrive Link :\n{res}\n\nTime Taken : {time_taken}" 75 | elif is_drivehubs: 76 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : DriveHubs" 77 | await msg.edit(text=abc) 78 | res = drivehubs(url) 79 | time_taken = get_readable_time(time() - start) 80 | LOGGER(__name__).info(f" Destination : {cmd} - {res}") 81 | xyz = f"Direct Gdrive Link :\n{res}\n\nTime Taken : {time_taken}" 82 | elif is_unified: 83 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : AppDrive Look-Alike" 84 | await msg.edit(text=abc) 85 | res = unified(url) 86 | time_taken = get_readable_time(time() - start) 87 | LOGGER(__name__).info(f" Destination : {cmd} - {res}") 88 | xyz = f"Direct Gdrive Link :\n{res}\n\nTime Taken : {time_taken}" 89 | elif is_udrive: 90 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : HubDrive Look-Alike" 91 | await msg.edit(text=abc) 92 | res = udrive(url) 93 | time_taken = get_readable_time(time() - start) 94 | LOGGER(__name__).info(f" Destination : {cmd} - {res}") 95 | xyz = f"Direct Gdrive Link :\n{res}\n\nTime Taken : {time_taken}" 96 | elif is_sharer: 97 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : Sharer.pw" 98 | await msg.edit(text=abc) 99 | res = sharerpw(url) 100 | time_taken = get_readable_time(time() - start) 101 | LOGGER(__name__).info(f" Destination : {cmd} - {res}") 102 | xyz = f"Direct Gdrive Link :\n{res}\n\nTime Taken : {time_taken}" 103 | elif "pahe." in url: 104 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : Pahe" 105 | await msg.edit(text=abc) 106 | res = pahe(url) 107 | time_taken = get_readable_time(time() - start) 108 | LOGGER(__name__).info(f" Destination : {cmd} - {res}") 109 | xyz = f"Direct Gdrive Link :\n{res}\n\nTime Taken : {time_taken}" 110 | elif "drive.google.com" in url: 111 | await msg.delete() 112 | xyz = "You have entered a Google Drive Link!" 113 | else: 114 | await msg.delete() 115 | xyz = "This Command does not support this Link!" 116 | sleep(1) 117 | await message.reply_text(text=xyz, disable_web_page_preview=True, quote=True) 118 | -------------------------------------------------------------------------------- /bot/plugins/users/index.py: -------------------------------------------------------------------------------- 1 | from re import search 2 | from time import time 3 | 4 | from pyrogram import Client, filters 5 | from pyrogram.types import Message 6 | 7 | from bot.config import * 8 | from bot.helpers.decorators import user_commands 9 | from bot.helpers.functions import get_readable_time 10 | from bot.logging import LOGGER 11 | from bot.modules import scraper 12 | from bot.modules.pasting import telegraph_paste 13 | from bot.modules.regex import URL_REGEX, is_a_url 14 | 15 | prefixes = COMMAND_PREFIXES 16 | commands = ["index", f"index@{BOT_USERNAME}"] 17 | 18 | 19 | @Client.on_message(filters.command(commands, **prefixes)) 20 | @user_commands 21 | async def index(_, message: Message): 22 | """ 23 | Extract Direct Links from Bhadoo Index Folder URLs 24 | """ 25 | msg_arg = message.text.replace(" ", " ") 26 | msg_args = msg_arg.split(" ", maxsplit=1) 27 | reply_to = message.reply_to_message 28 | if len(msg_args) > 1: 29 | cmd = msg_args[0] 30 | url = msg_args[1] 31 | elif reply_to is not None: 32 | try: 33 | reply_text = search(URL_REGEX, reply_to.text)[0] 34 | except BaseException: 35 | reply_text = ( 36 | search(URL_REGEX, str(reply_to.caption))[0] 37 | .replace("\\", "") 38 | .split("*")[0] 39 | ) 40 | url = reply_text.strip() 41 | cmd = msg_args[0] 42 | elif msg_args.count == (0 or 1) or reply_to is None: 43 | return "Bot could not retrieve your Input!" 44 | 45 | if url is not None: 46 | if url.startswith("http://"): 47 | url = url.replace("http://", "https://") 48 | elif not url.startswith("https://"): 49 | url = "https://" + url 50 | else: 51 | return "Bot could not retrieve your URL!" 52 | 53 | valid_url = is_a_url(url) 54 | if valid_url is not True: 55 | return "You did not seem to have entered a valid URL!" 56 | uname = message.from_user.mention 57 | uid = f"{message.from_user.id}" 58 | start = time() 59 | LOGGER(__name__).info(f" Received : {cmd} - {url}") 60 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : Bhadoo Index" 61 | await message.reply_text(text=abc, disable_web_page_preview=True, quote=True) 62 | res = scraper.index_scrap(url) 63 | des_url = telegraph_paste(res) 64 | time_taken = get_readable_time(time() - start) 65 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 66 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 67 | await message.reply_text(text=xyz, disable_web_page_preview=True, quote=True) 68 | -------------------------------------------------------------------------------- /bot/plugins/users/magnet.py: -------------------------------------------------------------------------------- 1 | from re import search 2 | from time import time 3 | 4 | from pyrogram import Client, filters 5 | from pyrogram.types import Message 6 | 7 | from bot.config import * 8 | from bot.helpers.decorators import user_commands 9 | from bot.helpers.functions import get_readable_time 10 | from bot.logging import LOGGER 11 | from bot.modules import scraper 12 | from bot.modules.regex import URL_REGEX, is_a_url 13 | 14 | prefixes = COMMAND_PREFIXES 15 | commands = ["magnet", f"magnet@{BOT_USERNAME}"] 16 | 17 | 18 | @Client.on_message(filters.command(commands, **prefixes)) 19 | @user_commands 20 | async def magnet(_, message: Message): 21 | """ 22 | Extract Magnet from Torrent Websites 23 | """ 24 | msg_arg = message.text.replace(" ", " ") 25 | msg_args = msg_arg.split(" ", maxsplit=1) 26 | reply_to = message.reply_to_message 27 | if len(msg_args) > 1: 28 | cmd = msg_args[0] 29 | url = msg_args[1] 30 | elif reply_to is not None: 31 | try: 32 | reply_text = search(URL_REGEX, reply_to.text)[0] 33 | except BaseException: 34 | reply_text = ( 35 | search(URL_REGEX, str(reply_to.caption))[0] 36 | .replace("\\", "") 37 | .split("*")[0] 38 | ) 39 | url = reply_text.strip() 40 | cmd = msg_args[0] 41 | elif msg_args.count == (0 or 1) or reply_to is None: 42 | return "Bot could not retrieve your Input!" 43 | 44 | if url is not None: 45 | if url.startswith("http://"): 46 | url = url.replace("http://", "https://") 47 | elif not url.startswith("https://"): 48 | url = "https://" + url 49 | else: 50 | return "Bot could not retrieve your URL!" 51 | 52 | valid_url = is_a_url(url) 53 | if valid_url is not True: 54 | return "You did not seem to have entered a valid URL!" 55 | uname = message.from_user.mention 56 | uid = f"{message.from_user.id}" 57 | start = time() 58 | LOGGER(__name__).info(f" Received : {cmd} - {url}") 59 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : Magnet Scraping" 60 | await message.reply_text(text=abc, disable_web_page_preview=True, quote=True) 61 | res = scraper.magnet_scrap(url) 62 | time_taken = get_readable_time(time() - start) 63 | LOGGER(__name__).info(f" Destination : {cmd} - {res}") 64 | xyz = f"Bypassed Link :\n{res}\n\nTime Taken : {time_taken}" 65 | await message.reply_text(text=xyz, disable_web_page_preview=True, quote=True) 66 | -------------------------------------------------------------------------------- /bot/plugins/users/mkvcinema.py: -------------------------------------------------------------------------------- 1 | from re import search 2 | from time import sleep, time 3 | 4 | import chromedriver_autoinstaller 5 | from bs4 import BeautifulSoup 6 | from pyrogram import Client, filters 7 | from pyrogram.types import Message 8 | from requests import get as rget 9 | from selenium import webdriver 10 | from selenium.webdriver.common.by import By 11 | from selenium.webdriver.support import expected_conditions as ec 12 | from selenium.webdriver.support.ui import WebDriverWait 13 | 14 | from bot.config import * 15 | from bot.helpers.decorators import user_commands 16 | from bot.helpers.functions import get_readable_time 17 | from bot.logging import LOGGER 18 | from bot.modules.pasting import telegraph_paste 19 | from bot.modules.regex import * 20 | 21 | prefixes = COMMAND_PREFIXES 22 | commands = ["mkvcinema", f"mkvcinema@{BOT_USERNAME}"] 23 | 24 | 25 | @Client.on_message(filters.command(commands, **prefixes)) 26 | @user_commands 27 | async def bypass(_, message: Message): 28 | """ 29 | Scrape MKV Cinemas URL for Direct Links 30 | """ 31 | global temp 32 | msg_arg = message.text.replace(" ", " ") 33 | msg_args = msg_arg.split(" ", maxsplit=1) 34 | reply_to = message.reply_to_message 35 | if len(msg_args) > 1: 36 | cmd = msg_args[0] 37 | url = msg_args[1] 38 | elif reply_to is not None: 39 | try: 40 | reply_text = search(URL_REGEX, reply_to.text)[0] 41 | except BaseException: 42 | reply_text = ( 43 | search(URL_REGEX, str(reply_to.caption))[0] 44 | .replace("\\", "") 45 | .split("*")[0] 46 | ) 47 | url = reply_text.strip() 48 | cmd = msg_args[0] 49 | elif msg_args.count == (0 or 1) or reply_to is None: 50 | return "Bot could not retrieve your Input!" 51 | 52 | if url is not None: 53 | if url.startswith("http://"): 54 | url = url.replace("http://", "https://") 55 | elif not url.startswith("https://"): 56 | url = "https://" + url 57 | else: 58 | return "Bot could not retrieve your URL!" 59 | 60 | valid_url = is_a_url(url) 61 | if valid_url is not True: 62 | return "You did not seem to have entered a valid URL!" 63 | uname = message.from_user.mention 64 | uid = f"{message.from_user.id}" 65 | start = time() 66 | msg_text = f"Dear {uname} (ID: {uid}),\n\nProcessing your URL....." 67 | LOGGER(__name__).info(f" Received : {cmd} - {url}") 68 | msg = await message.reply_text( 69 | text=msg_text, disable_web_page_preview=True, quote=True 70 | ) 71 | sleep(2) 72 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\nLink Type : MKVCinemas" 73 | await msg.edit(text=abc) 74 | try: 75 | soup = BeautifulSoup(rget(url).content, "html.parser") 76 | links = [] 77 | for link in soup.find_all("a", class_="gdlink"): 78 | links.append(link.get("href")) 79 | 80 | for link in soup.find_all("a", class_="button"): 81 | links.append(link.get("href")) 82 | 83 | melob_links = [] 84 | count = -1 85 | for l in links: 86 | count += 1 87 | id = BeautifulSoup(rget(links[count]).content, "html.parser").find_all( 88 | "input" 89 | )[1]["value"] 90 | link = f"https://www.mealob.com{id}" 91 | melob_links.append(link) 92 | melob_count = len(melob_links) 93 | wait_time = get_readable_time(len(melob_links) * 23) 94 | melob_msg = f"Found {melob_count} Links to be scrapped in your MkvCinema link. It'll take around {wait_time} to finish the process. Please wait..." 95 | temp = await message.reply_text( 96 | text=melob_msg, disable_web_page_preview=True, quote=True 97 | ) 98 | except Exception as err: 99 | await temp.delete() 100 | err_msg = f"Error Ocuured : {err}" 101 | await msg.edit(text=err_msg) 102 | return 103 | 104 | bypassed_links = [] 105 | failed_links = [] 106 | chromedriver_autoinstaller.install() 107 | for link in melob_links: 108 | generater = '//*[@id="generater"]' 109 | showlink = '//*[@id="showlink"]' 110 | landing = '//*[@id="landing"]/div[2]/center/img' 111 | chrome_options = webdriver.ChromeOptions() 112 | chrome_options.add_argument("--no-sandbox") 113 | chrome_options.add_argument("--headless") 114 | chrome_options.add_argument("--disable-dev-shm-usage") 115 | wd = webdriver.Chrome(options=chrome_options) 116 | try: 117 | wd.get(link) 118 | sleep(3) 119 | WebDriverWait(wd, 10).until( 120 | ec.element_to_be_clickable((By.XPATH, landing)) 121 | ).click() 122 | WebDriverWait(wd, 10).until( 123 | ec.element_to_be_clickable((By.XPATH, generater)) 124 | ).click() 125 | WebDriverWait(wd, 10).until( 126 | ec.element_to_be_clickable((By.XPATH, showlink)) 127 | ).click() 128 | wd.current_window_handle 129 | IItab = wd.window_handles[1] 130 | wd.switch_to.window(IItab) 131 | LOGGER(__name__).info(f"Bypassed Link: {cmd} - {wd.current_url}") 132 | bypassed_links.append(wd.current_url) 133 | except Exception as err: 134 | LOGGER(__name__).error(f"MKVCinema Melob Error: {err}") 135 | failed_links.append(link) 136 | if len(failed_links) == melob_count: 137 | await temp.delete() 138 | err = "Scrapping has failed!" 139 | await msg.edit(text=err) 140 | return 141 | 142 | bypassed_msg = "" 143 | for bypsd_link in bypassed_links: 144 | bypassed_msg += f"• {bypsd_link}
>" 145 | tlg_url = telegraph_paste(bypassed_msg) 146 | timelog = get_readable_time(time() - start) 147 | final = f"Bypassed Result(via Telegraph): \n{tlg_url}\nTime Taken: {timelog}" 148 | await msg.edit(text=final) 149 | -------------------------------------------------------------------------------- /bot/plugins/users/ping.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | 3 | import requests as r 4 | from pyrogram import Client, filters 5 | from pyrogram.types import Message 6 | 7 | from bot.config import * 8 | from bot.helpers.decorators import user_commands 9 | 10 | prefixes = COMMAND_PREFIXES 11 | commands = ["ping", f"ping@{BOT_USERNAME}"] 12 | 13 | 14 | @Client.on_message(filters.command(commands, **prefixes)) 15 | @user_commands 16 | async def ping(_, message: Message): 17 | """ 18 | Checks ping speed to bot API 19 | """ 20 | 21 | start = datetime.now() 22 | r.get("http://api.telegram.org") 23 | end = datetime.now() 24 | 25 | pong = (end - start).microseconds / 1000 26 | await message.reply_text(f"**PONG!!** | Ping Time: `{pong}`ms", quote=True) 27 | -------------------------------------------------------------------------------- /bot/plugins/users/pybyp.py: -------------------------------------------------------------------------------- 1 | from re import search 2 | from time import time 3 | 4 | from pyrogram import Client, filters 5 | from pyrogram.types import Message 6 | 7 | from bot.config import * 8 | from bot.helpers.decorators import user_commands 9 | from bot.helpers.functions import get_readable_time 10 | from bot.logging import LOGGER 11 | from bot.modules import bypasser 12 | from bot.modules.regex import URL_REGEX, is_a_url 13 | 14 | prefixes = COMMAND_PREFIXES 15 | commands = ["multi", f"multi@{BOT_USERNAME}"] 16 | 17 | 18 | @Client.on_message(filters.command(commands, **prefixes)) 19 | @user_commands 20 | async def multi(_, message: Message): 21 | """ 22 | Bypass Short Links using PyBypass Library 23 | """ 24 | msg_arg = message.text.replace(" ", " ") 25 | msg_args = msg_arg.split(" ", maxsplit=1) 26 | reply_to = message.reply_to_message 27 | if len(msg_args) > 1: 28 | cmd = msg_args[0] 29 | url = msg_args[1] 30 | elif reply_to is not None: 31 | try: 32 | reply_text = search(URL_REGEX, reply_to.text)[0] 33 | except BaseException: 34 | reply_text = ( 35 | search(URL_REGEX, str(reply_to.caption))[0] 36 | .replace("\\", "") 37 | .split("*")[0] 38 | ) 39 | url = reply_text.strip() 40 | cmd = msg_args[0] 41 | elif msg_args.count == (0 or 1) or reply_to is None: 42 | return "Bot could not retrieve your Input!" 43 | 44 | if url is not None: 45 | if url.startswith("http://"): 46 | url = url.replace("http://", "https://") 47 | elif not url.startswith("https://"): 48 | url = "https://" + url 49 | else: 50 | return "Bot could not retrieve your URL!" 51 | 52 | valid_url = is_a_url(url) 53 | if valid_url is not True: 54 | return "You did not seem to have entered a valid URL!" 55 | uname = message.from_user.mention 56 | uid = f"{message.from_user.id}" 57 | start = time() 58 | LOGGER(__name__).info(f" Received : {cmd} - {url}") 59 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}" 60 | await message.reply_text(text=abc, disable_web_page_preview=True, quote=True) 61 | res = bypasser.multi_pybyp(url) 62 | time_taken = get_readable_time(time() - start) 63 | LOGGER(__name__).info(f" Destination : {cmd} - {res}") 64 | xyz = f"Bypassed Result :\n{res}\n\nTime Taken : {time_taken}" 65 | await message.reply_text(text=xyz, disable_web_page_preview=True, quote=True) 66 | -------------------------------------------------------------------------------- /bot/plugins/users/scrape.py: -------------------------------------------------------------------------------- 1 | from re import search 2 | from time import sleep, time 3 | 4 | from pyrogram import Client, filters 5 | from pyrogram.types import Message 6 | 7 | from bot.helpers.decorators import user_commands 8 | from bot.helpers.functions import get_readable_time 9 | from bot.logging import LOGGER 10 | from bot.modules.bypasser import * 11 | from bot.modules.gdrive_direct import pahe 12 | from bot.modules.lists import * 13 | from bot.modules.pasting import telegraph_paste 14 | from bot.modules.regex import * 15 | from bot.modules.scraper import * 16 | 17 | prefixes = COMMAND_PREFIXES 18 | commands = ["scrape", f"scrape@{BOT_USERNAME}"] 19 | 20 | 21 | @Client.on_message(filters.command(commands, **prefixes)) 22 | @user_commands 23 | async def scrape(_, message: Message): 24 | """ 25 | Extract Direct Links from Supported Sites 26 | """ 27 | msg_arg = message.text.replace(" ", " ") 28 | msg_args = msg_arg.split(" ", maxsplit=1) 29 | reply_to = message.reply_to_message 30 | if len(msg_args) > 1: 31 | cmd = msg_args[0] 32 | url = msg_args[1] 33 | elif reply_to is not None: 34 | try: 35 | reply_text = search(URL_REGEX, reply_to.text)[0] 36 | except BaseException: 37 | reply_text = ( 38 | search(URL_REGEX, str(reply_to.caption))[0] 39 | .replace("\\", "") 40 | .split("*")[0] 41 | ) 42 | url = reply_text.strip() 43 | cmd = msg_args[0] 44 | elif msg_args.count == (0 or 1) or reply_to is None: 45 | return "Bot could not retrieve your Input!" 46 | 47 | if url is not None: 48 | if url.startswith("http://"): 49 | url = url.replace("http://", "https://") 50 | elif not url.startswith("https://"): 51 | url = "https://" + url 52 | else: 53 | return "Bot could not retrieve your URL!" 54 | 55 | valid_url = is_a_url(url) 56 | if valid_url is not True: 57 | return "You did not seem to have entered a valid URL!" 58 | uname = message.from_user.mention 59 | uid = f"{message.from_user.id}" 60 | start = time.time() 61 | msg_text = f"Dear {uname} (ID: {uid}),\n\nProcessing your URL....." 62 | msg = await message.reply_text( 63 | text=msg_text, disable_web_page_preview=True, quote=True 64 | ) 65 | LOGGER(__name__).info(f" Received : {cmd} - {url}") 66 | sleep(1) 67 | if ( 68 | "workers.dev" in url 69 | or "0:/" in url 70 | or "1:/" in url 71 | or "2:/" in url 72 | or "3:/" in url 73 | or "4:/" in url 74 | or "5:/" in url 75 | or "6:/" in url 76 | ): 77 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : Bhadoo Index" 78 | await msg.edit(text=abc) 79 | res = index_scrap(url) 80 | des_url = telegraph_paste(res) 81 | time_taken = get_readable_time(time() - start) 82 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 83 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 84 | elif "atishmkv." in url or "atish.mkv" in url: 85 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : AtishMKV" 86 | await msg.edit(text=abc) 87 | des_url = atishmkv_scrap(url) 88 | time_taken = get_readable_time(time() - start) 89 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 90 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 91 | elif "cinevez." in url: 92 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : Cinevez" 93 | await msg.edit(text=abc) 94 | des_url = cinevez_scrap(url) 95 | time_taken = get_readable_time(time() - start) 96 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 97 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 98 | elif "cinevood." in url: 99 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : Cinevood" 100 | await msg.edit(text=abc) 101 | des_url = cinevood_scrap(url) 102 | time_taken = get_readable_time(time() - start) 103 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 104 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 105 | elif "filecrypt." in url: 106 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : Filecrypt" 107 | await msg.edit(text=abc) 108 | des_url = filecrypt_scrap(url) 109 | time_taken = get_readable_time(time() - start) 110 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 111 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 112 | elif "htpmovies." in url and "/exit.php?url=" in url: 113 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : HTP Movies" 114 | await msg.edit(text=abc) 115 | des_url = htpmovies(url) 116 | time_taken = get_readable_time(time() - start) 117 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 118 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 119 | elif "igg-games." in url: 120 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : IGG Games" 121 | await msg.edit(text=abc) 122 | des_url = igggames_scrape(url) 123 | time_taken = get_readable_time(time() - start) 124 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 125 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 126 | elif "moviesdrama." in url: 127 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : Movies Drama" 128 | await msg.edit(text=abc) 129 | des_url = moviesdrama_scrap(url) 130 | time_taken = get_readable_time(time() - start) 131 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 132 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 133 | elif "olamovies." in url: 134 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : OlaMovies" 135 | await msg.edit(text=abc) 136 | des_url = olamovies_scrap(url) 137 | time_taken = get_readable_time(time() - start) 138 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 139 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 140 | elif "psa." in url: 141 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : PSA" 142 | await msg.edit(text=abc) 143 | """ des_url = psa_scrap(url) 144 | time_taken = get_readable_time(time() - start) 145 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 146 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" """ 147 | xyz = "PSA Scraper has been patched for now!" 148 | elif "toonworld4all." in url: 149 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : ToonWorld4all" 150 | await msg.edit(text=abc) 151 | des_url = toonworld4all_scrap(url) 152 | time_taken = get_readable_time(time() - start) 153 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 154 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 155 | elif "sharespark." in url: 156 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : Sharespark" 157 | await msg.edit(text=abc) 158 | des_url = sharespark_scrap(url) 159 | time_taken = get_readable_time(time() - start) 160 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 161 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 162 | elif "privatemoviez." in url and "/secret?data=" in url: 163 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : Privatemoviez" 164 | await msg.edit(text=abc) 165 | des_url = privatemoviez(url) 166 | time_taken = get_readable_time(time() - start) 167 | LOGGER(__name__).info(f" Destination : {cmd} - {des_url}") 168 | xyz = f"Telegraph URL(with Result):\n {des_url}\n\nTime Taken : {time_taken}" 169 | elif "pahe." in url: 170 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}\n\nLink Type : Pahe" 171 | await msg.edit(text=abc) 172 | res = pahe(url) 173 | LOGGER(__name__).info(f" Destination : {cmd} - {res}") 174 | xyz = f"Direct Gdrive Link :\n{res}" 175 | elif any(x in url for x in yandisk_list): 176 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Direct Link Generator\n\nUse it with /direct command followed by Link" 177 | await msg.edit(text=err) 178 | return 179 | elif any(x in url for x in fmed_list): 180 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Direct Link Generator\n\nUse it with /direct command followed by Link" 181 | await msg.edit(text=err) 182 | return 183 | elif any(x in url for x in sbembed_list): 184 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Direct Link Generator\n\nUse it with /direct command followed by Link" 185 | await msg.edit(text=err) 186 | return 187 | elif any(x in url for x in directdl_list): 188 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Direct Link Generator\n\nUse it with /direct command followed by Link" 189 | await msg.edit(text=err) 190 | return 191 | elif any(x in url for x in linkvertise_list): 192 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Short Link Bypasser\n\nUse it with /bypass command followed by Link" 193 | await msg.edit(text=err) 194 | return 195 | elif any(x in url for x in bypass_list): 196 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Short Link Bypasser\n\nUse it with /bypass command followed by Link" 197 | await msg.edit(text=err) 198 | return 199 | elif any(x in url for x in adfly_list): 200 | err = f"Dear {uname} (ID: {uid}),\n\nThis Link is Supported by the Short Link Bypasser\n\nUse it with /bypass command followed by Link" 201 | await msg.edit(text=err) 202 | return 203 | else: 204 | await msg.delete() 205 | xyz = "This Command does not support this Link!" 206 | sleep(1) 207 | await message.reply_text(text=xyz, disable_web_page_preview=True, quote=True) 208 | -------------------------------------------------------------------------------- /bot/plugins/users/shortener.py: -------------------------------------------------------------------------------- 1 | from re import search 2 | from time import time 3 | 4 | from pyrogram import Client, filters 5 | from pyrogram.types import Message 6 | 7 | from bot.config import * 8 | from bot.helpers.decorators import user_commands 9 | from bot.helpers.functions import get_readable_time 10 | from bot.logging import LOGGER 11 | from bot.modules import shortener 12 | from bot.modules.regex import URL_REGEX, is_a_url 13 | 14 | prefixes = COMMAND_PREFIXES 15 | commands = ["shorten", f"shorten@{BOT_USERNAME}"] 16 | 17 | 18 | @Client.on_message(filters.command(commands, **prefixes)) 19 | @user_commands 20 | async def shorten(_, message: Message): 21 | """ 22 | Get AdFree Shortened URLs of your Link 23 | """ 24 | msg_arg = message.text.replace(" ", " ") 25 | msg_args = msg_arg.split(" ", maxsplit=1) 26 | reply_to = message.reply_to_message 27 | if len(msg_args) > 1: 28 | cmd = msg_args[0] 29 | url = msg_args[1] 30 | elif reply_to is not None: 31 | try: 32 | reply_text = search(URL_REGEX, reply_to.text)[0] 33 | except BaseException: 34 | reply_text = ( 35 | search(URL_REGEX, str(reply_to.caption))[0] 36 | .replace("\\", "") 37 | .split("*")[0] 38 | ) 39 | url = reply_text.strip() 40 | cmd = msg_args[0] 41 | elif msg_args.count == (0 or 1) or reply_to is None: 42 | return "Bot could not retrieve your Input!" 43 | 44 | if url is not None: 45 | if url.startswith("http://"): 46 | url = url.replace("http://", "https://") 47 | elif not url.startswith("https://"): 48 | url = "https://" + url 49 | else: 50 | return "Bot could not retrieve your URL!" 51 | 52 | valid_url = is_a_url(url) 53 | if valid_url is not True: 54 | return "You did not seem to have entered a valid URL!" 55 | uname = message.from_user.mention 56 | uid = f"{message.from_user.id}" 57 | start = time() 58 | LOGGER(__name__).info(f" Received : {cmd} - {url}") 59 | abc = f"Dear {uname} (ID: {uid}),\n\nBot has received the following link‌ :\n{url}" 60 | await message.reply_text(text=abc, disable_web_page_preview=True, quote=True) 61 | res1 = shortener.bitly(url) 62 | res2 = shortener.dagd(url) 63 | res3 = shortener.tinyurl(url) 64 | res4 = shortener.osdb(url) 65 | res5 = shortener.ttm(url) 66 | res6 = shortener.isgd(url) 67 | res7 = shortener.vgd(url) 68 | res8 = shortener.clickru(url) 69 | res9 = shortener.clilp(url) 70 | time_taken = get_readable_time(time() - start) 71 | LOGGER(__name__).info( 72 | f" Destination : {res1} | {res2} | {res3} | {res4} | {res5} | {res6} | {res7} | {res8} | {res9}" 73 | ) 74 | xyz = f"Shortened URLs :\n\n{res1}\n{res2}\n{res3}\n{res4}\n{res5}\n{res6}\n{res7}\n{res8}\n{res9}\n\nNOTE:\nAll the Shortened URLs redirect to the same URL as you entered and all of these links are Ad-Free.\n\nTime Taken : {time_taken}" 75 | await message.reply_text(text=xyz, disable_web_page_preview=True, quote=True) 76 | -------------------------------------------------------------------------------- /bot/plugins/users/start.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | from pyrogram import Client, filters 4 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup 5 | 6 | from bot import BotStartTime 7 | from bot.config import * 8 | from bot.helpers.decorators import user_commands 9 | from bot.helpers.functions import get_readable_time 10 | from bot.version import ( 11 | __bot_version__, 12 | __gitrepo__, 13 | __license__, 14 | __pyro_layer__, 15 | __pyro_version__, 16 | __python_version__, 17 | ) 18 | 19 | START_TEXT = """Hey there!!\nI am the Multi Function Bot.\nUse buttons to navigate and know more about me :) \n\n**Bot is alive since {}.**""" 20 | 21 | COMMAND_TEXT = """**Here are the list of commands wich you can use in bot.\n**""" 22 | 23 | ABOUT_TEXT = f"""• **Python Version** : {__python_version__} 24 | • **Bot Version** : {__bot_version__} 25 | • **Pyrogram Version** : {__pyro_version__} 26 | • **Pyrogram Layer** : {__pyro_layer__} 27 | • **License** : {__license__} 28 | 29 | **Github Repo**: {__gitrepo__}""" 30 | 31 | USER_TEXT = """🗒️ Documentation for commands available to user's 32 | 33 | • /start: To Get this message 34 | 35 | • /help: Alias command for start 36 | 37 | • /ping: Ping the telegram api server. 38 | 39 | • /bifm - Bypass Short Links using BIFM API 40 | 41 | • /direct - Get Direct Link for various Supported URLs 42 | 43 | • /bypass - Bypass Various Supported Shortened URLs 44 | 45 | • /multi - Bypass Short Links using PyBypass Library 46 | 47 | • /shorten - Get AdFree Shortened URLs of your Link 48 | 49 | • /magnet - Extract Magnet from Torrent Websites 50 | 51 | • /index - Extract Direct Links from Bhadoo Index Folder URLs 52 | 53 | • /scrape - Extract Direct Links from Supported Sites 54 | 55 | • /gd - Get GDrive Links for various Drive File Sharer 56 | """ 57 | 58 | SUDO_TEXT = """ 59 | 🗒️ Documentation for Sudo Users commands. 60 | 61 | • /speedtest: Check the internet speed of bot server. 62 | 63 | • /serverstats: Get the stats of server. 64 | 65 | • /stats: Alias command for serverstats 66 | """ 67 | 68 | DEV_TEXT = """ 69 | 🗒️ Documentation for Developers Commands. 70 | 71 | • /update: To update the bot to latest commit from repository. 72 | 73 | • /restart: Restart the bot. 74 | 75 | • /log: To get the log file of bot. 76 | 77 | • /ip: To get ip of the server where bot is running 78 | 79 | • /shell: To run the terminal commands via bot. 80 | 81 | • /exec: To run the python commands via bot 82 | """ 83 | 84 | START_BUTTON = [ 85 | [ 86 | InlineKeyboardButton("📖 Commands", callback_data="COMMAND_BUTTON"), 87 | InlineKeyboardButton("👨‍💻 About me", callback_data="ABOUT_BUTTON"), 88 | ], 89 | [ 90 | InlineKeyboardButton( 91 | "🔭 Original Repo", 92 | url=f"{__gitrepo__}", 93 | ) 94 | ], 95 | ] 96 | 97 | COMMAND_BUTTON = [ 98 | [ 99 | InlineKeyboardButton("Users", callback_data="USER_BUTTON"), 100 | InlineKeyboardButton("Sudo", callback_data="SUDO_BUTTON"), 101 | ], 102 | [InlineKeyboardButton("Developer", callback_data="DEV_BUTTON")], 103 | [InlineKeyboardButton("🔙 Go Back", callback_data="START_BUTTON")], 104 | ] 105 | 106 | GOBACK_1_BUTTON = [[InlineKeyboardButton("🔙 Go Back", callback_data="START_BUTTON")]] 107 | 108 | GOBACK_2_BUTTON = [[InlineKeyboardButton("🔙 Go Back", callback_data="COMMAND_BUTTON")]] 109 | 110 | prefixes = COMMAND_PREFIXES 111 | commands = ["start", f"start@{BOT_USERNAME}", "help", f"help@{BOT_USERNAME}"] 112 | 113 | 114 | @Client.on_message(filters.command(commands, **prefixes)) 115 | @user_commands 116 | async def start(client, message): 117 | botuptime = get_readable_time(time.time() - BotStartTime) 118 | await message.reply_text( 119 | text=START_TEXT.format(botuptime), 120 | disable_web_page_preview=True, 121 | reply_markup=InlineKeyboardMarkup(START_BUTTON), 122 | ) 123 | 124 | 125 | @Client.on_callback_query() 126 | async def botCallbacks(client, CallbackQuery): 127 | user_id = CallbackQuery.from_user.id 128 | 129 | if CallbackQuery.data == "ABOUT_BUTTON": 130 | await CallbackQuery.edit_message_text( 131 | ABOUT_TEXT, 132 | reply_markup=InlineKeyboardMarkup(GOBACK_1_BUTTON), 133 | disable_web_page_preview=True, 134 | ) 135 | 136 | elif CallbackQuery.data == "START_BUTTON": 137 | await CallbackQuery.edit_message_text( 138 | START_TEXT, reply_markup=InlineKeyboardMarkup(START_BUTTON) 139 | ) 140 | 141 | elif CallbackQuery.data == "COMMAND_BUTTON": 142 | await CallbackQuery.edit_message_text( 143 | COMMAND_TEXT, reply_markup=InlineKeyboardMarkup(COMMAND_BUTTON) 144 | ) 145 | 146 | elif CallbackQuery.data == "USER_BUTTON": 147 | await CallbackQuery.edit_message_text( 148 | USER_TEXT, reply_markup=InlineKeyboardMarkup(GOBACK_2_BUTTON) 149 | ) 150 | 151 | elif CallbackQuery.data == "SUDO_BUTTON": 152 | if user_id not in SUDO_USERS: 153 | return await CallbackQuery.answer( 154 | "You are not in the Bot sudo user list.", show_alert=True 155 | ) 156 | else: 157 | await CallbackQuery.edit_message_text( 158 | SUDO_TEXT, reply_markup=InlineKeyboardMarkup(GOBACK_2_BUTTON) 159 | ) 160 | 161 | elif CallbackQuery.data == "DEV_BUTTON": 162 | if user_id not in OWNER_ID: 163 | return await CallbackQuery.answer( 164 | "This is A developer restricted command.", show_alert=True 165 | ) 166 | else: 167 | await CallbackQuery.edit_message_text( 168 | DEV_TEXT, reply_markup=InlineKeyboardMarkup(GOBACK_2_BUTTON) 169 | ) 170 | -------------------------------------------------------------------------------- /bot/version.py: -------------------------------------------------------------------------------- 1 | from sys import version_info 2 | 3 | from pyrogram import __version__ as __pyrog_version__ 4 | from pyrogram.raw.all import layer 5 | 6 | """ 7 | https://github.com/UsergeTeam/Userge/blob/alpha/userge/versions.py 8 | """ 9 | 10 | __major__ = 2 11 | __minor__ = 0 12 | __micro__ = 0 13 | 14 | 15 | def get_version() -> str: 16 | return f"{__major__}.{__minor__}.{__micro__}" 17 | 18 | 19 | __pyrog_version__ = __pyrog_version__.replace("'", "").replace("{", "").replace("}", "") 20 | layer = str(layer) 21 | layer = layer.replace("'", "") 22 | 23 | __python_version__ = f"{version_info[0]}.{version_info[1]}.{version_info[2]}" 24 | __bot_version__ = get_version() 25 | __pyro_version__ = __pyrog_version__ 26 | __pyro_layer__ = layer 27 | __license__ = "[GNU Affero General Public License v3.0](https://github.com/missemily22/MultiFunctionBot/blob/main/LICENSE)" 28 | __gitrepo__ = "https://github.com/missemily22/MultiFunctionBot" 29 | -------------------------------------------------------------------------------- /captain-definition: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 2, 3 | "dockerfilePath": "./Dockerfile" 4 | } -------------------------------------------------------------------------------- /chromedriver: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pk3011/scrap/f98015223ada84dbe055aca0a9ea4293afd904b7/chromedriver -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | 3 | services: 4 | multibot: 5 | image: ghcr.io/missemily22/multifunctionbot:main 6 | container_name: multibot 7 | environment: 8 | - CONFIG_FILE_URL = ${CONFIG_FILE_URL} 9 | - API_ID = ${API_ID} 10 | - API_HASH = ${API_HASH} 11 | - BOT_TOKEN = ${BOT_TOKEN} 12 | - BOT_USERNAME = ${BOT_USERNAME} 13 | - BIFM_URL = ${BIFM_URL} 14 | - EMILY_API_URL = ${EMILY_API_URL} 15 | - UPTOBOX_TOKEN = ${UPTOBOX_TOKEN} 16 | - AUTH_USER = ${AUTH_USER} 17 | - MAX_MESSAGE_LENGTH = ${MAX_MESSAGE_LENGTH} 18 | - UNIFIED_EMAIL = ${UNIFIED_EMAIL} 19 | - UNIFIED_PASS = ${UNIFIED_PASS} 20 | - GDTOT_CRYPT = ${GDTOT_CRYPT} 21 | - HUBDRIVE_CRYPT = ${HUBDRIVE_CRYPT} 22 | - KATDRIVE_CRYPT = ${KATDRIVE_CRYPT} 23 | - KOLOP_CRYPT = ${KOLOP_CRYPT} 24 | - DRIVEFIRE_CRYPT = ${DRIVEFIRE_CRYPT} 25 | - DRIVEBUZZ_CRYPT = ${DRIVEBUZZ_CRYPT} 26 | - GADRIVE_CRYPT = ${GADRIVE_CRYPT} 27 | - JIODRIVE_CRYPT = ${JIODRIVE_CRYPT} 28 | - Sharerpw_XSRF = ${Sharerpw_XSRF} 29 | - Sharerpw_laravel = ${Sharerpw_laravel} 30 | ports: 31 | - 8080:8080 32 | restart: unless-stopped -------------------------------------------------------------------------------- /fly.toml: -------------------------------------------------------------------------------- 1 | 2 | # Set app name below, replace APP-NAME 3 | 4 | app = "APP-NAME" 5 | kill_signal = "SIGINT" 6 | kill_timeout = 5 7 | processes = [] 8 | 9 | [env] 10 | API_ID = 0 11 | API_HASH = "" 12 | BOT_TOKEN = "" 13 | BOT_USERNAME = "" 14 | COMMAND_PREFIXES = "! . /" # Add values seperated by space 15 | OWNER_ID = "5074446688 1691209696" # Add values seperated by space 16 | SUDO_USERS = "5074446688 1691209696" # Add values seperated by space 17 | BIFM_URL = "https://bifm.tacohitbox.com/api/bypass?url" 18 | EMILY_API_URL = "https://api.emilyx.in/api https://emilyapi.fly.dev/api https://emily-api.fly.dev/api" # Add values seperated by space 19 | UPTOBOX_TOKEN = "" 20 | MAX_MESSAGE_LENGTH = 4096 21 | UPSTREAM_REPO = "https://github.com/missemily22/MultiFunctionBot.git" 22 | UNIFIED_EMAIL = "" 23 | UNIFIED_PASS = "" 24 | GDTOT_CRYPT = "" 25 | HUBDRIVE_CRYPT = "" 26 | KATDRIVE_CRYPT = "" 27 | KOLOP_CRYPT = "" 28 | DRIVEFIRE_CRYPT = "" 29 | DRIVEBUZZ_CRYPT = "" 30 | DRIVEHUB_CRYPT = "" 31 | GADRIVE_CRYPT = "" 32 | JIODRIVE_CRYPT = "" 33 | Sharerpw_XSRF = "" 34 | Sharerpw_laravel = "" 35 | 36 | # No need to touch below 37 | 38 | [experimental] 39 | allowed_public_ports = [] 40 | auto_rollback = true 41 | 42 | [[services]] 43 | http_checks = [] 44 | internal_port = 8080 45 | processes = ["app"] 46 | protocol = "tcp" 47 | script_checks = [] 48 | [services.concurrency] 49 | hard_limit = 25 50 | soft_limit = 20 51 | type = "connections" 52 | 53 | [[services.ports]] 54 | force_https = true 55 | handlers = ["http"] 56 | port = 80 57 | 58 | [[services.ports]] 59 | handlers = ["tls", "http"] 60 | port = 443 61 | 62 | [[services.tcp_checks]] 63 | grace_period = "1s" 64 | interval = "15s" 65 | restart_limit = 0 66 | timeout = "2s" -------------------------------------------------------------------------------- /heroku.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | web: Dockerfile 4 | run: 5 | web: bash start.sh -------------------------------------------------------------------------------- /okteto-stack.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | multi-bot: 3 | public: true 4 | build: . 5 | resources: 6 | requests: 7 | cpu: 500m 8 | memory: 1000Mi 9 | limits: 10 | cpu: 1000m 11 | memory: 2000Mi -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | beautifulsoup4 2 | bs4 3 | chromedriver_autoinstaller 4 | cloudscraper 5 | colorama 6 | flask 7 | flask_restful 8 | lk21 9 | lxml 10 | psutil 11 | PyBypass 12 | pyrogram 13 | python-dotenv 14 | python-telegram-bot 15 | requests 16 | selenium 17 | speedtest-cli 18 | telegraph 19 | tgcrypto 20 | urllib3 -------------------------------------------------------------------------------- /sample_config.env: -------------------------------------------------------------------------------- 1 | # Necessary 2 | API_ID = 0 3 | API_HASH = "" 4 | BOT_TOKEN = "" 5 | BOT_USERNAME = "" 6 | COMMAND_PREFIXES = "! . /" # Add values seperated by space 7 | OWNER_ID = "5074446688 1691209696" # Add values seperated by space 8 | SUDO_USERS = "5074446688 1691209696" # Add values seperated by space 9 | 10 | 11 | # Miscellaneous 12 | BIFM_URL = "https://bifm.tacohitbox.com/api/bypass?url" 13 | EMILY_API_URL = "https://api.emilyx.in/api https://emilyapi.fly.dev/api https://emily-api.fly.dev/api" # Add values seperated by space 14 | UPTOBOX_TOKEN = "" 15 | MAX_MESSAGE_LENGTH = 4096 16 | UPSTREAM_REPO = "https://github.com/missemily22/MultiFunctionBot.git" 17 | 18 | 19 | 20 | # AppDrive LookAlike Credentials 21 | UNIFIED_EMAIL = "" 22 | UNIFIED_PASS = "" 23 | 24 | 25 | # Site Crypts 26 | GDTOT_CRYPT = "" 27 | HUBDRIVE_CRYPT = "" 28 | KATDRIVE_CRYPT = "" 29 | KOLOP_CRYPT = "" 30 | DRIVEFIRE_CRYPT = "" 31 | DRIVEBUZZ_CRYPT = "" 32 | DRIVEHUB_CRYPT = "" 33 | GADRIVE_CRYPT = "" 34 | JIODRIVE_CRYPT = "" 35 | 36 | 37 | # Sharer Cookies 38 | Sharerpw_XSRF = "" 39 | Sharerpw_laravel = "" -------------------------------------------------------------------------------- /server.py: -------------------------------------------------------------------------------- 1 | import os 2 | from flask import Flask 3 | from flask_restful import Resource, Api 4 | 5 | app = Flask(__name__) 6 | api = Api(app) 7 | 8 | class Greeting (Resource): 9 | def get(self): 10 | return "Bypass Bot is Up & Running!" 11 | 12 | api.add_resource(Greeting, '/') 13 | app.run(host="0.0.0.0", port=os.environ.get("PORT", 8080)) -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | python3 server.py & python3 -m bot --------------------------------------------------------------------------------