diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 14aca5d..d99418d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,6 +24,8 @@ jobs: HD_DOWNLOAD_STATUS_UPDATE_INTERVAL: ${{secrets.DOWNLOAD_STATUS_UPDATE_INTERVAL}} HD_IS_TEAM_DRIVE: ${{secrets.IS_TEAM_DRIVE}} HD_GDRIVE_FOLDER_ID: ${{secrets.GDRIVE_FOLDER_ID}} + HD_HEROKU_API_KEY: ${{secrets.HEROKU_API_KEY}} + HD_HEROKU_APP_NAME: ${{secrets.HEROKU_APP_NAME}} HD_OWNER_ID: ${{secrets.OWNER_ID}} HD_TELEGRAM_API: ${{secrets.TELEGRAM_API}} HD_TELEGRAM_HASH: ${{secrets.TELEGRAM_HASH}} diff --git a/README.md b/README.md index fab3b4c..308106e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ [![Slam](https://telegra.ph/file/db03910496f06094f1f7a.jpg)](https://youtu.be/Pk_TthHfLeE) # Slam Mirror Bot -![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 contributors](https://img.shields.io/github/contributors/breakdowns/slam-mirrorbot?style=flat) -![GitHub watchers](https://img.shields.io/github/watchers/breakdowns/slam-mirrorbot) +![GitHub Repo stars](https://img.shields.io/github/stars/Slam-Team/slam-mirrorbot?color=blue&style=flat) +![GitHub forks](https://img.shields.io/github/forks/Slam-Team/slam-mirrorbot?color=green&style=flat) +![GitHub contributors](https://img.shields.io/github/contributors/Slam-Team/slam-mirrorbot?style=flat) +![GitHub watchers](https://img.shields.io/github/watchers/Slam-Team/slam-mirrorbot) ![Docker Pulls](https://img.shields.io/docker/pulls/breakdowns/mega-sdk-python?label=Docker%20Pull) [![Channel](https://img.shields.io/badge/Join%20Channel-!-red)](https://t.me/SlamMirrorUpdates) @@ -16,12 +16,13 @@ ## Additional Features - qBittorrent supported -- Updater (**NOTE**: You must upload your **token.pickle** to Index and fill your **token.pickle** url to **TOKEN_PICKLE_URL**, because your **token.pickle** will deleted after update, for more info please check [Setting up config file](https://github.com/breakdowns/slam-mirrorbot/tree/master#setting-up-config-file)) +- Updater (**NOTE**: You must upload your **token.pickle** to Index and fill your **token.pickle** url to **TOKEN_PICKLE_URL**, because your **token.pickle** will deleted after update, for more info please check [Setting up config file](https://github.com/Slam-Team/slam-mirrorbot/tree/master#setting-up-config-file)) - Limiting size Torrent/Direct, Tar/Unzip, Mega, cloning Google Drive support - Stop duplicate cloning Google Drive & mirroring Mega support - Tar/Unzip Google Drive link support - Select files from Torrent before downloading - Sudo with Database support +- Multiple Trackers support - Extracting **tar.xz** support - Counting Google Drive link - Heroku config support @@ -75,7 +76,7 @@ Deploying is pretty much straight forward and is divided into several steps as f - Clone this repo: ``` -git clone https://github.com/breakdowns/slam-mirrorbot mirrorbot/ +git clone https://github.com/Slam-Team/slam-mirrorbot mirrorbot/ cd mirrorbot ``` @@ -134,16 +135,16 @@ Fill up rest of the fields. Meaning of each fields are discussed below: - **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) - **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 never automatically delete messages) -- **UPSTREAM_REPO**: Link for Bot Upstream Repo, if you want default update, fill `https://github.com/breakdowns/slam-mirrorbot`. +- **UPSTREAM_REPO**: Link for Bot Upstream Repo, if you want default update, fill `https://github.com/Slam-Team/slam-mirrorbot`. - **UPSTREAM_BRANCH**: Branch name for Bot Upstream Repo, fill `master`. ### Optional Field - **ACCOUNTS_ZIP_URL**: Only if you want to load your Service Account externally from an Index Link. Archive the accounts folder to a zip file. Fill this with the direct link of that file. - **TOKEN_PICKLE_URL**: Only if you want to load your **token.pickle** externally from an Index Link. Fill this with the direct link of that file. -- **DATABASE_URL**: Your Database URL. See [Generate Database](https://github.com/breakdowns/slam-mirrorbot/tree/master#generate-database) to generate database (**NOTE**: If you use database you can save your sudo id permanent using `/addsudo` command). +- **DATABASE_URL**: Your Database URL. See [Generate Database](https://github.com/Slam-Team/slam-mirrorbot/tree/master#generate-database) to generate database (**NOTE**: If you use database you can save your sudo id permanent using `/addsudo` command). - **AUTHORIZED_CHATS**: Fill user_id and chat_id (not username) of you want to authorize, Seprate them with space, Examples: `-0123456789 -1122334455 6915401739`. - **SUDO_USERS**: Fill user_id (not username) of you want to sudoers, Seprate them with space, Examples: `0123456789 1122334455 6915401739` (**NOTE**: If you want save sudo id permanent without database, you must fill your sudo id there). - **IS_TEAM_DRIVE**: Set to `True` if `GDRIVE_FOLDER_ID` is from a Team Drive else `False` or Leave it empty. -- **USE_SERVICE_ACCOUNTS**: (Leave empty if unsure) Whether to use Service Accounts or not. For this to work see [Using Service Accounts](https://github.com/breakdowns/slam-mirrorbot#generate-service-accounts-what-is-service-account) section below. +- **USE_SERVICE_ACCOUNTS**: (Leave empty if unsure) Whether to use Service Accounts or not. For this to work see [Using Service Accounts](https://github.com/Slam-Team/slam-mirrorbot#generate-service-accounts-what-is-service-account) section below. - **INDEX_URL**: Refer to https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index The URL should not have any trailing '/' - **MEGA_API_KEY**: Mega.nz api key to mirror mega.nz links. Get it from [Mega SDK Page](https://mega.nz/sdk) - **MEGA_EMAIL_ID**: Your email id you used to sign up on mega.nz for using premium accounts (Leave th) @@ -214,7 +215,7 @@ sudo docker run mirrorbot ``` ## Deploying on Heroku with Github Workflow -

+

## Deploying on Heroku with heroku-cli and Goorm IDE

@@ -284,7 +285,7 @@ python3 gen_sa_accounts.py --download-keys project_id python3 add_to_team_drive.py -d SharedTeamDriveSrcID ``` -# Youtube-dl authentication using [.netrc](https://github.com/breakdowns/slam-mirrorbot/blob/master/.netrc) file +# Youtube-dl authentication using [.netrc](https://github.com/Slam-Team/slam-mirrorbot/blob/master/.netrc) file For using your premium accounts in Youtube-dl or for protected Index Links, edit the netrc file according to following format: ``` machine host login username password my_youtube_password @@ -307,5 +308,6 @@ Thanks to: - [anasty17](https://github.com/anasty17) for some features & help - [breakdowns](https://github.com/breakdowns) for slam-mirrorbot - [zevtyardt](https://github.com/zevtyardt) for some direct links +- [yash-dk](https://github.com/yash-dk) for implementation qBittorrent on Python -And many more people who aren't mentioned here, but may be found in [Contributors](https://github.com/breakdowns/slam-mirrorbot/graphs/contributors). +And many more people who aren't mentioned here, but may be found in [Contributors](https://github.com/Slam-Team/slam-mirrorbot/graphs/contributors). diff --git a/alive.py b/alive.py index b93b4b0..59b5b6a 100644 --- a/alive.py +++ b/alive.py @@ -1,5 +1,5 @@ -# Implement By - @anasty17 (https://github.com/breakdowns/slam-mirrorbot/commit/0bfba523f095ab1dccad431d72561e0e002e7a59) -# (c) https://github.com/breakdowns/slam-mirrorbot +# Implement By - @anasty17 (https://github.com/Slam-Team/slam-mirrorbot/commit/0bfba523f095ab1dccad431d72561e0e002e7a59) +# (c) https://github.com/Slam-Team/slam-mirrorbot # All rights reserved import time diff --git a/bot/__main__.py b/bot/__main__.py index 3437c7e..0b9c03f 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -49,10 +49,9 @@ This bot can mirror all your links to Google Drive! Type /{BotCommands.HelpCommand} to get a list of available commands ''' buttons = button_build.ButtonMaker() - buttons.buildbutton("Repo", "https://github.com/breakdowns/slam-mirrorbot") + buttons.buildbutton("Repo", "https://github.com/Slam-Team/slam-mirrorbot") buttons.buildbutton("Channel", "https://t.me/SlamMirrorUpdates") reply_markup = InlineKeyboardMarkup(buttons.build_menu(2)) - LOGGER.info('UID: {} - UN: {} - MSG: {}'.format(update.message.chat.id, update.message.chat.username, update.message.text)) uptime = get_readable_time((time.time() - botStartTime)) if CustomFilters.authorized_user(update) or CustomFilters.authorized_chat(update): if update.message.chat.type == "private" : @@ -187,8 +186,8 @@ botcmds = [ (f'{BotCommands.HelpCommand}','Get Detailed Help'), (f'{BotCommands.MirrorCommand}', 'Start Mirroring'), (f'{BotCommands.TarMirrorCommand}','Start mirroring and upload as .tar'), - (f'{BotCommands.UnzipMirrorCommand}','Extract files'), (f'{BotCommands.ZipMirrorCommand}','Start mirroring and upload as .zip'), + (f'{BotCommands.UnzipMirrorCommand}','Extract files'), (f'{BotCommands.CloneCommand}','Copy file/folder to Drive'), (f'{BotCommands.CountCommand}','Count file/folder of Drive link'), (f'{BotCommands.DeleteCommand}','Delete file from Drive'), diff --git a/bot/helper/mirror_utils/download_utils/qbit_downloader.py b/bot/helper/mirror_utils/download_utils/qbit_downloader.py index 5d66ede..c72e260 100644 --- a/bot/helper/mirror_utils/download_utils/qbit_downloader.py +++ b/bot/helper/mirror_utils/download_utils/qbit_downloader.py @@ -1,5 +1,5 @@ -# Implement By - @anasty17 (https://github.com/breakdowns/slam-mirrorbot/commit/0bfba523f095ab1dccad431d72561e0e002e7a59) -# (c) https://github.com/breakdowns/slam-mirrorbot +# Implement By - @anasty17 (https://github.com/Slam-Team/slam-mirrorbot/commit/0bfba523f095ab1dccad431d72561e0e002e7a59) +# (c) https://github.com/Slam-Team/slam-mirrorbot # All rights reserved import os diff --git a/bot/helper/mirror_utils/status_utils/clone_status.py b/bot/helper/mirror_utils/status_utils/clone_status.py index a712265..eb1c8df 100644 --- a/bot/helper/mirror_utils/status_utils/clone_status.py +++ b/bot/helper/mirror_utils/status_utils/clone_status.py @@ -1,5 +1,5 @@ -# Implement By - @anasty17 (https://github.com/breakdowns/slam-mirrorbot/commit/80d33430715b4296cd253f62cefc089a81937ebf) -# (c) https://github.com/breakdowns/slam-mirrorbot +# Implement By - @anasty17 (https://github.com/Slam-Team/slam-mirrorbot/commit/80d33430715b4296cd253f62cefc089a81937ebf) +# (c) https://github.com/Slam-Team/slam-mirrorbot # All rights reserved from .status import Status diff --git a/bot/helper/mirror_utils/status_utils/gdownload_status.py b/bot/helper/mirror_utils/status_utils/gdownload_status.py index eebb3aa..02bde13 100644 --- a/bot/helper/mirror_utils/status_utils/gdownload_status.py +++ b/bot/helper/mirror_utils/status_utils/gdownload_status.py @@ -1,5 +1,5 @@ -# Implement By - @anasty17 (https://github.com/breakdowns/slam-mirrorbot/pull/220) -# (c) https://github.com/breakdowns/slam-mirrorbot +# Implement By - @anasty17 (https://github.com/Slam-Team/slam-mirrorbot/pull/220) +# (c) https://github.com/Slam-Team/slam-mirrorbot # All rights reserved from .status import Status diff --git a/bot/helper/mirror_utils/status_utils/qbit_download_status.py b/bot/helper/mirror_utils/status_utils/qbit_download_status.py index ea93755..20fe82e 100644 --- a/bot/helper/mirror_utils/status_utils/qbit_download_status.py +++ b/bot/helper/mirror_utils/status_utils/qbit_download_status.py @@ -1,5 +1,5 @@ -# Implement By - @anasty17 (https://github.com/breakdowns/slam-mirrorbot/commit/0bfba523f095ab1dccad431d72561e0e002e7a59) -# (c) https://github.com/breakdowns/slam-mirrorbot +# Implement By - @anasty17 (https://github.com/Slam-Team/slam-mirrorbot/commit/0bfba523f095ab1dccad431d72561e0e002e7a59) +# (c) https://github.com/Slam-Team/slam-mirrorbot # All rights reserved from bot import DOWNLOAD_DIR, LOGGER, get_client diff --git a/bot/helper/mirror_utils/upload_utils/gdriveTools.py b/bot/helper/mirror_utils/upload_utils/gdriveTools.py index 61190c2..54617d1 100644 --- a/bot/helper/mirror_utils/upload_utils/gdriveTools.py +++ b/bot/helper/mirror_utils/upload_utils/gdriveTools.py @@ -559,7 +559,7 @@ class GoogleDriveHelper: Telegraph(access_token=telegraph_token).edit_page(path = self.path[prev_page], title = 'Slam Mirrorbot Search', author_name='Slam Mirrorbot', - author_url='https://github.com/breakdowns/slam-mirrorbot', + author_url='https://github.com/Slam-Team/slam-mirrorbot', html_content=content) return @@ -644,7 +644,7 @@ class GoogleDriveHelper: self.path.append(Telegraph(access_token=telegraph_token).create_page( title = 'Slam Mirrorbot Search', author_name='Slam Mirrorbot', - author_url='https://github.com/breakdowns/slam-mirrorbot', + author_url='https://github.com/Slam-Team/slam-mirrorbot', html_content=content )['path']) diff --git a/bot/modules/count.py b/bot/modules/count.py index 8c0629b..cf055e8 100644 --- a/bot/modules/count.py +++ b/bot/modules/count.py @@ -1,5 +1,5 @@ -# Implement By - @anasty17 (https://github.com/breakdowns/slam-mirrorbot/pull/111) -# (c) https://github.com/breakdowns/slam-mirrorbot +# Implement By - @anasty17 (https://github.com/Slam-Team/slam-mirrorbot/pull/111) +# (c) https://github.com/Slam-Team/slam-mirrorbot # All rights reserved from telegram.ext import CommandHandler diff --git a/bot/modules/torrent_search.py b/bot/modules/torrent_search.py index 048f93c..1bdd668 100644 --- a/bot/modules/torrent_search.py +++ b/bot/modules/torrent_search.py @@ -304,14 +304,14 @@ RESULT_STR_ALL = ( ) torrents_dict = { - '1337x': {'source': "https://torrenter-api.herokuapp.com/api/1337x/", 'result_str': RESULT_STR_1337}, - 'piratebay': {'source': "https://torrenter-api.herokuapp.com/api/piratebay/", 'result_str': RESULT_STR_PIRATEBAY}, - 'tgx': {'source': "https://torrenter-api.herokuapp.com/api/tgx/", 'result_str': RESULT_STR_TGX}, - 'yts': {'source': "https://torrenter-api.herokuapp.com/api/yts/", 'result_str': RESULT_STR_YTS}, - 'eztv': {'source': "https://torrenter-api.herokuapp.com/api/eztv/", 'result_str': RESULT_STR_EZTV}, - 'torlock': {'source': "https://torrenter-api.herokuapp.com/api/torlock/", 'result_str': RESULT_STR_TORLOCK}, - 'rarbg': {'source': "https://torrenter-api.herokuapp.com/api/rarbg/", 'result_str': RESULT_STR_RARBG}, - 'ts': {'source': "https://torrenter-api.herokuapp.com/api/all/", 'result_str': RESULT_STR_ALL} + '1337x': {'source': "https://slam-api.herokuapp.com/api/1337x/", 'result_str': RESULT_STR_1337}, + 'piratebay': {'source': "https://slam-api.herokuapp.com/api/piratebay/", 'result_str': RESULT_STR_PIRATEBAY}, + 'tgx': {'source': "https://slam-api.herokuapp.com/api/tgx/", 'result_str': RESULT_STR_TGX}, + 'yts': {'source': "https://slam-api.herokuapp.com/api/yts/", 'result_str': RESULT_STR_YTS}, + 'eztv': {'source': "https://slam-api.herokuapp.com/api/eztv/", 'result_str': RESULT_STR_EZTV}, + 'torlock': {'source': "https://slam-api.herokuapp.com/api/torlock/", 'result_str': RESULT_STR_TORLOCK}, + 'rarbg': {'source': "https://slam-api.herokuapp.com/api/rarbg/", 'result_str': RESULT_STR_RARBG}, + 'ts': {'source': "https://slam-api.herokuapp.com/api/all/", 'result_str': RESULT_STR_ALL} } torrent_handlers = [] diff --git a/config_sample.env b/config_sample.env index 4a10d3f..aab9ecb 100644 --- a/config_sample.env +++ b/config_sample.env @@ -11,7 +11,7 @@ AUTO_DELETE_MESSAGE_DURATION = 20 IS_TEAM_DRIVE = "" TELEGRAM_API = TELEGRAM_HASH = "" -UPSTREAM_REPO = "https://github.com/breakdowns/slam-mirrorbot" +UPSTREAM_REPO = "https://github.com/Slam-Team/slam-mirrorbot" UPSTREAM_BRANCH = "master" # OPTIONAL CONFIG DATABASE_URL = "" diff --git a/heroku-guide.md b/heroku-guide.md index fb62bb2..0872726 100644 --- a/heroku-guide.md +++ b/heroku-guide.md @@ -8,7 +8,7 @@ ## Deployment -1. Give stars and Fork this repo then upload **token.pickle** to your forks, or you can upload your **token.pickle** to your Index and put your **token.pickle** link to **TOKEN_PICKLE_URL** (**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) +1. Give stars and Fork this repo then upload **token.pickle** to your forks, or you can upload your **token.pickle** to your Index and put your **token.pickle** link to **TOKEN_PICKLE_URL** (**NOTE**: If you didn't upload **token.pickle** uploading will not work). How to generate **token.pickle**? [Read here](https://github.com/Slam-Team/slam-mirrorbot#getting-google-oauth-api-credential-file) 2. Go to Repository `Settings` -> `Secrets` @@ -46,9 +46,9 @@ * `DOWNLOAD_DIR` The path to the local folder where the downloads should be downloaded to, Fill `/usr/src/app/downloads` * `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) * `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 never automatically delete messages) - * `UPSTREAM_REPO` Link for Bot Upstream Repo, if you want default update, fill `https://github.com/breakdowns/slam-mirrorbot` + * `UPSTREAM_REPO` Link for Bot Upstream Repo, if you want default update, fill `https://github.com/Slam-Team/slam-mirrorbot` * `UPSTREAM_BRANCH` Branch name for Bot Upstream Repo, fill `master` - ### For Optional Variables you can get from [Here](https://github.com/breakdowns/slam-mirrorbot#setting-up-config-file) + ### For Optional Variables you can get from [Here](https://github.com/Slam-Team/slam-mirrorbot#setting-up-config-file) 4. After adding all the above Required Variables go to Github Actions tab in your repo diff --git a/wserver.py b/wserver.py index 68a684a..88778ff 100644 --- a/wserver.py +++ b/wserver.py @@ -205,7 +205,7 @@ input[type="submit"]:hover, input[type="submit"]:focus{
- +
@@ -530,7 +530,7 @@ section span{
- +
@@ -704,7 +704,7 @@ async def set_priority(request): @routes.get('/') async def homepage(request): - return web.Response(text="

See slam-mirrorbot @GitHub By Breakdowns

", content_type="text/html") + return web.Response(text="

See slam-mirrorbot @GitHub By Slam-Team

", content_type="text/html") async def e404_middleware(app, handler):