Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 174d96b

Browse files
authored
v4.6.1 (#41)
- Tidying up
1 parent 98ed369 commit 174d96b

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

bot/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@ def getConfig(name: str):
107107
if USE_TELEGRAPH:
108108
sname = ''.join(random.SystemRandom().choices(string.ascii_letters, k=8))
109109
LOGGER.info("Using Telegra.ph")
110-
LOGGER.info("Generating TELEGRAPH_TOKEN")
110+
LOGGER.info("Generating TELEGRAPH_TOKEN using '" + sname + "' name")
111111
telegraph = Telegraph()
112112
telegraph.create_account(short_name=sname)
113113
TELEGRAPH_TOKEN = telegraph.get_access_token()
114+
LOGGER.info("Telegraph Token Generated: '" + TELEGRAPH_TOKEN + "'")
114115
if not USE_TELEGRAPH:
115116
TELEGRAPH_TOKEN = None
116117
LOGGER.info("Not Using Telegra.ph")

bot/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def stats(update, context):
4444
@run_async
4545
def start(update, context):
4646
start_string = f'''
47-
Hi {update.message.chat.first_name}, This bot can mirror all your links to Google drive!
47+
This bot can mirror all your links to Google drive!
4848
Type /{BotCommands.HelpCommand} to get a list of available commands
4949
'''
5050
update.effective_message.reply_photo("https://telegra.ph/file/db03910496f06094f1f7a.jpg", start_string, parse_mode=ParseMode.MARKDOWN)

bot/helper/mirror_utils/download_utils/aria2_download.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __onDownloadStarted(self, api, gid):
2626
smsg, button = gdrive.drive_list(sname)
2727
if STOP_DUPLICATE_MIRROR:
2828
if smsg:
29-
dl.getListener().onDownloadError(f'File is already available in drive.\n\n')
29+
dl.getListener().onDownloadError(f'😡 File is already available in drive. You should have search before mirror any file. You might get ban if you do this again. This download has been stopped.\n\n')
3030
print(dl.getListener())
3131
if button:
3232
sendMarkup("Here are the search results:👇\n", dl.getListener().bot, dl.getListener().update, button)

bot/helper/mirror_utils/upload_utils/gdriveTools.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def upload_file(self, file_path, file_name, mime_type, parent_id):
151151
# File body description
152152
file_metadata = {
153153
'name': file_name,
154-
'description': 'mirror',
154+
'description': 'Uploaded by Slam Mirror Bot',
155155
'mimeType': mime_type,
156156
}
157157
if parent_id is not None:
@@ -317,7 +317,7 @@ def clone(self, link):
317317
if meta.get("mimeType") == self.__G_DRIVE_DIR_MIME_TYPE:
318318
dir_id = self.create_directory(meta.get('name'), parent_id)
319319
result = self.cloneFolder(meta.get('name'), meta.get('name'), meta.get('id'), dir_id)
320-
msg += f'<b>Filename: </b><code>{meta.get("name")}</code>\n<b>Size: </b>{get_readable_file_size(self.transferred_size)}'
320+
msg += f'<b>Filename: </b><code>{meta.get("name")}</code>\n<b>Size: </b><code>{get_readable_file_size(self.transferred_size)}</code>'
321321
durl = self.__G_DRIVE_DIR_BASE_DOWNLOAD_URL.format(dir_id)
322322
buttons = button_build.ButtonMaker()
323323
if SHORTENER is not None and SHORTENER_API is not None:
@@ -478,7 +478,7 @@ def edit_telegraph(self):
478478
content += f'<b> | <a href="https://telegra.ph/{self.path[nxt_page]}">Next</a></b>'
479479
nxt_page += 1
480480
Telegraph(access_token=TELEGRAPH_TOKEN).edit_page(path = self.path[prev_page],
481-
title = 'Slam Mirror Bot Search',
481+
title = 'Slam Mirror Bot - Search',
482482
author_name='Slam Mirror Bot',
483483
author_url='https://github.com/breakdowns/slam-mirrorbot',
484484
html_content=content)
@@ -510,7 +510,7 @@ def drive_list(self, fileName):
510510
if file.get(
511511
'mimeType') == "application/vnd.google-apps.folder": # Detect Whether Current Entity is a Folder or File.
512512
furl = f"https://drive.google.com/drive/folders/{file.get('id')}"
513-
msg += f"⁍<code>{file.get('name')}<br>(folder📁)</code><br>"
513+
msg += f"⁍<code>{file.get('name')}<br>(folder)📁</code><br>"
514514
if SHORTENER is not None and SHORTENER_API is not None:
515515
sfurl = requests.get(
516516
'https://{}/api?api={}&url={}&format=text'.format(SHORTENER, SHORTENER_API, furl)).text

0 commit comments

Comments
 (0)