diff --git a/README.md b/README.md
index 4aff81d2ff5..4fc75d201d8 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,6 @@
# Features supported:
## Additional Features
-- Mirroring Uptobox.com links to Google Drive (Uptobox account must be premium)
- Get detailed info about replied media
- Nyaa.si and Sukebei Torrent search
- Speedtest with picture results
@@ -27,15 +26,19 @@
- Check Heroku dynos stats
- Custom image support
- Counting file/folder
-- Racaty.net support
- Shell and Executor
- Stickers module
-
+- Direct links supported:
+```
+Racaty, Hxfile, Anonfiles,
+Fembed (femax20 & layarkacaxxi), Onedrive (Only works for file not folder)
+```
## From Original Repos
- Mirroring direct download links, Torrent, and Telegram files to Google Drive
- Mirroring Mega.nz links to Google Drive (If your Mega account not premium, it will limit 4-5gb/day)
+- Mirroring Uptobox.com links to Google Drive (Uptobox account must be premium)
- Copy files from someone's Drive to your Drive (Using Autorclone)
-- Download/upload progress, speeds and ETAs
+- Download/Upload progress, Speeds and ETAs
- Mirror all Youtube-dl supported links
- Docker support
- Uploading to Team Drive
@@ -43,8 +46,8 @@
- Service Account support
- Delete files from Drive
- Shortener support
-- Custom Filename (Only for url, Telegram files and Youtube-dl. Not for Mega links and Magnet/Torrents)
-- Extracting password protected files, using custom filename and download from password protected index links see these examples:
+- Custom Filename (Only for URL, Telegram files and Youtube-dl. Not for Mega links and Magnet/Torrents)
+- Extracting password protected files, using custom filename and download from password protected Index Links see these examples:
- Extract these filetypes and uploads to Google Drive
@@ -207,11 +210,13 @@ Many thanks to [AutoRClone](https://github.com/xyou365/AutoRclone) for the scrip
**NOTE**: Using Service Accounts is only recommended while uploading to a Team Drive.
## Generate Service Accounts. [What is Service Account](https://cloud.google.com/iam/docs/service-accounts)
+
+ Click here for more details
Let us create only the Service Accounts that we need.
**Warning**: abuse of this feature is not the aim of this project and we do **NOT** recommend that you make a lot of projects, just one project and 100 SAs allow you plenty of use, its also possible that over abuse might get your projects banned by Google.
-`Note: 1 Service Account can copy around 750gb a day, 1 project can make 100 Service Accounts so that's 75tb a day, for most users this should easily suffice. `
+**NOTE:** 1 Service Account can copy around 750gb a day, 1 project can make 100 Service Accounts so that's 75tb a day, for most users this should easily suffice.
```
python3 gen_sa_accounts.py --quick-setup 1 --new-only
```
@@ -256,6 +261,8 @@ Then add emails from emails.txt to Google Group, after that add Google Group to
python3 gen_sa_accounts.py --download-keys project_id
```
+
+
## Add all the Service Accounts to the Team Drive
- Run:
```
@@ -263,7 +270,7 @@ python3 add_to_team_drive.py -d SharedTeamDriveSrcID
```
# Youtube-dl authentication using .netrc file
-For using your premium accounts in Youtube-dl or for protected index links, edit the netrc file according to following format:
+For using your premium accounts in Youtube-dl or for protected Index Links, edit the netrc file according to following format:
```
machine host login username password my_youtube_password
```
diff --git a/aria.sh b/aria.sh
index 094d90845d4..9afb653c71b 100755
--- a/aria.sh
+++ b/aria.sh
@@ -1,5 +1,5 @@
export MAX_DOWNLOAD_SPEED=0
-tracker_list=$(curl -Ns https://raw.githubusercontent.com/XIU2/TrackersListCollection/master/all.txt --next https://ngosang.github.io/trackerslist/trackers_all_http.txt --next https://newtrackon.com/api/all --next https://raw.githubusercontent.com/DeSireFire/animeTrackerList/master/AT_all.txt | awk '$1' | tr '\n\n' ',')
+tracker_list=$(curl -Ns https://raw.githubusercontent.com/XIU2/TrackersListCollection/master/all.txt --next https://ngosang.github.io/trackerslist/trackers_all_http.txt --next https://newtrackon.com/api/all --next https://raw.githubusercontent.com/DeSireFire/animeTrackerList/master/AT_all.txt --next https://raw.githubusercontent.com/hezhijie0327/Trackerslist/main/trackerslist_tracker.txt --next https://raw.githubusercontent.com/hezhijie0327/Trackerslist/main/trackerslist_exclude.txt | awk '$1' | tr '\n\n' ',')
export MAX_CONCURRENT_DOWNLOADS=7
aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --check-certificate=false \
diff --git a/bot/helper/mirror_utils/download_utils/direct_link_generator.py b/bot/helper/mirror_utils/download_utils/direct_link_generator.py
index 9917f112b35..ed66ac0b06c 100644
--- a/bot/helper/mirror_utils/download_utils/direct_link_generator.py
+++ b/bot/helper/mirror_utils/download_utils/direct_link_generator.py
@@ -16,10 +16,14 @@
import urllib.parse
from os import popen
from random import choice
+from urllib.parse import urlparse
+import lk21
import requests
from bs4 import BeautifulSoup
from js2py import EvalJs
+from lk21.extractors.bypasser import Bypass
+from base64 import standard_b64encode
from bot.helper.ext_utils.exceptions import DirectDownloadLinkException
@@ -44,9 +48,20 @@ def direct_link_generator(link: str):
return github(link)
elif 'racaty.net' in link:
return racaty(link)
+ elif 'hxfile.co' in link:
+ return hxfile(link)
+ elif 'anonfiles.com' in link:
+ return anon(link)
+ elif 'femax20.com' in link:
+ return femax20(link)
+ elif 'layarkacaxxi.icu' in link:
+ return layarkacaxxi(link)
+ elif '1drv.ms' in link:
+ return onedrive(link)
else:
raise DirectDownloadLinkException(f'No Direct link function found for {link}')
+
def zippy_share(url: str) -> str:
link = re.findall("https:/.(.*?).zippyshare", url)[0]
response_content = (requests.get(url)).content
@@ -74,7 +89,7 @@ def zippy_share(url: str) -> str:
def yandex_disk(url: str) -> str:
""" Yandex.Disk direct links generator
- Based on https://github.com/wldhx/yadisk-direct"""
+ Based on https://github.com/wldhx/yadisk-direct """
try:
link = re.findall(r'\bhttps?://.*yadi\.sk\S+', url)[0]
except IndexError:
@@ -85,12 +100,12 @@ def yandex_disk(url: str) -> str:
dl_url = requests.get(api.format(link)).json()['href']
return dl_url
except KeyError:
- raise DirectDownloadLinkException("`Error: File not found / Download limit reached`\n")
+ raise DirectDownloadLinkException("`Error: File not found/Download limit reached`\n")
def cm_ru(url: str) -> str:
""" cloud.mail.ru direct links generator
- Using https://github.com/JrMasterModelBuilder/cmrudl.py"""
+ Using https://github.com/JrMasterModelBuilder/cmrudl.py """
reply = ''
try:
link = re.findall(r'\bhttps?://.*cloud\.mail\.ru\S+', url)[0]
@@ -106,6 +121,7 @@ def cm_ru(url: str) -> str:
dl_url = data['download']
return dl_url
+
def uptobox(url: str) -> str:
""" Uptobox direct links generator
based on https://github.com/jovanzers/WinTenCermin """
@@ -176,6 +192,8 @@ def github(url: str) -> str:
def racaty(url: str) -> str:
+ """ Racaty direct links generator
+ based on https://github.com/breakdowns/slam-mirrorbot """
dl_url = ''
try:
link = re.findall(r'\bhttps?://.*racaty\.net\S+', url)[0]
@@ -191,6 +209,81 @@ def racaty(url: str) -> str:
return dl_url
+def hxfile(url: str) -> str:
+ """ Hxfile direct links generator
+ based on https://github.com/breakdowns/slam-mirrorbot """
+ dl_url = ''
+ try:
+ link = re.findall(r'\bhttps?://.*hxfile\.co\S+', url)[0]
+ except IndexError:
+ raise DirectDownloadLinkException("`No Hxfile links found`\n")
+ bypasser = lk21.Bypass()
+ dl_url=bypasser.bypass_url(link)
+ return dl_url
+
+
+def anon(url: str) -> str:
+ """ Anonfiles direct links generator
+ based on https://github.com/breakdowns/slam-mirrorbot """
+ dl_url = ''
+ try:
+ link = re.findall(r'\bhttps?://.*anonfiles\.com\S+', url)[0]
+ except IndexError:
+ raise DirectDownloadLinkException("`No Anonfiles links found`\n")
+ bypasser = lk21.Bypass()
+ dl_url=bypasser.bypass_url(link)
+ return dl_url
+
+
+def femax20(url: str) -> str:
+ """ Fembed direct links generator
+ based on https://github.com/breakdowns/slam-mirrorbot """
+ dl_url = ''
+ try:
+ link = re.findall(r'\bhttps?://.*femax20\.com\S+', url)[0]
+ except IndexError:
+ raise DirectDownloadLinkException("`No Fembed links found`\n")
+ bypasser = lk21.Bypass()
+ dl_url=bypasser.bypass_fembed(link)
+ lst_link = []
+ count = len(dl_url)
+ for i in dl_url:
+ lst_link.append(dl_url[i])
+ return lst_link[count-1]
+
+
+def layarkacaxxi(url: str) -> str:
+ """ Fembed direct links generator
+ based on https://github.com/breakdowns/slam-mirrorbot """
+ dl_url = ''
+ try:
+ link = re.findall(r'\bhttps?://.*layarkacaxxi\.icu\S+', url)[0]
+ except IndexError:
+ raise DirectDownloadLinkException("No Fembed links found\n")
+ bypasser = lk21.Bypass()
+ dl_url=bypasser.bypass_fembed(link)
+ lst_link = []
+ count = len(dl_url)
+ for i in dl_url:
+ lst_link.append(dl_url[i])
+ return lst_link[count-1]
+
+
+def onedrive(link: str) -> str:
+ """ Onedrive direct link generator
+ Based on https://github.com/UsergeTeam/Userge """
+ link_without_query = urlparse(link)._replace(query=None).geturl()
+ direct_link_encoded = str(standard_b64encode(bytes(link_without_query, "utf-8")), "utf-8")
+ direct_link1 = f"https://api.onedrive.com/v1.0/shares/u!{direct_link_encoded}/root/content"
+ resp = requests.head(direct_link1)
+ if resp.status_code != 302:
+ return "`Error: Unauthorized link, the link may be private`"
+ dl_link = resp.next.url
+ file_name = dl_link.rsplit("/", 1)[1]
+ resp2 = requests.head(dl_link)
+ return dl_link
+
+
def useragent():
"""
useragent random setter
diff --git a/bot/modules/mirror.py b/bot/modules/mirror.py
index a5442056ea2..606ab0a9109 100644
--- a/bot/modules/mirror.py
+++ b/bot/modules/mirror.py
@@ -161,11 +161,11 @@ def onUploadComplete(self, link: str, size, files, folders, typ):
share_url = f'{INDEX_URL}/{url_path}'
if os.path.isdir(f'{DOWNLOAD_DIR}/{self.uid}/{download_dict[self.uid].name()}'):
share_url += '/'
- msg += "\n\nType: Folder"
- msg += f"\nSubFolders: {folders}"
- msg += f"\nFiles: {files}"
+ msg += '\n\nType: Folder'
+ msg += f'\nSubFolders: {folders}'
+ msg += f'\nFiles: {files}'
else:
- msg += f"\n\nType: {typ}"
+ msg += f'\n\nType: {typ}'
if SHORTENER is not None and SHORTENER_API is not None:
siurl = requests.get('https://{}/api?api={}&url={}&format=text'.format(SHORTENER, SHORTENER_API, share_url)).text
buttons.buildbutton("⚡Index Link⚡", siurl)
diff --git a/requirements.txt b/requirements.txt
index 76e38711a2b..a23616064b4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -10,12 +10,14 @@ google-auth-oauthlib
heroku3
html-telegraph-poster
js2py
+lk21
lxml
messages
natsort
Pillow
psutil
psycopg2-binary
+pybase64
pyrogram
python-dotenv
python-magic