forked from priiiiyo/tg-mirror-leech-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Addded Mega Download Support For Complex And Big Size(100-200+) Folders.Read The Msg About Mega Download Below. * Added Support For UpToBox Links (Premium Account Needed). * Added Ability To Do Speed Test Of The Host. (/speedtest Command). * Added Support For Indian Streaming Sites Like Hotstar, Zee5, Mx Player, Voot, And Many Others........ * Added Custom User Agent ,Peer Agent..Transmission For Now.
- Loading branch information
S M Mahabub Hossain (Priyo)
committed
Mar 19, 2021
1 parent
affa68c
commit d8626aa
Showing
25 changed files
with
2,089 additions
and
2,065 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 |
---|---|---|
@@ -1,27 +1,29 @@ | ||
FROM lzzy12/mega-sdk-python:latest | ||
|
||
WORKDIR /usr/src/app | ||
RUN chmod 777 /usr/src/app | ||
|
||
RUN apt-get -qq update && \ | ||
apt-get install -y software-properties-common && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
apt-add-repository non-free && \ | ||
apt-get -qq update && \ | ||
apt-get -qq install -y p7zip-full p7zip-rar aria2 curl pv jq ffmpeg locales python3-lxml && \ | ||
apt-get purge -y software-properties-common | ||
|
||
COPY 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 | ||
RUN pip3 install --no-cache-dir -r requirements.txt | ||
RUN locale-gen en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
COPY . . | ||
COPY netrc /root/.netrc | ||
RUN chmod +x aria.sh | ||
|
||
CMD ["bash","start.sh"] | ||
FROM iamliquidx/megasdk:latest | ||
|
||
WORKDIR /usr/src/app | ||
RUN chmod 777 /usr/src/app | ||
|
||
RUN apt-get -qq update && \ | ||
apt-get install -y software-properties-common && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
apt-add-repository non-free && \ | ||
apt-get -qq update && \ | ||
apt-get -qq install -y p7zip-full p7zip-rar aria2 curl pv jq ffmpeg locales python3-lxml && \ | ||
apt-get purge -y software-properties-common | ||
|
||
COPY 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 | ||
RUN pip3 install --no-cache-dir -r requirements.txt | ||
RUN locale-gen en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
COPY . . | ||
COPY netrc /root/.netrc | ||
RUN chmod +x aria.sh | ||
|
||
CMD ["bash","start.sh"] | ||
|
||
|
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 |
---|---|---|
@@ -1,77 +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": "fileOrganizer", | ||
"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) | ||
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": "fileOrganizer", | ||
"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 |
---|---|---|
@@ -1 +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 | ||
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
export MAX_DOWNLOAD_SPEED=0 | ||
tracker_list=$(curl -Ns https://raw.githubusercontent.com/iamLiquidX/trackerlistx/main/trackers.txt | awk '$1' | tr '\n' ',') | ||
export MAX_CONCURRENT_DOWNLOADS=4 | ||
aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --check-certificate=false\ | ||
--max-connection-per-server=10 --rpc-max-request-size=1024M \ | ||
--bt-tracker="[$tracker_list]" --bt-max-peers=0 --seed-time=0.01 --min-split-size=10M \ | ||
--follow-torrent=mem --split=10 \ | ||
--daemon=true --allow-overwrite=true --max-overall-download-limit=$MAX_DOWNLOAD_SPEED \ | ||
--max-overall-upload-limit=1K --max-concurrent-downloads=$MAX_CONCURRENT_DOWNLOADS \ | ||
--peer-id-prefix=-TR2770- --user-agent=Transmission/2.77 --peer-agent=Transmission/2.77 \ | ||
export MAX_DOWNLOAD_SPEED=0 | ||
tracker_list=$(curl -Ns https://raw.githubusercontent.com/iamLiquidX/trackerlistx/main/trackers.txt | awk '$1' | tr '\n' ',') | ||
export MAX_CONCURRENT_DOWNLOADS=4 | ||
aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --check-certificate=false\ | ||
--max-connection-per-server=10 --rpc-max-request-size=1024M \ | ||
--bt-tracker="[$tracker_list]" --bt-max-peers=0 --seed-time=0.01 --min-split-size=10M \ | ||
--follow-torrent=mem --split=10 \ | ||
--daemon=true --allow-overwrite=true --max-overall-download-limit=$MAX_DOWNLOAD_SPEED \ | ||
--max-overall-upload-limit=1K --max-concurrent-downloads=$MAX_CONCURRENT_DOWNLOADS \ | ||
--peer-id-prefix=-TR2770- --user-agent=Transmission/2.77 --peer-agent=Transmission/2.77 \ |
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
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
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
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
Oops, something went wrong.