Skip to content

Commit

Permalink
v1.2.1-x 🎓 Exquisite & Effective
Browse files Browse the repository at this point in the history
What's Changed ?

* Fixed 1 String Session with Multiple Bots (By Mehedi Hasan Shojib)
* Added Topics by /a chat_id:topic_id
> Multiple Same Chat Topic can't be used as Leech Log
* Sync with Base Repo
* Added Progress & Cancel for DDL
* DDL : gofile.io & streamtape.com (Files & Folders)
* Added Index Folder M/L (Bhadoo >=V2.3.5)
* Fixed Gofile %xx Filename rendering
* Add Real Debrid Magnet Cache (No VPN)
* Fixed Bot Stats & UserTD Enable Error
* Modified SAFE_MODE (Name Hide after sometime & Source Link Disabled from Grp & Indexing Also)
* Add Debrid-Link Support !
* Add New Paste Service : SpaceBin
* Fixed Extra button Groups
* Fixed Async Executors 
* Changed Logging (According to Karan's V5 Design)
* Added Documentations for few
* Added -ss or Screenshots for Leech Files (Attach Button)
---------
* Multiple Thumbs, SV, Tg Stream, WEB, DL Index Link, Coming Soon...
---------

Thanks ! That's All !
~ MysterySD & Karan

---------

Co-authored-by: Karan Adhikari <[email protected]>
  • Loading branch information
SilentDemonSD and weebzone authored Sep 14, 2023
1 parent 6d7445a commit d043219
Show file tree
Hide file tree
Showing 55 changed files with 2,511 additions and 1,194 deletions.
88 changes: 64 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@
- Download using premium account if available
- Download restricted messages (document or link) by tg private/public/super links

</details></li>
<li><details>
<summary><b>DDL Upload</b></summary>

- Upload Files/Folder in the Supported Sites
- Gofile.io
- Streamtape.com
- Upload on multiple sites at a time
- User api/key is need for the upload
</details></li>
<li><details>
<summary><b>Google Drive</b></summary>
Expand Down Expand Up @@ -118,6 +127,7 @@
- Torrent search support
- Search on torrents with Torrent Search API
- Search on torrents with variable plugins using qBittorrent search engine
- Cached Magnet support for real-derbid api

</details></li>
<li><details>
Expand Down Expand Up @@ -196,7 +206,7 @@
- Extract these filetypes
> ZIP, RAR, TAR, 7z, ISO, WIM, CAB, GZIP, BZIP2, APM, ARJ, CHM, CPIO, CramFS, DEB, DMG, FAT, HFS, LZH, LZMA, LZMA2, MBR, MSI, MSLZ, NSIS, NTFS, RPM, SquashFS, UDF, VHD, XAR, Z, TAR.XZ
- Direct links Supported:
> mediafire, letsupload.io, hxfile.co, antfiles, fembed.com, fembed.net, femax20.com, layarkacaxxi.icu, fcdn.stream, sbplay.org, naniplay.com, naniplay.nanime.in, naniplay.nanime.biz, sbembed.com, streamtape.com, streamsb.net, feurl.com, upload.ee, pixeldrain.com, racaty.net, 1fichier.com, 1drv.ms (Only works for file not folder or business account), uptobox.com and solidfiles.com, linkbox.to, shrdsk.me (sharedisk.io), akmfiles.com, wetransfer.com, mdisk.me (with ytdl), terabox.com (you need to add cookies txt with name) [terabox.txt](https://github.com/ytdl-org/youtube-dl#how-do-i-pass-cookies-to-youtube-dl) and almost every anonfiles based sites
> mediafire(folder), letsupload.io, hxfile.co, antfiles, fembed.com, fembed.net, femax20.com, layarkacaxxi.icu, fcdn.stream, sbplay.org, naniplay.com, naniplay.nanime.in, naniplay.nanime.biz, sbembed.com, streamtape.com, streamsb.net, feurl.com, upload.ee, pixeldrain.com, racaty.net, 1fichier.com, 1drv.ms (Only works for file not folder or business account), uptobox.com and solidfiles.com, linkbox.to, shrdsk.me (sharedisk.io), akmfiles.com, wetransfer.com, mdisk.me (with ytdl), gofile.io(folder), filelion, terabox.com (you need to add cookies txt with name) [terabox.txt](https://github.com/ytdl-org/youtube-dl#how-do-i-pass-cookies-to-youtube-dl) and almost every anonfiles based sites
</details>

Expand Down Expand Up @@ -432,34 +442,45 @@ help - All cmds with description
- `CMD_SUFFIX`: commands index number. This number will added at the end all commands. `Str`|`Int`
- `AUTHORIZED_CHATS`: Fill user_id and chat_id of groups/users you want to authorize. Separate them by space. `Int`
- `SUDO_USERS`: Fill user_id of users whom you want to give sudo permission. Separate them by space. `Int`
- `BLACKLIST_USERS` : Fill user_id of users you wish to prohibit from using the bot. Separate them by space. `Int`
- `STATUS_LIMIT`: Limit the no. of tasks shown in status message with buttons. Default is `10`. **NOTE**: Recommended limit is `4` tasks. `Int`
- `DEFAULT_UPLOAD`: Whether `rc` to upload to `RCLONE_PATH` or `gd` to upload to `GDRIVE_ID` or `ddl` to upload to `DDL`. Default is `gd`. Read More [HERE](https://github.com/weebzone/WZML-X/tree/master#upload).`Str`
- `STATUS_UPDATE_INTERVAL`: Time in seconds after which the progress/status message will be updated. Recommended `10` seconds at least. `Int`
- `AUTO_DELETE_MESSAGE_DURATION`: Interval of time (in seconds), after which the bot deletes it's message and command message which is expected to be viewed instantly. **NOTE**: Set to `-1` to disable auto message deletion. `Int`
- `STATUS_LIMIT`: Limit the no. of tasks shown in status message with buttons. Default is `10`. **NOTE**: Recommended limit is `4` tasks. `Int`
- `EXTENSION_FILTER`: File extensions that won't upload/clone. Separate them by space. `Str`
- `INCOMPLETE_TASK_NOTIFIER`: Get incomplete task messages after restart. Require database and superGroup. Default is `False`. `Bool`
- `UPTOBOX_TOKEN`: Uptobox token to mirror uptobox links. Get it from [Uptobox Premium Account](https://uptobox.com/my_account). `str`
- `SET_COMMANDS`: Automatically set the Bot Commands no need to set from `@botfather`. Default is `False`. `Bool`
- `EXTENSION_FILTER`: File extensions that won't upload/clone. Separate them by space. No need to add `.` `Str`
- `YT_DLP_OPTIONS`: Default yt-dlp options. Check all possible options [HERE](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/YoutubeDL.py#L184) or use this [script](https://t.me/mltb_official/177) to convert cli arguments to api options. Format: key:value|key:value|key:value. Add `^` before integer or float, some numbers must be numeric and some string. `str`
- Example: "format:bv*+mergeall[vcodec=none]|nocheckcertificate:True"
- `USE_SERVICE_ACCOUNTS`: Whether to use Service Accounts or not, with google-api-python-client. For this to work see [Using Service Accounts](https://github.com/weebzone/WZML-X#generate-service-accounts-what-is-service-account) section below. Default is `False`. `Bool`
- `SAVE_MSG`: Save Button in each file and link so that every user direcly save it without forwarding. Default is `False`. `Bool`
- `SET_COMMANDS`: Automatically set the Bot Commands no need to set from `@botfather`. Default is `False`. `Bool`
- `FSUB_IDS`: Fill chat_id(-100xxxxxx) of groups/channel you want to force subscribe. Separate them by space. Int
- Note: Bot should be added in the filled chat_id as admin
- `BOT_PM`: File/links send to the BOT PM. Default is `False`. `Bool`
- `BOT_MAX_TASKS`: Limit the Maximum task for bots of group at a time. `Int`

</details></li>
<li><details>
<summary><b>GDrive Tools</b></summary>

- `GDRIVE_ID`: This is the Folder/TeamDrive ID of the Google Drive OR `root` to which you want to upload all the mirrors using google-api-python-client. `Str`
- `IS_TEAM_DRIVE`: Set `True` if uploading to TeamDrive using google-api-python-client. Default is `False`. `Bool`
- `USER_TD_MODE`: Enable the User-TD feature i.e user can upload file into their own drive. Default is `False`. `Bool`
- `USER_TD_SA`: Show your SA account in the usetting so that user can add that in its own TD to enable uploading Using SA. SA will be an email/group_email like `[email protected]`
- `INDEX_URL`: Refer to <https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index>. `Str`
- `USE_SERVICE_ACCOUNTS`: Whether to use Service Accounts or not, with google-api-python-client. For this to work see [Using Service Accounts](https://github.com/weebzone/WZML-X#generate-service-accounts-what-is-service-account) section below. Default is `False`. `Bool`
- `IS_TEAM_DRIVE`: Set `True` if uploading to TeamDrive using google-api-python-client. Default is `False`. `Bool`
- `STOP_DUPLICATE`: Bot will check file/folder name in Drive incase uploading to `GDRIVE_ID`. If it's present in Drive then downloading or cloning will be stopped. (**NOTE**: Item will be checked using name and not hash, so this feature is not perfect yet). Default is `False`. `Bool`
- `DISABLE_DRIVE_LINK`: Disable drive link button. Default is `False`. `Bool`
- `GD_INFO`: Description of file/folder uploaded to Google Drive.

</details></li>
<li><details>
<summary><b>API's/Cookies</b></summary>

- `REAL_DEBRID_API`: Api of `real-debrid.com`. Support the Premium `Bypass Download limit` and support the `Cached Magnets`.
- `DEBRID_LINK_API` : Api of `debrid-link.com`. Support the Premium `Bypass Download limit`.
- `FILELION_API`: Api of `filelions.com` to download the link from the filelion site
- `GDTOT_CRYPT`: Use Gdtot crpyt to bypass the GDTOT links.
- `UPTOBOX_TOKEN`: Uptobox token to mirror uptobox links. Get it from [Uptobox Premium Account](https://uptobox.com/my_account). `str`
</details></li>

<li><details>
<summary><b>RClone</b></summary>

Expand Down Expand Up @@ -496,13 +517,15 @@ help - All cmds with description

</details></li>
<li><details>
<summary><b>Log Channel</b></summary>
<summary><b>Log Channel/superGroup(Support topics)</b></summary>

- `LEECH_LOG_ID`: Chat ID to where leeched files would be uploaded. `Int`. **NOTE**: Only available for superGroup/channel. Add `-100` before channel/superGroup id. In short don't add bot id or your id!
- `MIRROR_LOG_ID`: Chat ID to where Mirror files would be Send. `Int`. **NOTE**: Only available for superGroup/channel. Add `-100` before channel/superGroup id. In short don't add bot id or your id!.
- `LEECH_LOG_ID`: Chat ID to where leeched files would be uploaded. `Int`. **NOTE**: Only available for superGroup/channel. Add `-100` before channel/superGroup id. In short don't add bot id or your id!. For topic support make this format `chat_id:topic_id`
- `MIRROR_LOG_ID`: Chat ID to where Mirror files would be Send. `Int`. **NOTE**: Only available for superGroup/channel. Add `-100` before channel/superGroup id. In short don't add bot id or your id!. For topic support make this format `chat_id:topic_id`
- `LINKS_LOG_ID`: Chat ID to where Link logs would be Send. `Int`. **NOTE**: Only available for superGroup/channel. Add `-100` before channel/superGroup id. In short don't add bot id or your id!.
- **Note**: LEECH_LOG_ID & MIRROR_LOG_ID it's multiple, For multiple id Separate them by space.
- **Note**: LEECH_LOG_ID & MIRROR_LOG_ID it's multiple, For multiple id Separate them by space.
- **Warning**: leech log is multiple only in case of channel. i.e it doesn't support multiple Topics (for now)
</details></li>

<li><details>
<summary><b>qBittorrent/Aria2c</b></summary>

Expand Down Expand Up @@ -543,6 +566,7 @@ help - All cmds with description
- `DAILY_MIRROR_LIMIT`: Total size upto which user can Mirror in one day. the default unit is `GB`. `Int`
- `DAILY_LEECH_LIMIT`: Total size upto which user can Leech in one day. the default unit is `GB`. `Int`
- `USER_MAX_TASKS`: Limit the Maximum task for users of group at a time. `Int`
- `BOT_MAX_TASKS`: Limit the Maximum task for bots of group at a time. `Int`
- `TORRENT_LIMIT`: To limit the size of torrent download. the default unit is `GB`. `Int`
- `DIRECT_LIMIT`: To limit the size of direct link download. the default unit is `GB`. `Int`
- `GDRIVE_LIMIT`: To limit the size of Google Drive folder/file link for leech, Zip, Unzip. the default unit is `GB`. `Int`
Expand All @@ -552,12 +576,15 @@ help - All cmds with description
- `LEECH_LIMIT`: To limit the Torrent/Direct/ytdlp leech size. the default unit is `GB`. `Int`
- `MEGA_LIMIT`: To limit the size of Mega download. the default unit is `GB`. `Int`
- `STORAGE_THRESHOLD`: To leave specific storage free and any download will lead to leave free storage less than this value will be cancelled the default unit is `GB`. `Int`
- `USER_TIME_INTERVAL`: Time Gap between two consecutive link/file mirror/leech operations. The default value is set to `0` seconds. unit is `sec`. `int`
</details></li>

<li><details>
<summary><b>Templates</b></summary>

- `ANIME_TEMPLATE`: Set template for anime...
- `IMDB_TEMPLATE`: Set your imdb template...
- `MDL_TEMPLATE`: Set your MyDramaList template...
</details></li>

<li><details>
Expand All @@ -566,24 +593,36 @@ help - All cmds with description
- `TITLE_NAME`: Title `name` for Telegraph pages (while using /list command)
- `AUTHOR_NAME`: Author `name` for Telegraph pages
- `AUTHOR_URL`: Author `URL` for Telegraph page
- `COVER_IMAGE`: telegraph header image. use `graph.org` link of image
</details></li>


<li><details>
<summary><b>Extra</b></summary>
- `SAFE_MODE`: Remove all file names. Not from BOT_PM & LINK_LOGS. Default is `False`. `Bool`
- `SAFE_MODE`: Include
- Remove filename from the auth group
- Remove Leech file index link from auth group (leech index directly send to BOT_PM)
- Remove Mirror link from auth group (Link directly send to BOT_PM)
- **NOTE**: `BOT_PM` Should be `True` to get the Links in PM while `SAFE_MODE` is `True`
- `DELETE_LINKS`: Delete links after used. Default is `False`. `Bool`
- `CLEAN_LOG_MSG`: Clean log msg. Default is `False`. `Bool`
- `CLEAN_LOG_MSG`: Clean log messages i.e remove the LEECH started msg from the leech log. Default is `False`. `Bool`
- `SHOW_EXTRA_CMDS`: Add old cmds like zipleech... Default is `False`. `Bool`
- `SOURCE_LINK`: Source button of files and links. Default is `False`. `Bool`
- `TIMEZONE`: Set timezone for the bot. Checkout the [list](https://gist.github.com/heyalexej/8bf688fd67d7199be4a1682b3eec7568) to get the proper timezone. Default is `Asia/Kolkata`.
- `IMAGES`: Add multiple telgraph(graph.org) image links that are seperated by spaces.
- `IMG_SEARCH`: Put Keyword to Download Images. Sperarte each name by , like `anime`, `iron man`, `god of war`
- `IMG_PAGE`: Set the page value for downloading a image. Each page have approx 70 images. Deafult is `1`. `Int`
- `BOT_THEME`: Change the theme of bot. For now theme availabe is `minimal`.
- You can make your own theme checkout this link https://t.ly/9rVXq
</details></li>

- `EXCEP_CHATS`: `CHAT_ID` of a `SuperGroup` where you want to disable the logging feature for that specific group. Logging features will remain active in other authorized chats that have been filled. Add `-100` before superGroup id. In short don't add bot id or your id!.

<li><details>
<summary><b>M/L Buttons</b></summary>

- `SHOW_MEDIAINFO`: Mediainfo button of file. Default is `False`. `Bool`
- `SAVE_MSG`: Save Button in each file and link so that every user direcly save it without forwarding. Default is `False`. `Bool`
- `SOURCE_LINK`: Source button of files and links. Default is `False`. `Bool`
</details></li>

<li><details>
<summary><b>Token system</b></summary>
Expand Down Expand Up @@ -940,13 +979,14 @@ Where host is the name of extractor (eg. instagram, Twitch). Multiple accounts o

-----

### 🏅 ***Bot Authors***
## 🏅 **Bot Authors**
<details>
<summary><b>Click Here For Description</b></summary>

|![](https://avatars.githubusercontent.com/u/105407900)|![](https://avatars.githubusercontent.com/u/113664541)|![](https://avatars.githubusercontent.com/u/84721324)|![](https://avatars.githubusercontent.com/u/77075674)|
|:---:|:---:|:---:|:---:|
|[`SilentDemonSD`](https://github.com/SilentDemonSD)|[`CodeWithWeeb`](https://github.com/weebzone)|[`Maverick`](https://github.com/MajnuRangeela)|[`Anasty17`](https://github.com/anasty17)|
|Author and DDL, UI Design, More Customs..|Author and Wraps Up Features|Co-Author & Bug Tester|Base Repo: MLTB|
|<img width="80" src="https://avatars.githubusercontent.com/u/105407900">|<img width="80" src="https://avatars.githubusercontent.com/u/113664541">|<img width="80" src="https://avatars.githubusercontent.com/u/84721324">|
|:---:|:---:|:---:|
|[`SilentDemonSD`](https://github.com/SilentDemonSD)|[`CodeWithWeeb`](https://github.com/weebzone)|[`Maverick`](https://github.com/MajnuRangeela)|
|Author and DDL, UI Design, More Customs..|Author and Wraps Up Features|Co-Author & Bug Tester|

</details>

44 changes: 31 additions & 13 deletions bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,14 @@ def changetz(*args):
DOWNLOAD_DIR = f'{DOWNLOAD_DIR}/'

AUTHORIZED_CHATS = environ.get('AUTHORIZED_CHATS', '')
if len(AUTHORIZED_CHATS) != 0:
if AUTHORIZED_CHATS:
aid = AUTHORIZED_CHATS.split()
for id_ in aid:
user_data[int(id_.strip())] = {'is_auth': True}
chat_id, *topic_ids = id_.split(':')
chat_id = int(chat_id)
user_data.setdefault(chat_id, {'is_auth': True})
if topic_ids:
user_data[chat_id].setdefault('topic_ids', []).extend(map(int, topic_ids))

SUDO_USERS = environ.get('SUDO_USERS', '')
if len(SUDO_USERS) != 0:
Expand All @@ -195,7 +199,7 @@ def changetz(*args):
log_info("Creating client from USER_SESSION_STRING")
try:
user = tgClient('user', TELEGRAM_API, TELEGRAM_HASH, session_string=USER_SESSION_STRING,
parse_mode=enums.ParseMode.HTML).start()
parse_mode=enums.ParseMode.HTML, no_updates=True).start()
IS_PREMIUM_USER = user.me.is_premium
except Exception as e:
log_error(f"Failed making client from USER_SESSION_STRING : {e}")
Expand All @@ -216,9 +220,13 @@ def changetz(*args):
if len(GDTOT_CRYPT) == 0:
GDTOT_CRYPT = ''

DEBRID_API_KEY = environ.get('DEBRID_API_KEY', '')
if len(DEBRID_API_KEY) == 0:
DEBRID_API_KEY = ''
REAL_DEBRID_API = environ.get('REAL_DEBRID_API', '')
if len(REAL_DEBRID_API) == 0:
REAL_DEBRID_API = ''

DEBRID_LINK_API = environ.get('DEBRID_LINK_API', '')
if len(DEBRID_LINK_API) == 0:
DEBRID_LINK_API = ''

INDEX_URL = environ.get('INDEX_URL', '').rstrip("/")
if len(INDEX_URL) == 0:
Expand Down Expand Up @@ -299,8 +307,10 @@ def changetz(*args):

CMD_SUFFIX = environ.get('CMD_SUFFIX', '')

RSS_CHAT_ID = environ.get('RSS_CHAT_ID', '')
RSS_CHAT_ID = '' if len(RSS_CHAT_ID) == 0 else int(RSS_CHAT_ID)
RSS_CHAT = environ.get('RSS_CHAT', '')
RSS_CHAT = '' if len(RSS_CHAT) == 0 else RSS_CHAT
if RSS_CHAT.isdigit() or RSS_CHAT.startswith('-'):
RSS_CHAT = int(RSS_CHAT)

RSS_DELAY = environ.get('RSS_DELAY', '')
RSS_DELAY = 600 if len(RSS_DELAY) == 0 else int(RSS_DELAY)
Expand Down Expand Up @@ -371,6 +381,9 @@ def changetz(*args):
UPSTREAM_BRANCH = environ.get('UPSTREAM_BRANCH', '')
if len(UPSTREAM_BRANCH) == 0:
UPSTREAM_BRANCH = 'master'

UPGRADE_PACKAGES = environ.get('UPGRADE_PACKAGES', '')
UPGRADE_PACKAGES = UPGRADE_PACKAGES.lower() == 'true'

RCLONE_SERVE_URL = environ.get('RCLONE_SERVE_URL', '')
if len(RCLONE_SERVE_URL) == 0:
Expand Down Expand Up @@ -516,6 +529,10 @@ def changetz(*args):
if len(LOGIN_PASS) == 0:
LOGIN_PASS = None

FILELION_API = environ.get('FILELION_API', '')
if len(FILELION_API) == 0:
FILELION_API = ''

IMDB_TEMPLATE = environ.get('IMDB_TEMPLATE', '')
if len(IMDB_TEMPLATE) == 0:
IMDB_TEMPLATE = '''<b>Title: </b> {title} [{year}]
Expand Down Expand Up @@ -576,7 +593,9 @@ def changetz(*args):
'CAP_FONT': CAP_FONT,
'CMD_SUFFIX': CMD_SUFFIX,
'DATABASE_URL': DATABASE_URL,
'DEBRID_API_KEY': DEBRID_API_KEY,
'REAL_DEBRID_API': REAL_DEBRID_API,
'DEBRID_LINK_API': DEBRID_LINK_API,
'FILELION_API': FILELION_API,
'DELETE_LINKS': DELETE_LINKS,
'DEFAULT_UPLOAD': DEFAULT_UPLOAD,
'DOWNLOAD_DIR': DOWNLOAD_DIR,
Expand Down Expand Up @@ -643,7 +662,7 @@ def changetz(*args):
'RCLONE_SERVE_USER': RCLONE_SERVE_USER,
'RCLONE_SERVE_PASS': RCLONE_SERVE_PASS,
'RCLONE_SERVE_PORT': RCLONE_SERVE_PORT,
'RSS_CHAT_ID': RSS_CHAT_ID,
'RSS_CHAT': RSS_CHAT,
'RSS_DELAY': RSS_DELAY,
'SAVE_MSG': SAVE_MSG,
'SAFE_MODE': SAFE_MODE,
Expand All @@ -664,6 +683,7 @@ def changetz(*args):
'TORRENT_TIMEOUT': TORRENT_TIMEOUT,
'UPSTREAM_REPO': UPSTREAM_REPO,
'UPSTREAM_BRANCH': UPSTREAM_BRANCH,
'UPGRADE_PACKAGES': UPGRADE_PACKAGES,
'UPTOBOX_TOKEN': UPTOBOX_TOKEN,
'USER_SESSION_STRING': USER_SESSION_STRING,
'USER_TD_MODE':USER_TD_MODE,
Expand Down Expand Up @@ -787,6 +807,4 @@ def aria2c_init():
parse_mode=enums.ParseMode.HTML).start()
bot_loop = bot.loop
bot_name = bot.me.username
scheduler = AsyncIOScheduler(timezone=str(
get_localzone()), event_loop=bot_loop)

scheduler = AsyncIOScheduler(timezone=str(get_localzone()), event_loop=bot_loop)
Loading

0 comments on commit d043219

Please sign in to comment.