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

Commit

Permalink
Tidying up
Browse files Browse the repository at this point in the history
  • Loading branch information
breakdowns authored May 31, 2021
1 parent 3589065 commit 8935a0e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- Multiple Trackers support
- Check Heroku dynos stats
- Custom image support
- Counting file/folders
- Racaty.net support
- Shell and Executor
- Stickers module
Expand Down Expand Up @@ -117,7 +118,7 @@ Fill up rest of the fields. Meaning of each fields are discussed below:
- **TELEGRAM_API**: This is to authenticate to your Telegram account for downloading Telegram files. You can get this from https://my.telegram.org DO NOT put this in quotes.
- **TELEGRAM_HASH**: This is to authenticate to your Telegram account for downloading Telegram files. You can get this from https://my.telegram.org
- **OWNER_ID**: The Telegram user ID (not username) of the Owner of the bot
- **DATABASE_URL**: Your Database URL. See [Generate Database](https://github.com/breakdowns/slam-mirrorbot/tree/master#generate-database) to generate database. (**NOTE**: If you deploying on Heroku, no need to generate database manually, because it will automatic generate database when first deploying)
- **DATABASE_URL**: Your Database URL. See [Generate Database](https://github.com/breakdowns/slam-mirrorbot/tree/master#generate-database) to generate database. (**NOTE**: Leave this empty if You deploying on Heroku with PostgreSQL, for using another database with Heroku just make the name of the var (DATABASE_URL), for vps You must fill database url here)
- **GDRIVE_FOLDER_ID**: This is the folder ID of the Google Drive Folder to which you want to upload all the mirrors.
- **DOWNLOAD_DIR**: The path to the local folder where the downloads should be downloaded to
- **DOWNLOAD_STATUS_UPDATE_INTERVAL**: A short interval of time in seconds after which the Mirror progress message is updated. (I recommend to keep it `5` seconds at least)
Expand Down
5 changes: 3 additions & 2 deletions bot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def bot_help(update, context):
/{BotCommands.CloneCommand}: Copy file/folder to Google Drive
/{BotCommands.CountCommand}: Count files/folders of G-Drive Links
/{BotCommands.CountCommand}: Count file/folder of Google Drive Links
/{BotCommands.DeleteCommand} [link]: Delete file from Google Drive (Only Owner & Sudo)
Expand Down Expand Up @@ -161,7 +161,7 @@ def bot_help(update, context):
/{BotCommands.CloneCommand}: Copy file/folder to Google Drive
/{BotCommands.CountCommand}: Count files/folders of G-Drive Links
/{BotCommands.CountCommand}: Count file/folder of Google Drive Links
/{BotCommands.WatchCommand} [youtube-dl supported link]: Mirror through youtube-dl. Click /{BotCommands.WatchCommand} for more help.
Expand Down Expand Up @@ -197,6 +197,7 @@ def bot_help(update, context):
BotCommand(f'{BotCommands.TarMirrorCommand}','Upload tar (zipped) file'),
BotCommand(f'{BotCommands.UnzipMirrorCommand}','Extract files'),
BotCommand(f'{BotCommands.CloneCommand}','Copy file/folder to Drive'),
BotCommand(f'{BotCommands.CountCommand}','Count file/folder of Drive Links'),
BotCommand(f'{BotCommands.WatchCommand}','Mirror YT-DL support link'),
BotCommand(f'{BotCommands.TarWatchCommand}','Mirror Youtube playlist link as tar'),
BotCommand(f'{BotCommands.CancelMirror}','Cancel a task'),
Expand Down
26 changes: 13 additions & 13 deletions bot/helper/mirror_utils/upload_utils/gdriveTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ def clone(self, link):
dir_id = self.create_directory(meta.get('name'), parent_id)
result = self.cloneFolder(meta.get('name'), meta.get('name'), meta.get('id'), dir_id)
msg += f'<b>Filename: </b><code>{meta.get("name")}</code>\n<b>Size: </b><code>{get_readable_file_size(self.transferred_size)}</code>'
msg += f"\n\n<b>Type : </b>Folder"
msg += f"\n<b>SubFolders : </b>{self.total_folders}"
msg += f"\n<b>Files : </b>{self.total_files}"
msg += f'\n\n<b>Type: </b>Folder'
msg += f'\n<b>SubFolders: </b>{self.total_folders}'
msg += f'\n<b>Files: </b>{self.total_files}'
durl = self.__G_DRIVE_DIR_BASE_DOWNLOAD_URL.format(dir_id)
buttons = button_build.ButtonMaker()
if SHORTENER is not None and SHORTENER_API is not None:
Expand Down Expand Up @@ -363,7 +363,7 @@ def clone(self, link):
typeee = 'File'
try:
msg += f'\n<b>Size: </b><code>{get_readable_file_size(int(meta.get("size")))}</code>'
msg += f"\n\n<b>Type : </b>{typeee}"
msg += f'\n\n<b>Type: </b>{typeee}'
except TypeError:
pass
if INDEX_URL is not None:
Expand Down Expand Up @@ -612,23 +612,23 @@ def count(self, link):
LOGGER.info(f"Counting: {name}")
if drive_file['mimeType'] == self.__G_DRIVE_DIR_MIME_TYPE:
self.gDrive_directory(**drive_file)
msg += f'<b>Filename : </b><code>{name}</code>'
msg += f'\n\n<b>Size : </b>{get_readable_file_size(self.total_bytes)}'
msg += f"\n\n<b>Type : </b>Folder"
msg += f"\n<b>SubFolders : </b>{self.total_folders}"
msg += f"\n<b>Files : </b>{self.total_files}"
msg += f'<b>Filename: </b><code>{name}</code>'
msg += f'\n<b>Size: </b>{get_readable_file_size(self.total_bytes)}'
msg += f'\n\n<b>Type: </b>Folder'
msg += f'\n<b>SubFolders: </b>{self.total_folders}'
msg += f'\n<b>Files: </b>{self.total_files}'
else:
msg += f'<b>Filename : </b><code>{name}</code>'
msg += f'<b>Filename: </b><code>{name}</code>'
try:
typee = drive_file['mimeType']
except:
typee = 'File'
try:
self.total_files += 1
self.gDrive_file(**drive_file)
msg += f'\n\n<b>Size : </b><code>{get_readable_file_size(self.total_bytes)}</code>'
msg += f"\n\n<b>Type : </b>{typee}"
msg += f"\n<b>Files : </b>{self.total_files}"
msg += f'\n<b>Size: </b><code>{get_readable_file_size(self.total_bytes)}</code>'
msg += f'\n\n<b>Type: </b>{typee}'
msg += f'\n<b>Files: </b>{self.total_files}'
except TypeError:
pass
except Exception as err:
Expand Down
2 changes: 1 addition & 1 deletion config_sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AUTO_DELETE_MESSAGE_DURATION = 20
IS_TEAM_DRIVE = ""
TELEGRAM_API =
TELEGRAM_HASH = ""
DATABASE_URL = "" #Leave this empty if You deploying on heroku with PostgreSQL, for using another database with Heroku just make the name of the var (DATABASE_URL), for vps You must fill database url here
DATABASE_URL = "" #Leave this empty if You deploying on Heroku with PostgreSQL, for using another database with Heroku just make the name of the var (DATABASE_URL), for vps You must fill database url here
# Optional config
AUTHORIZED_CHATS = ""
USE_SERVICE_ACCOUNTS = ""
Expand Down

0 comments on commit 8935a0e

Please sign in to comment.