-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alphakas
authored and
Alphakas
committed
Sep 15, 2021
0 parents
commit 6c21906
Showing
76 changed files
with
8,354 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM breakdowns/mega-sdk-python:latest | ||
|
||
WORKDIR /usr/src/app | ||
RUN chmod 777 /usr/src/app | ||
|
||
COPY requirements.txt . | ||
RUN pip3 install --no-cache-dir -r requirements.txt | ||
|
||
COPY extract /usr/local/bin | ||
COPY pextract /usr/local/bin | ||
RUN chmod +x /usr/local/bin/extract && chmod +x /usr/local/bin/pextract | ||
COPY . . | ||
COPY .netrc /root/.netrc | ||
RUN chmod 600 /usr/src/app/.netrc | ||
RUN chmod +x aria.sh | ||
|
||
CMD ["bash","start.sh"] |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Slam Mirror Bot | ||
|
||
Credit to original creator https://github.com/SlamDevs/slam-mirrorbot | ||
|
||
# Deploy to heroku and follow the instruction | ||
|
||
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://github.com/kzinthant-kas/slam_easy_deploy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
from __future__ import print_function | ||
from google.oauth2.service_account import Credentials | ||
import googleapiclient.discovery, json, progress.bar, glob, sys, argparse, time | ||
from google_auth_oauthlib.flow import InstalledAppFlow | ||
from google.auth.transport.requests import Request | ||
import os, pickle | ||
|
||
stt = time.time() | ||
|
||
parse = argparse.ArgumentParser( | ||
description='A tool to add service accounts to a shared drive from a folder containing credential files.') | ||
parse.add_argument('--path', '-p', default='accounts', | ||
help='Specify an alternative path to the service accounts folder.') | ||
parse.add_argument('--credentials', '-c', default='./credentials.json', | ||
help='Specify the relative path for the credentials file.') | ||
parse.add_argument('--yes', '-y', default=False, action='store_true', help='Skips the sanity prompt.') | ||
parsereq = parse.add_argument_group('required arguments') | ||
parsereq.add_argument('--drive-id', '-d', help='The ID of the Shared Drive.', required=True) | ||
|
||
args = parse.parse_args() | ||
acc_dir = args.path | ||
did = args.drive_id | ||
credentials = glob.glob(args.credentials) | ||
|
||
try: | ||
open(credentials[0], 'r') | ||
print('>> Found credentials.') | ||
except IndexError: | ||
print('>> No credentials found.') | ||
sys.exit(0) | ||
|
||
if not args.yes: | ||
# input('Make sure the following client id is added to the shared drive as Manager:\n' + json.loads((open( | ||
# credentials[0],'r').read()))['installed']['client_id']) | ||
input('>> Make sure the **Google account** that has generated credentials.json\n is added into your Team Drive ' | ||
'(shared drive) as Manager\n>> (Press any key to continue)') | ||
|
||
creds = None | ||
if os.path.exists('token_sa.pickle'): | ||
with open('token_sa.pickle', 'rb') as token: | ||
creds = pickle.load(token) | ||
# If there are no (valid) credentials available, let the user log in. | ||
if not creds or not creds.valid: | ||
if creds and creds.expired and creds.refresh_token: | ||
creds.refresh(Request()) | ||
else: | ||
flow = InstalledAppFlow.from_client_secrets_file(credentials[0], scopes=[ | ||
'https://www.googleapis.com/auth/admin.directory.group', | ||
'https://www.googleapis.com/auth/admin.directory.group.member' | ||
]) | ||
# creds = flow.run_local_server(port=0) | ||
creds = flow.run_console() | ||
# Save the credentials for the next run | ||
with open('token_sa.pickle', 'wb') as token: | ||
pickle.dump(creds, token) | ||
|
||
drive = googleapiclient.discovery.build("drive", "v3", credentials=creds) | ||
batch = drive.new_batch_http_request() | ||
|
||
aa = glob.glob('%s/*.json' % acc_dir) | ||
pbar = progress.bar.Bar("Readying accounts", max=len(aa)) | ||
for i in aa: | ||
ce = json.loads(open(i, 'r').read())['client_email'] | ||
batch.add(drive.permissions().create(fileId=did, supportsAllDrives=True, body={ | ||
"role": "organizer", | ||
"type": "user", | ||
"emailAddress": ce | ||
})) | ||
pbar.next() | ||
pbar.finish() | ||
print('Adding...') | ||
batch.execute() | ||
|
||
print('Complete.') | ||
hours, rem = divmod((time.time() - stt), 3600) | ||
minutes, sec = divmod(rem, 60) | ||
print("Elapsed Time:\n{:0>2}:{:0>2}:{:05.2f}".format(int(hours), int(minutes), sec)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Implement By - @anasty17 (https://github.com/SlamDevs/slam-mirrorbot/commit/0bfba523f095ab1dccad431d72561e0e002e7a59) | ||
# (c) https://github.com/SlamDevs/slam-mirrorbot | ||
# All rights reserved | ||
|
||
import time | ||
import requests | ||
import os | ||
|
||
BASE_URL = os.environ.get('BASE_URL_OF_BOT', None) | ||
if len(BASE_URL) == 0: | ||
BASE_URL = None | ||
|
||
IS_VPS = os.environ.get('IS_VPS', 'False') | ||
IS_VPS = IS_VPS.lower() == 'true' | ||
if not IS_VPS and BASE_URL is not None: | ||
while True: | ||
time.sleep(600) | ||
status = requests.get(BASE_URL).status_code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ | ||
"name": "Slam Mirror Bot", | ||
"description": "Slam Mirror Bot with easy deployment", | ||
"repository": "https://github.com/kzinthant-kas/slam_easy_deploy", | ||
"keywords": ["Slam","Slam Mirror Bot"], | ||
"website": "https://t.me/drivetalk", | ||
"success_url": "https://github.com/kzinthant-kas/slam_easy_deploy/main/README.md", | ||
"env": { | ||
"bot_token":{ | ||
"description": "Get one from @botfather", | ||
"required":true | ||
}, | ||
"ownder_id":{ | ||
"description": "https://t.me/MissRose_bot in MissRose, type /id and put here", | ||
"required":true | ||
}, | ||
"gdrive_folder_id":{ | ||
"description": "Your google drive folder id", | ||
"required":true | ||
}, | ||
"is_team_drive":{ | ||
"description": "If your folder is in team drive, put True" | ||
}, | ||
"telegram_api_id":{ | ||
"description": "Get from my.telegram.org, App api_id", | ||
"required":true | ||
}, | ||
"telegram_api_hash":{ | ||
"description": "Get from my.telegram.org, App api_hash", | ||
"required":true | ||
}, | ||
"authorized_chats":{ | ||
"description": "Authorized chat ids split by space" | ||
}, | ||
"sudo_users":{ | ||
"description": "Sudo users split by space" | ||
}, | ||
"use_service_accounts":{ | ||
"description": "If you use service accounts, put True" | ||
}, | ||
"accounts_zip_url":{ | ||
"description": "If you want to use service accounts, put direct download link for service accounts (accounts.zip) named" | ||
}, | ||
"mega_api_key":{ | ||
"description": "If you want to use pro mega, get this from mega.nz/sdk" | ||
}, | ||
"mega_email_id":{ | ||
"description": "If you use mega, put your email" | ||
}, | ||
"mega_password":{ | ||
"description": "If you use mega, put your password" | ||
}, | ||
"mega_limit":{ | ||
"description": "To limit the size of Mega download (leave space between number and unit, available units are (gb or GB, tb or TB), Examples: 100 gb, 100 GB, 10 tb, 10 TB" | ||
}, | ||
"clone_limit":{ | ||
"description": "To limit the size of Google Drive folder/file which you can clone (leave space between number and unit, Available units are (gb or GB, tb or TB), Examples: 100 gb, 100 GB, 10 tb, 10 TB" | ||
}, | ||
"base_url_of_bot":{ | ||
"description": "https://yourappname.herokuapp.com", | ||
"required": true | ||
}, | ||
"token_pickle_url": { | ||
"description": "Required for authentication, put your direct download link here", | ||
"required": true | ||
}, | ||
"button_four_name":{ | ||
"description": "The fourth button name" | ||
}, | ||
"button_four_url":{ | ||
"description": "The link for fourth url" | ||
}, | ||
"button_five_name":{ | ||
"description": "The fivth button name" | ||
}, | ||
"button_five_url":{ | ||
"description": "The link for fivth url" | ||
}, | ||
"button_six_name":{ | ||
"description": "The sixth button name" | ||
}, | ||
"button_six_url":{ | ||
"description": "The link for sixth url" | ||
} | ||
}, | ||
"stack": "container" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --max-connection-per-server=10 --rpc-max-request-size=1024M --seed-time=0.01 --min-split-size=10M --follow-torrent=mem --split=10 --daemon=true --allow-overwrite=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
tracker_list=$(curl -Ns https://raw.githubusercontent.com/XIU2/TrackersListCollection/master/all.txt https://ngosang.github.io/trackerslist/trackers_all_http.txt https://newtrackon.com/api/all https://raw.githubusercontent.com/DeSireFire/animeTrackerList/master/AT_all.txt https://raw.githubusercontent.com/hezhijie0327/Trackerslist/main/trackerslist_tracker.txt https://raw.githubusercontent.com/hezhijie0327/Trackerslist/main/trackerslist_exclude.txt | awk '$0' | tr '\n\n' ',') | ||
aria2c --enable-rpc --check-certificate=false \ | ||
--max-connection-per-server=10 --rpc-max-request-size=1024M --bt-max-peers=0 \ | ||
--bt-stop-timeout=0 --min-split-size=10M --follow-torrent=mem --split=10 \ | ||
--daemon=true --allow-overwrite=true --max-overall-download-limit=0 --bt-tracker="[$tracker_list]"\ | ||
--max-overall-upload-limit=1K --max-concurrent-downloads=15 --continue=true \ | ||
--peer-id-prefix=-qB4360- --user-agent=qBittorrent/4.3.6 --peer-agent=qBittorrent/4.3.6 \ | ||
--disk-cache=32M --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 \ | ||
--content-disposition-default-utf8=true --netrc-path=/usr/src/app/.netrc |
Oops, something went wrong.