From 56bc6b3a54affe31e49de7a86982fef34fe0f3c1 Mon Sep 17 00:00:00 2001 From: Anas <77075674+anasty17@users.noreply.github.com> Date: Wed, 2 Jun 2021 08:49:36 +0300 Subject: [PATCH] Add index credentials built in code and some notes (#124) * Add index credentials built in code and some notes * fix --- Dockerfile | 1 + README.md | 44 ++++++++++++++++++++++++++++++++++++++++---- aria.sh | 2 +- config_sample.env | 2 +- 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8c6c1ab6574..e5be25b60f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 COPY . . COPY .netrc /root/.netrc +Run chmod 600 /usr/src/app/.netrc RUN chmod +x aria.sh CMD ["bash","start.sh"] diff --git a/README.md b/README.md index 047f99bbef2..922c7e72e28 100644 --- a/README.md +++ b/README.md @@ -211,13 +211,45 @@ Many thanks to [AutoRClone](https://github.com/xyou365/AutoRclone) for the scrip Let us create only the Service Accounts that we need. **Warning**: abuse of this feature is not the aim of this project and we do **NOT** recommend that you make a lot of projects, just one project and 100 SAs allow you plenty of use, its also possible that over abuse might get your projects banned by Google. +`Note: 1 Service Account can copy around 750gb a day, 1 project can make 100 Service Accounts so that's 75tb a day, for most users this should easily suffice. ` ``` -Note: 1 Service Account can copy around 750gb a day, 1 project can make 100 Service Accounts so that's 75tb a day, for most users this should easily suffice. +python3 gen_sa_accounts.py --quick-setup 1 --new-only ``` +A folder named accounts will be created which will contain keys for the Service Accounts -`python3 gen_sa_accounts.py --quick-setup 1 --new-only` +OR you can create service accounts to current project, no need to create new one. -A folder named accounts will be created which will contain keys for the Service Accounts +1. List your projests ids +``` +python3 gen_sa_accounts.py --list-projects +``` +2. Enable services automatically by this cmd +``` +python3 gen_sa_accounts.py --enable-services $PROJECTID +``` +3. Create sevice accounts to current project +``` +python3 gen_sa_accounts.py --create-sas $PROJECTID +``` +4. Download sevice accounts as accounts folder +``` +python3 gen_sa_accounts.py --download-keys $PROJECTID +``` +If u want to add service accounts to google group so follow these steps also + +5. Mount accounts folder +``` +cd accounts +``` +6. Grab emails form all accounts to emails.txt file that would be created in accounts folder +``` +grep -oPh '"client_email": "\K[^"]+' *.json > emails.txt +``` +7. Unmount acounts folder +``` +cd - +``` +Then add emails from emails.txt to google group, after that add google group to your shared drive and promote it to (manager). **NOTE**: If you have created SAs in past from this script, you can also just re download the keys by running: ``` @@ -231,10 +263,14 @@ python3 add_to_team_drive.py -d SharedTeamDriveSrcID ``` # Youtube-dl authentication using .netrc file -For using your premium accounts in Youtube-dl, 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 ``` +For index link with only password without username, even http auth will not work, so this is the solution. +``` +machine example.workers.dev password index_password +``` Where host is the name of extractor (eg. Youtube, Twitch). Multiple accounts of different hosts can be added each separated by a new line. # Credits diff --git a/aria.sh b/aria.sh index e0ba56a2b6e..094d90845d4 100755 --- a/aria.sh +++ b/aria.sh @@ -12,4 +12,4 @@ aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --check-certif --disk-cache=64M --file-allocation=prealloc --continue=true \ --max-file-not-found=5 --max-tries=20 --auto-file-renaming=true \ --bt-enable-lpd=true --seed-time=0.01 --seed-ratio=1.0 \ - --content-disposition-default-utf8=true --http-accept-gzip=true --reuse-uri=true + --content-disposition-default-utf8=true --http-accept-gzip=true --reuse-uri=true --netrc-path=/usr/src/app/.netrc diff --git a/config_sample.env b/config_sample.env index 6ec0c51c0b6..9f7c77b9916 100644 --- a/config_sample.env +++ b/config_sample.env @@ -5,7 +5,7 @@ _____REMOVE_THIS_LINE_____=True BOT_TOKEN = "" GDRIVE_FOLDER_ID = "" OWNER_ID = -DOWNLOAD_DIR = "/home/slam/mirror-bot/downloads" +DOWNLOAD_DIR = "/usr/src/app/downloads" DOWNLOAD_STATUS_UPDATE_INTERVAL = 5 AUTO_DELETE_MESSAGE_DURATION = 20 IS_TEAM_DRIVE = ""