Repo name changed again

Signed-off-by: breakdowns <hafitz666@outlook.co.id>
This commit is contained in:
Hafitz Setya 2021-08-07 07:38:13 +07:00 committed by GitHub
parent 0bfba523f0
commit f62ce1ce72
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 76 additions and 54 deletions

View File

@ -3,7 +3,7 @@ FROM anasty17/megasdk:latest
WORKDIR /usr/src/app WORKDIR /usr/src/app
RUN chmod 777 /usr/src/app RUN chmod 777 /usr/src/app
RUN apt-get install -y xz-utils neofetch unzip && apt-get autoremove -y RUN apt-get install -y wget xz-utils neofetch unzip && apt-get autoremove -y
COPY requirements.txt . COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt RUN pip3 install --no-cache-dir -r requirements.txt

View File

@ -1,34 +1,32 @@
[![Slam](https://telegra.ph/file/db03910496f06094f1f7a.jpg)](https://youtu.be/Pk_TthHfLeE) [![Slam](https://telegra.ph/file/db03910496f06094f1f7a.jpg)](https://youtu.be/Pk_TthHfLeE)
# Slam Aria Mirror Bot # Slam Tg Mirror Bot
![GitHub Repo stars](https://img.shields.io/github/stars/breakdowns/slam-aria-mirror-bot?color=blue&style=flat) ![GitHub Repo stars](https://img.shields.io/github/stars/breakdowns/slam-tg-mirror-bot?color=blue&style=flat)
![GitHub forks](https://img.shields.io/github/forks/breakdowns/slam-aria-mirror-bot?color=green&style=flat) ![GitHub forks](https://img.shields.io/github/forks/breakdowns/slam-tg-mirror-bot?color=green&style=flat)
![GitHub issues](https://img.shields.io/github/issues/breakdowns/slam-aria-mirror-bot) ![GitHub issues](https://img.shields.io/github/issues/breakdowns/slam-tg-mirror-bot)
![GitHub closed issues](https://img.shields.io/github/issues-closed/breakdowns/slam-aria-mirror-bot) ![GitHub closed issues](https://img.shields.io/github/issues-closed/breakdowns/slam-tg-mirror-bot)
![GitHub pull requests](https://img.shields.io/github/issues-pr/breakdowns/slam-aria-mirror-bot) ![GitHub pull requests](https://img.shields.io/github/issues-pr/breakdowns/slam-tg-mirror-bot)
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/breakdowns/slam-aria-mirror-bot) ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/breakdowns/slam-tg-mirror-bot)
![GitHub watchers](https://img.shields.io/github/watchers/breakdowns/slam-aria-mirror-bot) ![GitHub watchers](https://img.shields.io/github/watchers/breakdowns/slam-tg-mirror-bot)
![GitHub contributors](https://img.shields.io/github/contributors/breakdowns/slam-aria-mirror-bot?style=flat) ![GitHub contributors](https://img.shields.io/github/contributors/breakdowns/slam-tg-mirror-bot?style=flat)
![GitHub repo size](https://img.shields.io/github/repo-size/breakdowns/slam-aria-mirror-bot?color=red) ![GitHub repo size](https://img.shields.io/github/repo-size/breakdowns/slam-tg-mirror-bot?color=red)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/breakdowns/slam-aria-mirror-bot) ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/breakdowns/slam-tg-mirror-bot)
![GitHub](https://img.shields.io/github/license/breakdowns/slam-aria-mirror-bot) ![GitHub](https://img.shields.io/github/license/breakdowns/slam-tg-mirror-bot)
![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)
![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) [![Channel](https://img.shields.io/badge/Join%20Channel-!-red)](https://t.me/SlamMirrorUpdates)
**Slam Aria Mirror Bot** is a _multipurpose_ Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive. **Slam Tg Mirror Bot** is a _multipurpose_ Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive.
# Features supported: # Features supported:
<details> <details>
<summary><b>Click Here For More Details</b></summary> <summary><b>Click Here For More Details</b></summary>
## Additional Features ## 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-aria-mirror-bot/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/breakdowns/slam-aria-mirror-bot/tree/master#setting-up-config-file))
- Limiting size Torrent/Direct, Tar/Unzip, Mega, cloning Google Drive support - Limiting size Torrent/Direct, Tar/Unzip, Mega, cloning Google Drive support
- Stop duplicate cloning Google Drive & mirroring Mega support - Stop duplicate cloning Google Drive & mirroring Mega support
- Tar/Unzip Google Drive link support - Tar/Unzip Google Drive link support
- Sudo with Database support - Sudo with Database support
- Multiple Trackers support
- Extracting **tar.xz** support - Extracting **tar.xz** support
- Counting Google Drive link - Counting Google Drive link
- Heroku config support - Heroku config support
@ -81,7 +79,7 @@ Deploying is pretty much straight forward and is divided into several steps as f
- Clone this repo: - Clone this repo:
``` ```
git clone https://github.com/breakdowns/slam-aria-mirror-bot mirrorbot/ git clone https://github.com/breakdowns/slam-tg-mirror-bot mirrorbot/
cd mirrorbot cd mirrorbot
``` ```
@ -140,16 +138,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_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) - **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) - **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-aria-mirror-bot`. - **UPSTREAM_REPO**: Link for Bot Upstream Repo, if you want default update, fill `https://github.com/breakdowns/slam-tg-mirror-bot`.
- **UPSTREAM_BRANCH**: Branch name for Bot Upstream Repo, fill `master`. - **UPSTREAM_BRANCH**: Branch name for Bot Upstream Repo, fill `master`.
### Optional Field ### Optional Field
- **ACCOUNTS_ZIP_URL**: Only if you want to load your Service Account externally from an Index Link. Archive your Service Account json files to a zip file directly (don't archive the accounts folder. Select all the jsons inside and zip them only instead. Name the zip file with whatever you want, it doesn't matter). Fill this with the direct link of that file. - **ACCOUNTS_ZIP_URL**: Only if you want to load your Service Account externally from an Index Link. Archive your Service Account json files to a zip file directly (don't archive the accounts folder. Select all the jsons inside and zip them only instead. Name the zip file with whatever you want, it doesn't matter). 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. - **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-aria-mirror-bot/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/breakdowns/slam-tg-mirror-bot/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`. - **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). - **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. - **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-aria-mirror-bot#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/breakdowns/slam-tg-mirror-bot#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 '/' - **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_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) - **MEGA_EMAIL_ID**: Your email id you used to sign up on mega.nz for using premium accounts (Leave th)
@ -167,6 +165,9 @@ Fill up rest of the fields. Meaning of each fields are discussed below:
- **HEROKU_APP_NAME**: (Only if you deploying on Heroku) Your Heroku app name. - **HEROKU_APP_NAME**: (Only if you deploying on Heroku) Your Heroku app name.
- **IGNORE_PENDING_REQUESTS**: If you want the bot to ignore pending requests after it restarts, set this to `True`. - **IGNORE_PENDING_REQUESTS**: If you want the bot to ignore pending requests after it restarts, set this to `True`.
- **STATUS_LIMIT**: Status limit with buttons (**NOTE**: Recommend limit status to `4` tasks max). - **STATUS_LIMIT**: Status limit with buttons (**NOTE**: Recommend limit status to `4` tasks max).
- **IS_VPS**: Set it to `True` if you use VPS.
- **SERVER_PORT**: For VPS
- **BASE_URL_OF_BOT**: Your app URL Examples: `https://yourappname.herokuapp.com`
- **SHORTENER_API**: Fill your Shortener api key if you are using Shortener. - **SHORTENER_API**: Fill your Shortener api key if you are using Shortener.
- **SHORTENER**: if you want to use Shortener in Gdrive and index link, fill Shortener url here. Examples: - **SHORTENER**: if you want to use Shortener in Gdrive and index link, fill Shortener url here. Examples:
``` ```
@ -219,8 +220,8 @@ sudo docker run mirrorbot
## Deploying on Heroku ## Deploying on Heroku
- 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-aria-mirror-bot#getting-google-oauth-api-credential-file) - 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-tg-mirror-bot#getting-google-oauth-api-credential-file)
- Hit the **DEPLOY TO HEROKU** button and follow the further instructions in the screen (**NOTE**: If vars not coming, just change deploy link to your fork, Example: `https://dashboard.heroku.com/new?template=https://github.com/yourgithubname/slam-aria-mirror-bot`) - Hit the **DEPLOY TO HEROKU** button and follow the further instructions in the screen (**NOTE**: If vars not coming, just change deploy link to your fork, Example: `https://dashboard.heroku.com/new?template=https://github.com/yourgithubname/slam-tg-mirror-bot`)
- Recommended to use 1 App in 1 Heroku accounts - Recommended to use 1 App in 1 Heroku accounts
<p><a href="https://heroku.com/deploy"> <img src="https://img.shields.io/badge/Deploy%20To%20Heroku-blueviolet?style=for-the-badge&logo=heroku" width="200""/></a></p> <p><a href="https://heroku.com/deploy"> <img src="https://img.shields.io/badge/Deploy%20To%20Heroku-blueviolet?style=for-the-badge&logo=heroku" width="200""/></a></p>
@ -293,7 +294,7 @@ python3 gen_sa_accounts.py --download-keys project_id
python3 add_to_team_drive.py -d SharedTeamDriveSrcID python3 add_to_team_drive.py -d SharedTeamDriveSrcID
``` ```
# Youtube-dl authentication using [.netrc](https://github.com/breakdowns/slam-aria-mirror-bot/blob/master/.netrc) file # Youtube-dl authentication using [.netrc](https://github.com/breakdowns/slam-tg-mirror-bot/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: 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 machine host login username password my_youtube_password
@ -316,4 +317,4 @@ Thanks to:
- [breakdowns](https://github.com/breakdowns) for slam-aria-mirror-bot - [breakdowns](https://github.com/breakdowns) for slam-aria-mirror-bot
- [zevtyardt](https://github.com/zevtyardt) for some direct links - [zevtyardt](https://github.com/zevtyardt) for some direct links
And many more people who aren't mentioned here, but may be found in [Contributors](https://github.com/breakdowns/slam-aria-mirror-bot/graphs/contributors). And many more people who aren't mentioned here, but may be found in [Contributors](https://github.com/breakdowns/slam-tg-mirror-bot/graphs/contributors).

View File

@ -1,3 +1,7 @@
# Implement By - @anasty17 (https://github.com/breakdowns/slam-tg-mirror-bot/commit/0bfba523f095ab1dccad431d72561e0e002e7a59)
# (c) https://github.com/breakdowns/slam-aria-mirror-bot
# All rights reserved
import time import time
import requests import requests
import os import os

View File

@ -1,5 +1,5 @@
{ {
"name": "slam-aria-mirror-bot", "name": "slam-tg-mirror-bot",
"description": "A Telegram bot for all your mirror needs", "description": "A Telegram bot for all your mirror needs",
"logo": "https://telegra.ph/file/6507910fd06d18dfaba82.jpg", "logo": "https://telegra.ph/file/6507910fd06d18dfaba82.jpg",
"keywords": [ "keywords": [
@ -7,8 +7,8 @@
"telegram", "telegram",
"python" "python"
], ],
"repository": "https://github.com/breakdowns/slam-aria-mirror-bot", "repository": "https://github.com/breakdowns/slam-tg-mirror-bot",
"website": "https://github.com/breakdowns/slam-aria-mirror-bot", "website": "https://github.com/breakdowns/slam-tg-mirror-bot",
"success_url": "https://t.me/SlamMirrorSupport", "success_url": "https://t.me/SlamMirrorSupport",
"stack": "container", "stack": "container",
"env": { "env": {
@ -183,7 +183,20 @@
}, },
"STATUS_LIMIT": { "STATUS_LIMIT": {
"description": "Status limit with buttons, Recommend limit status to 4 tasks max.", "description": "Status limit with buttons, Recommend limit status to 4 tasks max.",
"value": "", "required": false
},
"IS_VPS": {
"description": "Only for VPS, fill False.",
"value": "False",
"required": false
},
"SERVER_PORT": {
"description": "Only for VPS, no need to fill it.",
"required": false
},
"BASE_URL_OF_BOT": {
"description": "Heroku App name web url, Examples: https://yourappname.herokuapp.com",
"value": "False",
"required": false "required": false
} }
}, },
@ -193,7 +206,7 @@
} }
], ],
"formation": { "formation": {
"worker": { "web": {
"quantity": 1, "quantity": 1,
"size": "free" "size": "free"
} }

View File

@ -7,4 +7,3 @@ aria2c --enable-rpc --check-certificate=false \
--disk-cache=64M --bt-enable-lpd=true --seed-time=0 --max-file-not-found=0 \ --disk-cache=64M --bt-enable-lpd=true --seed-time=0 --max-file-not-found=0 \
--max-tries=20 --auto-file-renaming=true --reuse-uri=true --http-accept-gzip=true \ --max-tries=20 --auto-file-renaming=true --reuse-uri=true --http-accept-gzip=true \
--content-disposition-default-utf8=true --netrc-path=/usr/src/app/.netrc --content-disposition-default-utf8=true --netrc-path=/usr/src/app/.netrc

View File

@ -88,7 +88,7 @@ def bot_help(update, context):
help_string_adm = f''' help_string_adm = f'''
/{BotCommands.HelpCommand}: To get this message /{BotCommands.HelpCommand}: To get this message
/{BotCommands.MirrorCommand} [download_url][magnet_link]: Start mirroring the link to Google Drive /{BotCommands.MirrorCommand} [download_url][magnet_link]: Start mirroring the link to Google Drive. Use /mirror qb to mirror with qBittorrent, and use /mirror qbs to select files before downloading
/{BotCommands.TarMirrorCommand} [download_url][magnet_link]: Start mirroring and upload the archived (.tar) version of the download /{BotCommands.TarMirrorCommand} [download_url][magnet_link]: Start mirroring and upload the archived (.tar) version of the download
@ -146,7 +146,7 @@ def bot_help(update, context):
help_string = f''' help_string = f'''
/{BotCommands.HelpCommand}: To get this message /{BotCommands.HelpCommand}: To get this message
/{BotCommands.MirrorCommand} [download_url][magnet_link]: Start mirroring the link to Google Drive /{BotCommands.MirrorCommand} [download_url][magnet_link]: Start mirroring the link to Google Drive. Use /mirror qb to mirror with qBittorrent, and use /mirror qbs to select files before downloading
/{BotCommands.TarMirrorCommand} [download_url][magnet_link]: Start mirroring and upload the archived (.tar) version of the download /{BotCommands.TarMirrorCommand} [download_url][magnet_link]: Start mirroring and upload the archived (.tar) version of the download

View File

@ -1,3 +1,7 @@
# Implement By - @anasty17 (https://github.com/breakdowns/slam-tg-mirror-bot/commit/0bfba523f095ab1dccad431d72561e0e002e7a59)
# (c) https://github.com/breakdowns/slam-aria-mirror-bot
# All rights reserved
import os import os
import random import random
import string import string
@ -195,4 +199,3 @@ pin_handler = CallbackQueryHandler(get_confirm, pattern="pin", run_async=True)
done_handler = CallbackQueryHandler(get_confirm, pattern="done", run_async=True) done_handler = CallbackQueryHandler(get_confirm, pattern="done", run_async=True)
dispatcher.add_handler(pin_handler) dispatcher.add_handler(pin_handler)
dispatcher.add_handler(done_handler) dispatcher.add_handler(done_handler)

View File

@ -1,3 +1,7 @@
# Implement By - @anasty17 (https://github.com/breakdowns/slam-tg-mirror-bot/commit/0bfba523f095ab1dccad431d72561e0e002e7a59)
# (c) https://github.com/breakdowns/slam-aria-mirror-bot
# All rights reserved
from bot import DOWNLOAD_DIR, LOGGER, get_client from bot import DOWNLOAD_DIR, LOGGER, get_client
from bot.helper.ext_utils.bot_utils import MirrorStatus, get_readable_file_size, get_readable_time from bot.helper.ext_utils.bot_utils import MirrorStatus, get_readable_file_size, get_readable_time
from .status import Status from .status import Status
@ -91,4 +95,3 @@ class QbDownloadStatus(Status):
LOGGER.info(f"Cancelling Download: {self.name()}") LOGGER.info(f"Cancelling Download: {self.name()}")
self.__listener.onDownloadError('Download stopped by user!') self.__listener.onDownloadError('Download stopped by user!')
self.__client.torrents_delete(torrent_hashes=self.__hash) self.__client.torrents_delete(torrent_hashes=self.__hash)

View File

@ -96,7 +96,7 @@ class GoogleDriveHelper:
regex = r"https://drive\.google\.com/(drive)?/?u?/?\d?/?(mobile)?/?(file)?(folders)?/?d?/([-\w]+)[?+]?/?(w+)?" regex = r"https://drive\.google\.com/(drive)?/?u?/?\d?/?(mobile)?/?(file)?(folders)?/?d?/([-\w]+)[?+]?/?(w+)?"
res = re.search(regex,link) res = re.search(regex,link)
if res is None: if res is None:
raise IndexError("GDrive ID not found.") raise IndexError("G-Drive ID not found.")
return res.group(5) return res.group(5)
parsed = urlparse.urlparse(link) parsed = urlparse.urlparse(link)
return parse_qs(parsed.query)['id'][0] return parse_qs(parsed.query)['id'][0]
@ -117,7 +117,7 @@ class GoogleDriveHelper:
resumable=False) resumable=False)
file_metadata = { file_metadata = {
'name': file_name, 'name': file_name,
'description': 'Uploaded using Slam Aria Mirror Bot', 'description': 'Uploaded using Slam Tg Mirror Bot',
'mimeType': mime_type, 'mimeType': mime_type,
} }
if parent_id is not None: if parent_id is not None:
@ -171,7 +171,7 @@ class GoogleDriveHelper:
# File body description # File body description
file_metadata = { file_metadata = {
'name': file_name, 'name': file_name,
'description': 'Uploaded by Slam Aria Mirror Bot', 'description': 'Uploaded by Slam Tg Mirror Bot',
'mimeType': mime_type, 'mimeType': mime_type,
} }
try: try:
@ -363,7 +363,7 @@ class GoogleDriveHelper:
try: try:
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
msg = "" msg = ""
LOGGER.info(f"File ID: {file_id}") LOGGER.info(f"File ID: {file_id}")
@ -492,7 +492,7 @@ class GoogleDriveHelper:
file_id = file.get("id") file_id = file.get("id")
if not IS_TEAM_DRIVE: if not IS_TEAM_DRIVE:
self.__set_permission(file_id) self.__set_permission(file_id)
LOGGER.info("Created Google-Drive Folder:\nName: {}\nID: {} ".format(file.get("name"), file_id)) LOGGER.info("Created G-Drive Folder:\nName: {}\nID: {} ".format(file.get("name"), file_id))
return file_id return file_id
def upload_dir(self, input_directory, parent_id): def upload_dir(self, input_directory, parent_id):
@ -557,9 +557,9 @@ class GoogleDriveHelper:
content += f'<b> | <a href="https://telegra.ph/{self.path[nxt_page]}">Next</a></b>' content += f'<b> | <a href="https://telegra.ph/{self.path[nxt_page]}">Next</a></b>'
nxt_page += 1 nxt_page += 1
Telegraph(access_token=telegraph_token).edit_page(path = self.path[prev_page], Telegraph(access_token=telegraph_token).edit_page(path = self.path[prev_page],
title = 'Slam Aria Mirror Bot Search', title = 'Slam Tg Mirror Bot Search',
author_name='Slam Aria Mirror Bot', author_name='Slam Tg Mirror Bot',
author_url='https://github.com/breakdowns/slam-aria-mirror-bot', author_url='https://github.com/breakdowns/slam-tg-mirror-bot',
html_content=content) html_content=content)
return return
@ -642,9 +642,9 @@ class GoogleDriveHelper:
for content in self.telegraph_content : for content in self.telegraph_content :
self.path.append(Telegraph(access_token=telegraph_token).create_page( self.path.append(Telegraph(access_token=telegraph_token).create_page(
title = 'Slam Aria Mirror Bot Search', title = 'Slam Tg Mirror Bot Search',
author_name='Slam Aria Mirror Bot', author_name='Slam Tg Mirror Bot',
author_url='https://github.com/breakdowns/slam-aria-mirror-bot', author_url='https://github.com/breakdowns/slam-tg-mirror-bot',
html_content=content html_content=content
)['path']) )['path'])
@ -665,7 +665,7 @@ class GoogleDriveHelper:
try: try:
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
msg = "" msg = ""
LOGGER.info(f"File ID: {file_id}") LOGGER.info(f"File ID: {file_id}")
@ -728,7 +728,7 @@ class GoogleDriveHelper:
try: try:
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:

View File

@ -1,4 +1,4 @@
# Implement By - @anasty17 (https://github.com/breakdowns/slam-aria-mirror-bot/pull/111) # Implement By - @anasty17 (https://github.com/breakdowns/slam-tg-mirror-bot/pull/111)
# (c) https://github.com/breakdowns/slam-aria-mirror-bot # (c) https://github.com/breakdowns/slam-aria-mirror-bot
# All rights reserved # All rights reserved

View File

@ -57,7 +57,7 @@ async def update_it(client, message):
ups_rem.pull(UPSTREAM_BRANCH) ups_rem.pull(UPSTREAM_BRANCH)
except GitCommandError: except GitCommandError:
repo.git.reset("--hard", "FETCH_HEAD") repo.git.reset("--hard", "FETCH_HEAD")
subprocess.run(["pip3", "install", "--no-cache-dir", "-r", "requirements"]) subprocess.run(["pip3", "install", "--no-cache-dir", "-r", "requirements.txt"])
await msg_.edit("`Updated Sucessfully! Give Me Some Time To Restart!`") await msg_.edit("`Updated Sucessfully! Give Me Some Time To Restart!`")
with open("./aria.sh", 'rb') as file: with open("./aria.sh", 'rb') as file:
script = file.read() script = file.read()

View File

@ -30,9 +30,9 @@ BLOCK_MEGA_LINKS = ""
STOP_DUPLICATE = "" STOP_DUPLICATE = ""
SHORTENER = "" SHORTENER = ""
SHORTENER_API = "" SHORTENER_API = ""
#Qbittorrent # qBittorrent
IS_VPS = "" IS_VPS = ""
SERVER_PORT = "80" #For VPS SERVER_PORT = "80" # For VPS
BASE_URL_OF_BOT = "" BASE_URL_OF_BOT = ""
# If you want to use Credentials externally from Index Links, fill these vars with the direct links # If you want to use Credentials externally from Index Links, fill these vars with the direct links
# These are optional, if you don't know, simply leave them, don't fill anything in them. # These are optional, if you don't know, simply leave them, don't fill anything in them.

View File

@ -137,4 +137,3 @@ def get_readable_file_size(size_in_bytes) -> str:
return f'{round(size_in_bytes, 2)}{SIZE_UNITS[index]}' return f'{round(size_in_bytes, 2)}{SIZE_UNITS[index]}'
except IndexError: except IndexError:
return 'File too large' return 'File too large'

View File

@ -36,7 +36,7 @@ p { font-size: 12px; margin: 24px;}
</style> </style>
</head> </head>
<body> <body>
<h1>Slam-mirror-bot : <a href="#">Github</a></h1> <h1>slam-tg-mirror-bot: <a href="#">Github</a></h1>
<form action="{form_url}" method="POST"> <form action="{form_url}" method="POST">
{My_content} {My_content}