Add loading credentials externally, Remove video tutorial, many commits have been left behind, fix typo

Co-authored-by: NOOBZ ID <noobzhax@users.noreply.github.com>
Co-authored-by: Katarina Novi <yayanksenpai@pm.me>
Signed-off-by: breakdowns <hafitz666@outlook.co.id>
This commit is contained in:
Hafitz Setya 2021-06-25 09:14:03 +07:00 committed by GitHub
parent 864df08467
commit c281737bb6
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 9 deletions

View File

@ -139,6 +139,8 @@ Fill up rest of the fields. Meaning of each fields are discussed below:
- **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/breakdowns/slam-mirrorbot```.
- **UPSTREAM_BRANCH**: Branch name for Bot Upstream Repo (Recommended using master branch) - **UPSTREAM_BRANCH**: Branch name for Bot Upstream Repo (Recommended using master branch)
### Optional Field ### Optional Field
- **ACCOUNTS_ZIP_URL**: (Optional) Only if you want to load your service accs externally from an index link. Archive your service accs 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**: (Optional) Only if you want to load your token.pickle externally from an index link. Fill this with the direct link of that file.
- **AUTHORIZED_CHATS**: Fill user_id and chat_id of you want to authorize. - **AUTHORIZED_CHATS**: Fill user_id and chat_id of you want to authorize.
- **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-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/breakdowns/slam-mirrorbot#generate-service-accounts-what-is-service-account) section below.
@ -214,7 +216,7 @@ sudo docker run mirrorbot
- Give stars and 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 - 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) - **NOTE**: If you didn't upload **token.pickle**, uploading will not work, or you can upload your **token.pickle** to your Index and put your **token.pickle** link to **TOKEN_PICKLE_URL**. How to generate **token.pickle**? [Read here](https://github.com/breakdowns/slam-mirrorbot#getting-google-oauth-api-credential-file)
- 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>
@ -222,11 +224,6 @@ sudo docker run mirrorbot
## Deploying on Heroku with heroku-cli and Goorm IDE ## 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> <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>
## Video Tutorial deploying slam-mirrorbot on Heroku
<p><a href="https://www.youtube.com/watch?v=WIhL0TrisfQ&t=1s"> <img src="https://img.shields.io/badge/See%20On%20Youtube-black?style=for-the-badge&logo=youtube" width="200""/></a></p>
**NOTE**: Recommended to generate **token.pickle** manually. [Read here](https://github.com/breakdowns/slam-mirrorbot#getting-google-oauth-api-credential-file)
# Using Service Accounts for uploading to avoid user rate limit # 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, 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. Many thanks to [AutoRClone](https://github.com/xyou365/AutoRclone) for the scripts.

View File

@ -149,6 +149,14 @@
"value": "https://telegra.ph/file/db03910496f06094f1f7a.jpg", "value": "https://telegra.ph/file/db03910496f06094f1f7a.jpg",
"required": false "required": false
}, },
"TOKEN_PICKLE_URL": {
"description": "(Optional) Only if you want to load your token.pickle externally from an index link. Fill this with the direct link of that file.",
"required": false
},
"ACCOUNTS_ZIP_URL": {
"description": "(Optional) Only if you want to load your service accs externally from an index link. Archive your service accs 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.",
"required": false
},
"VIEW_LINK": { "VIEW_LINK": {
"description": "View Link button to open file Index Link in browser instead of direct download link, you can figure out if it's compatible with your Index code or not, open any video from you Index and check if the END of link from browser link bar is ?a=view, if yes make it True it will work (Compatible with Bhadoo Index Code).", "description": "View Link button to open file Index Link in browser instead of direct download link, you can figure out if it's compatible with your Index code or not, open any video from you Index and check if the END of link from browser link bar is ?a=view, if yes make it True it will work (Compatible with Bhadoo Index Code).",
"value": "False", "value": "False",

View File

@ -153,11 +153,11 @@ class MegaDownloadHelper:
executor.do(api.login, (MEGA_EMAIL_ID, MEGA_PASSWORD)) executor.do(api.login, (MEGA_EMAIL_ID, MEGA_PASSWORD))
link_type = get_mega_link_type(mega_link) link_type = get_mega_link_type(mega_link)
if link_type == "file": if link_type == "file":
LOGGER.info("File. If your download didn't start, then check your link if it's avialable to download") LOGGER.info("File. If your download didn't start, then check your link if it's available to download")
executor.do(api.getPublicNode, (mega_link,)) executor.do(api.getPublicNode, (mega_link,))
node = mega_listener.public_node node = mega_listener.public_node
else: else:
LOGGER.info("Folder. If your download didn't start, then check your link if it's avialable to download") LOGGER.info("Folder. If your download didn't start, then check your link if it's available to download")
folder_api = MegaApi(MEGA_API_KEY,None,None,'TgBot') folder_api = MegaApi(MEGA_API_KEY,None,None,'TgBot')
folder_api.addListener(mega_listener) folder_api.addListener(mega_listener)
executor.do(folder_api.loginToFolder, (mega_link,)) executor.do(folder_api.loginToFolder, (mega_link,))

View File

@ -31,6 +31,10 @@ STOP_DUPLICATE_MEGA = ""
SHORTENER = "" SHORTENER = ""
SHORTENER_API = "" SHORTENER_API = ""
IMAGE_URL = "https://telegra.ph/file/db03910496f06094f1f7a.jpg" IMAGE_URL = "https://telegra.ph/file/db03910496f06094f1f7a.jpg"
# 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.
ACCOUNTS_ZIP_URL = ""
TOKEN_PICKLE_URL = ""
# To use limit leave space between number and unit. Available units is (gb or GB, tb or TB) # To use limit leave space between number and unit. Available units is (gb or GB, tb or TB)
TORRENT_DIRECT_LIMIT = "" TORRENT_DIRECT_LIMIT = ""
CLONE_LIMIT = "" CLONE_LIMIT = ""

View File

@ -1 +1,11 @@
./aria.sh; python3 -m bot if [[ -n $TOKEN_PICKLE_URL ]]; then
wget -q $TOKEN_PICKLE_URL -O /usr/src/app/token.pickle
fi
if [[ -n $ACCOUNTS_ZIP_URL ]]; then
wget -q $ACCOUNTS_ZIP_URL -O /usr/src/app/accounts.zip
unzip accounts.zip -d /usr/src/app/accounts
rm accounts.zip
fi
./aria.sh; python3 -m bot