- Remove unused import
- Added badge

Co-authored-by: Tanmoy karmakar <59302188+tk007-git@users.noreply.github.com>
This commit is contained in:
Hafitz Setya 2021-05-24 11:52:54 +07:00 committed by GitHub
parent dc9b9c8879
commit 813f2174be
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 13 deletions

View File

@ -1,7 +1,18 @@
[![Slam](https://telegra.ph/file/db03910496f06094f1f7a.jpg)](https://youtu.be/Pk_TthHfLeE)
# Slam Mirror Bot
This is a Telegram bot writen in Python for mirroring files on the Internet to our beloved Google Drive.
![GitHub Repo stars](https://img.shields.io/github/stars/breakdowns/slam-mirrorbot?color=blue&style=flat)
![GitHub forks](https://img.shields.io/github/forks/breakdowns/slam-mirrorbot?color=green&style=flat)
![GitHub issues](https://img.shields.io/github/issues/breakdowns/slam-mirrorbot)
![GitHub closed issues](https://img.shields.io/github/issues-closed/breakdowns/slam-mirrorbot)
![GitHub pull requests](https://img.shields.io/github/issues-pr/breakdowns/slam-mirrorbot)
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/breakdowns/slam-mirrorbot)
![GitHub contributors](https://img.shields.io/github/contributors/breakdowns/slam-mirrorbot?style=flat)
![GitHub repo size](https://img.shields.io/github/repo-size/breakdowns/slam-mirrorbot?color=red)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/breakdowns/slam-mirrorbot)
[![Slam Mirror Support](https://img.shields.io/badge/slam%20mirror%20bot-support%20group-blue)](https://t.me/SlamMirrorSupport)
**Slam Mirror Bot** is a Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive.
# Features supported:
@ -169,7 +180,7 @@ sudo docker run mirrorbot
## Deploying on Heroku
- Fork this repo then upload **token.pickle** to your forks
- Give stars and Fork this repo then upload **token.pickle** to your forks
- Hit the **DEPLOY TO HEROKU** button and follow the further instructions in the screen
**NOTE**: If you didn't upload **token.pickle**, uploading will not work. How to generate **token.pickle**? [Read here](https://github.com/breakdowns/slam-mirrorbot#getting-google-oauth-api-credential-file)
@ -178,7 +189,6 @@ sudo docker run mirrorbot
## Deploying on Heroku with heroku-cli and Goorm IDE
<p><a href="https://telegra.ph/How-to-Deploy-a-Mirror-Bot-to-Heroku-with-CLI-05-06"> <img src="https://img.shields.io/badge/see%20on%20telegraph-grey?style=for-the-badge" width="190""/></a></p>
# Using Service Accounts for uploading to avoid user rate limit
For Service Account to work, you must set **USE_SERVICE_ACCOUNTS=**"True" in config file or environment variables,
Many thanks to [AutoRClone](https://github.com/xyou365/AutoRclone) for the scripts.
@ -215,9 +225,6 @@ machine host login username password my_youtube_password
```
Where host is the name of extractor (eg. Youtube, Twitch). Multiple accounts of different hosts can be added each separated by a new line.
# Support Group
<p><a href="https://t.me/SlamMirrorSupport"> <img src="https://img.shields.io/badge/Slam%20Mirror%20Support-black?style=for-the-badge&logo=telegram" width="230""/></a></p>
# Credits
Thanks to:

View File

@ -1,6 +1,7 @@
import shutil, psutil
import signal
import pickle
from pyrogram import idle
from bot import app
from os import execl, kill, path, remove
@ -8,7 +9,8 @@ from sys import executable
from datetime import datetime
import pytz
import time
from telegram import ParseMode, BotCommand, InlineKeyboardMarkup
from telegram import ParseMode, BotCommand
from telegram.ext import CommandHandler, run_async
from bot import dispatcher, updater, botStartTime, IMAGE_URL
from bot.helper.ext_utils import fs_utils
@ -37,7 +39,7 @@ def stats(update, context):
disk = psutil.disk_usage('/').percent
stats = f'<b>Bot Uptime:</b> {currentTime}\n' \
f'<b>Start Time:</b> {current}\n' \
f'<b>Total disk space:</b> {total}\n' \
f'<b>Total Disk Space:</b> {total}\n' \
f'<b>Used:</b> {used} ' \
f'<b>Free:</b> {free}\n\n' \
f'📊Data Usage📊\n<b>Upload:</b> {sent}\n' \

View File

@ -101,7 +101,7 @@ def get_readable_message():
msg += f"\n<b>Downloaded:</b> {get_readable_file_size(download.processed_bytes())} of {download.size()}"
else:
msg += f"\n<b>Uploaded:</b> {get_readable_file_size(download.processed_bytes())} of {download.size()}"
msg += f"\n<b>Speed:</b> {download.speed()} | <b>ETA:</b> {download.eta()} "
msg += f"\n<b>Speed:</b> {download.speed()}\n<b>ETA:</b> {download.eta()} "
# if hasattr(download, 'is_torrent'):
try:
msg += f"\n<b>Seeders:</b> {download.aria_download().num_seeders}" \

View File

@ -55,7 +55,7 @@ class DbManger:
self.conn.commit()
self.disconnect()
SUDO_USERS.add(chat_id)
return 'Successfully promoted as sudo'
return 'Successfully promoted as Sudo'
else:
sql = 'INSERT INTO users VALUES ({},TRUE);'.format(chat_id)
self.cur.execute(sql)
@ -63,7 +63,7 @@ class DbManger:
self.disconnect()
AUTHORIZED_CHATS.add(chat_id)
SUDO_USERS.add(chat_id)
return 'Successfully Authorized and promoted as sudo'
return 'Successfully Authorized and promoted as Sudo'
def db_rmsudo(self,chat_id: int):
self.connect()

View File

@ -2,8 +2,8 @@ from speedtest import Speedtest
from bot.helper.telegram_helper.filters import CustomFilters
from bot import dispatcher, AUTHORIZED_CHATS
from bot.helper.telegram_helper.bot_commands import BotCommands
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup, ParseMode
from telegram.ext import CallbackContext, Filters, run_async, CommandHandler
from telegram import Update, ParseMode
from telegram.ext import Filters, run_async, CommandHandler
@run_async