commit
c16c7c681b
|
|
@ -730,7 +730,7 @@ class GoogleDriveHelper:
|
||||||
file_id = self.getIdFromUrl(link)
|
file_id = self.getIdFromUrl(link)
|
||||||
except (KeyError,IndexError):
|
except (KeyError,IndexError):
|
||||||
msg = "Google Drive ID could not be found in the provided link"
|
msg = "Google Drive ID could not be found in the provided link"
|
||||||
return msg, "", ""
|
return msg, "", "", ""
|
||||||
LOGGER.info(f"File ID: {file_id}")
|
LOGGER.info(f"File ID: {file_id}")
|
||||||
try:
|
try:
|
||||||
drive_file = self.__service.files().get(fileId=file_id, fields="id, name, mimeType, size",
|
drive_file = self.__service.files().get(fileId=file_id, fields="id, name, mimeType, size",
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import requests
|
||||||
from telegram.ext import CommandHandler
|
from telegram.ext import CommandHandler
|
||||||
from telegram import InlineKeyboardMarkup
|
from telegram import InlineKeyboardMarkup
|
||||||
|
|
||||||
from bot import Interval, INDEX_URL, BUTTON_FOUR_NAME, BUTTON_FOUR_URL, BUTTON_FIVE_NAME, BUTTON_FIVE_URL, BUTTON_SIX_NAME, BUTTON_SIX_URL, BLOCK_MEGA_FOLDER, BLOCK_MEGA_LINKS, VIEW_LINK, aria2
|
from bot import Interval, INDEX_URL, BUTTON_FOUR_NAME, BUTTON_FOUR_URL, BUTTON_FIVE_NAME, BUTTON_FIVE_URL, BUTTON_SIX_NAME, BUTTON_SIX_URL, BLOCK_MEGA_FOLDER, BLOCK_MEGA_LINKS, VIEW_LINK, aria2, get_client
|
||||||
from bot import dispatcher, DOWNLOAD_DIR, download_dict, download_dict_lock, SHORTENER, SHORTENER_API, TAR_UNZIP_LIMIT
|
from bot import dispatcher, DOWNLOAD_DIR, download_dict, download_dict_lock, SHORTENER, SHORTENER_API, TAR_UNZIP_LIMIT
|
||||||
from bot.helper.ext_utils import fs_utils, bot_utils
|
from bot.helper.ext_utils import fs_utils, bot_utils
|
||||||
from bot.helper.ext_utils.bot_utils import get_mega_link_type
|
from bot.helper.ext_utils.bot_utils import get_mega_link_type
|
||||||
|
|
@ -52,6 +52,7 @@ class MirrorListener(listeners.MirrorListeners):
|
||||||
def clean(self):
|
def clean(self):
|
||||||
try:
|
try:
|
||||||
aria2.purge()
|
aria2.purge()
|
||||||
|
get_client().torrents_delete(torrent_hashes="all", delete_files=True)
|
||||||
Interval[0].cancel()
|
Interval[0].cancel()
|
||||||
del Interval[0]
|
del Interval[0]
|
||||||
delete_all_messages()
|
delete_all_messages()
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ def _watch(bot: Bot, update, isTar=False):
|
||||||
mssg = update.message.text
|
mssg = update.message.text
|
||||||
message_args = mssg.split(' ')
|
message_args = mssg.split(' ')
|
||||||
name_args = mssg.split('|')
|
name_args = mssg.split('|')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
link = message_args[1]
|
link = message_args[1]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
|
@ -23,6 +24,7 @@ def _watch(bot: Bot, update, isTar=False):
|
||||||
msg += "This file will be downloaded in 720p quality and it's name will be <b>Slam</b>"
|
msg += "This file will be downloaded in 720p quality and it's name will be <b>Slam</b>"
|
||||||
sendMessage(msg, bot, update)
|
sendMessage(msg, bot, update)
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if "|" in mssg:
|
if "|" in mssg:
|
||||||
mssg = mssg.split("|")
|
mssg = mssg.split("|")
|
||||||
|
|
@ -35,11 +37,12 @@ def _watch(bot: Bot, update, isTar=False):
|
||||||
qual = f'bestvideo[height<={qual}]+bestaudio/best[height<={qual}]'
|
qual = f'bestvideo[height<={qual}]+bestaudio/best[height<={qual}]'
|
||||||
except IndexError:
|
except IndexError:
|
||||||
qual = "bestvideo+bestaudio/best"
|
qual = "bestvideo+bestaudio/best"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
name = name_args[1]
|
name = name_args[1]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
name = ""
|
name = ""
|
||||||
reply_to = update.message.reply_to_message
|
|
||||||
pswd = ""
|
pswd = ""
|
||||||
listener = MirrorListener(bot, update, pswd, isTar)
|
listener = MirrorListener(bot, update, pswd, isTar)
|
||||||
ydl = YoutubeDLHelper(listener)
|
ydl = YoutubeDLHelper(listener)
|
||||||
|
|
@ -55,9 +58,18 @@ def watch(update, context):
|
||||||
_watch(context.bot, update)
|
_watch(context.bot, update)
|
||||||
|
|
||||||
|
|
||||||
mirror_handler = CommandHandler(BotCommands.WatchCommand, watch,
|
mirror_handler = CommandHandler(
|
||||||
filters=CustomFilters.authorized_chat | CustomFilters.authorized_user, run_async=True)
|
BotCommands.WatchCommand,
|
||||||
tar_mirror_handler = CommandHandler(BotCommands.TarWatchCommand, watchTar,
|
watch,
|
||||||
filters=CustomFilters.authorized_chat | CustomFilters.authorized_user, run_async=True)
|
filters=CustomFilters.authorized_chat | CustomFilters.authorized_user,
|
||||||
|
run_async=True,
|
||||||
|
)
|
||||||
|
tar_mirror_handler = CommandHandler(
|
||||||
|
BotCommands.TarWatchCommand,
|
||||||
|
watchTar,
|
||||||
|
filters=CustomFilters.authorized_chat | CustomFilters.authorized_user,
|
||||||
|
run_async=True,
|
||||||
|
)
|
||||||
|
|
||||||
dispatcher.add_handler(mirror_handler)
|
dispatcher.add_handler(mirror_handler)
|
||||||
dispatcher.add_handler(tar_mirror_handler)
|
dispatcher.add_handler(tar_mirror_handler)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue