{"id":19295753,"url":"https://github.com/xditya/mirror2gdrive","last_synced_at":"2026-06-18T17:31:21.051Z","repository":{"id":106416171,"uuid":"268774760","full_name":"xditya/Mirror2GDrive","owner":"xditya","description":null,"archived":false,"fork":false,"pushed_at":"2020-06-02T11:00:36.000Z","size":63,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-24T00:41:37.868Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xditya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-02T10:48:40.000Z","updated_at":"2021-02-16T05:36:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"2254ae9b-4686-46d0-a3f1-2bf7fa88fe8d","html_url":"https://github.com/xditya/Mirror2GDrive","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"lzzy12/python-aria-mirror-bot","purl":"pkg:github/xditya/Mirror2GDrive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xditya%2FMirror2GDrive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xditya%2FMirror2GDrive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xditya%2FMirror2GDrive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xditya%2FMirror2GDrive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xditya","download_url":"https://codeload.github.com/xditya/Mirror2GDrive/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xditya%2FMirror2GDrive/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34501472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T22:44:22.329Z","updated_at":"2026-06-18T17:31:21.031Z","avatar_url":"https://github.com/xditya.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is this repo about?\nThis is a telegram bot writen in python for mirroring files on the internet to our beloved Google Drive.\n\n# Inspiration \nThis project is heavily inspired from @out386 's telegram bot which is written in JS.\n\n# Features supported:\n- Mirroring direct download links to google drive\n- Download progress\n- Upload progress\n- Download/upload speeds and ETAs\n- Docker support\n- Uploading To Team Drives.\n- Index Link support\n- Service account support\n- Mirror all youtube-dl supported links\n- Mirror telegram files\n\n# Upcoming features (TODOs):\n\n# How to deploy?\nDeploying is pretty much straight forward and is divided into several steps as follows:\n## Installing requirements\n\n- Clone this repo:\n```\ngit clone https://github.com/lzzy12/python-aria-mirror-bot mirror-bot/\ncd mirror-bot\n```\n\n- Install requirements\nFor Debian based distros\n```\nsudo apt install python3\n```\nInstall Docker by following the [official docker docs](https://docs.docker.com/engine/install/debian/)\n\n\n- For Arch and it's derivatives:\n```\nsudo pacman -S docker python\n```\n\n## Setting up config file\n```\ncp config_sample.env config.env\n```\n- Remove the first line saying:\n```\n_____REMOVE_THIS_LINE_____=True\n```\nFill up rest of the fields. Meaning of each fields are discussed below:\n- **BOT_TOKEN** : The telegram bot token that you get from @BotFather\n- **GDRIVE_FOLDER_ID** : This is the folder ID of the Google Drive Folder to which you want to upload all the mirrors.\n- **DOWNLOAD_DIR** : The path to the local folder where the downloads should be downloaded to\n- **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)  \n- **OWNER_ID** : The Telegram user ID (not username) of the owner of the bot\n- **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\n- **IS_TEAM_DRIVE** : (Optional field) Set to \"True\" if GDRIVE_FOLDER_ID is from a Team Drive else False or Leave it empty.\n- **USE_SERVICE_ACCOUNTS**: (Optional field) (Leave empty if unsure) Whether to use service accounts or not. For this to work see  \"Using service accounts\" section below.\n- **INDEX_URL** : (Optional field) Refer to https://github.com/maple3142/GDIndex/ The URL should not have any trailing '/'\n- **TELEGRAM_API** : This is to authenticate to your telegram account for downloading Telegram files. You can get this from https://my.telegram.org DO NOT put this in quotes.\n- **TELEGRAM_HASH** : This is to authenticate to your telegram account for downloading Telegram files. You can get this from https://my.telegram.org\n- **USER_SESSION_STRING** : Session string generated by running:\n```\npython3 generate_string_session.py\n```\nNote: You can limit maximum concurrent downloads by changing the value of MAX_CONCURRENT_DOWNLOADS in aria.sh. By default, it's set to 2\n \n## Getting Google OAuth API credential file\n\n- Visit the [Google Cloud Console](https://console.developers.google.com/apis/credentials)\n- Go to the OAuth Consent tab, fill it, and save.\n- Go to the Credentials tab and click Create Credentials -\u003e OAuth Client ID\n- Choose Other and Create.\n- Use the download button to download your credentials.\n- Move that file to the root of mirror-bot, and rename it to credentials.json\n- Visit [Google API page](https://console.developers.google.com/apis/library)\n- Search for Drive and enable it if it is disabled\n- Finally, run the script to generate token file (token.pickle) for Google Drive:\n```\npip install google-api-python-client google-auth-httplib2 google-auth-oauthlib\npython3 generate_drive_token.py\n```\n## Deploying\n\n- Start docker daemon (skip if already running):\n```\nsudo dockerd\n```\n- Build Docker image:\n```\nsudo docker build . -t mirror-bot\n```\n- Run the image:\n```\nsudo docker run mirror-bot\n```\n\n# Using service accounts for uploading to avoid user rate limit\nFor Service Account to work, you must set USE_SERVICE_ACCOUNTS=\"True\" in config file or environment variables\nMany thanks to [AutoRClone](https://github.com/xyou365/AutoRclone) for the scripts\n## Generating service accounts\nStep 1. Generate service accounts [What is service account](https://cloud.google.com/iam/docs/service-accounts)\n---------------------------------\nLet us create only the service accounts that we need. \n**Warning:** abuse of this feature is not the aim of autorclone and we do **NOT** recommend that you make a lot of projects, just one project and 100 sa allow you plenty of use, its also possible that overabuse might get your projects banned by google. \n\n```\nNote: 1 service account can copy around 750gb a day, 1 project makes 100 service accounts so thats 75tb a day, for most users this should easily suffice. \n```\n\n`python3 gen_sa_accounts.py --quick-setup 1 --new-only`\n\nA folder named accounts will be created which will contain keys for the service accounts created\n\nNOTE: If you have created SAs in past from this script, you can also just re download the keys by running:\n```\npython3 gen_sa_accounts.py --download-keys project_id\n```\n\n### Add all the service accounts to the Team Drive or folder\n- Run:\n```\npython3 add_to_team_drive.py -d SharedTeamDriveSrcID\n```\n\n# Youtube-dl authentication using .netrc file\nFor using your premium accounts in youtube-dl, edit the netrc file (in the root directory of this repository) according to following format:\n```\nmachine host login username password my_youtube_password\n```\nwhere host is the name of extractor (eg. youtube, twitch). Multiple accounts of different hosts can be added each separated by a new line\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxditya%2Fmirror2gdrive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxditya%2Fmirror2gdrive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxditya%2Fmirror2gdrive/lists"}