Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
8bd0127
Add ability to login to mega account for premium accounts
shivamdev-lgtm Jun 3, 2020
4754fb7
Fixed docs
shivamdev-lgtm Jun 3, 2020
8b3805c
Use prebuilt Docker image for mega-sdk
shivamdev-lgtm Jun 5, 2020
3217b67
Fixup for meganz login
shivamdev-lgtm Jun 5, 2020
c791b39
Revert "Improved upload progress implementation"
shivamdev-lgtm Jun 5, 2020
c4c7575
Generate our own gid for mega mirrors
shivamdev-lgtm Jun 5, 2020
cfe636f
Add missing x argument
shivamdev-lgtm Jun 8, 2020
87cc920
Use local fork of youtube-dl for hotstar fix
shivamdev-lgtm Jun 9, 2020
cc15de9
update trackers list dynamically (imported from archie9211 repo)
Jun 15, 2020
18b4bb9
Added CPU and Disk Usage to the Status Message
Jun 15, 2020
852394a
show peers and seeders for .torrents files too
Jun 15, 2020
c29de8e
Fix SSL handsake error
Jun 15, 2020
c409726
Changed Progress Bar
Jun 15, 2020
3720eac
Optimize Clone implementation
JaskaranSM Jun 18, 2020
c6a430a
Handle more exceptions
JaskaranSM Jun 18, 2020
45f75fb
Fix crash if Mega API key is not provided
shivamdev-lgtm Jun 19, 2020
1b79bbd
Fix error extraction
JaskaranSM Jun 21, 2020
53c34db
Added cpu and ram usage in stats
JaskaranSM Jun 21, 2020
ce58570
Merge staging 4.0
Jun 22, 2020
79ff0f7
Added CPU, DISK, RAM usage in /status and /stats both
Jun 22, 2020
f5f1c80
Added Inline Buttons
Jun 22, 2020
e772905
Fixed downloads from torrent files won't show seeders and peers
shivamdev-lgtm Jun 27, 2020
b5a162f
Use subprocess.run to call extract shell script
shivamdev-lgtm Jun 27, 2020
fed3be2
Return correct exit codes from extract script
shivamdev-lgtm Jun 28, 2020
1aed50a
Fixed multiple /unzipmirror commands gets all the mirrors stuck
shivamdev-lgtm Jun 28, 2020
00dc324
Merge branch 'staging-4.0' of https://github.com/lzzy12/python-aria-m…
Jun 29, 2020
fb75f71
Added delete command for drive files
Jun 30, 2020
f0eed93
Fixed : bot doesn't send clone error
Jul 1, 2020
aa8428f
Dockerfile: Install rar codecs for 7z
shivamdev-lgtm Jul 1, 2020
93ce4d3
Merge branch 'staging-4.0' of https://github.com/lzzy12/python-aria-m…
Jul 1, 2020
d5dde4b
Update /stats msg
magneto261290 Jul 4, 2020
7dbda06
Modified : List command | now results will be uploaded to telegra.ph
SVR666 Jul 22, 2020
1634e65
Proper Credits
magneto261290 Jul 22, 2020
5d7a60b
Added extra inline buttons (optional) (see config_sample.env)
magneto261290 Jul 22, 2020
020d63b
added ability of extracting .7z files (#144)
Jul 29, 2020
ef6c890
Fix /list if fileName string contains multiple quotes (#141)
smartass08 Jul 29, 2020
ee8bb8d
Fixes and improvements in /list module
SVR666 Jul 30, 2020
a68b83e
check file in drive before mirror and stop duplicate mirror
magneto261290 Jul 30, 2020
6674446
Added ability of extracting .7z files
magneto261290 Jul 30, 2020
e90950c
Fixed duplicate mirror message issue
Jul 31, 2020
ff5caf8
Some changes and fixup
SVR666 Aug 11, 2020
7ae2efd
added ability of extracting iso, wim and many other filetypes (see RE…
magneto261290 Aug 11, 2020
826c8b4
Added overall DL, UL speed in /status. Thanks to [Dark Soul](https://…
magneto261290 Aug 11, 2020
becf2ae
Fix: status message on no active downloads was showing cpu stats
magneto261290 Aug 17, 2020
48fd144
Added option to disable mega.nz links (config_sample.env)
magneto261290 Aug 26, 2020
581f61d
Enable faulthandler
JaskaranSM Aug 29, 2020
4179e61
Mega: Fix folder downloads with mega account
JaskaranSM Aug 29, 2020
2ee5625
message_utils: handle edge case
JaskaranSM Aug 29, 2020
5c67b89
Merge branch 'staging-4.0-mega' of https://github.com/lzzy12/python-a…
magneto261290 Aug 29, 2020
a6a4b03
Added support of jiosaavn, tiktok, instagram reels
Aug 29, 2020
7f1ce27
Added url Shorteners support (Optional)
magneto261290 Sep 2, 2020
bc19c60
Update README.md
magneto261290 Sep 2, 2020
0ac287f
Some peps were facing issue in generating string session.
magneto261290 Sep 9, 2020
b68e874
Changed Youtube-dl's repo (Note :- Tiktok broken)
magneto261290 Oct 24, 2020
e9d935e
Added quality option in /watch command
magneto261290 Nov 4, 2020
31b8e02
Try to fix 0B size shown by YTDL
magneto261290 Nov 7, 2020
474e795
Fix Typo
magneto261290 Nov 7, 2020
a9acc68
Fix Typo
magneto261290 Nov 8, 2020
497ed16
Bye.... (◕‿◕)
magneto261290 Nov 12, 2020
51cf742
Fixed the missing module 'appdirs'
ManOfInfinity Jan 2, 2021
c469c1f
Merge pull request #62 from SamirJanaOfficial/patch-1
magneto261290 Jan 3, 2021
d47c713
updates soon....
magneto261290 Jan 20, 2021
60b3614
Added Support for Custom FileName
magneto261290 Jan 20, 2021
c180630
Added: Extract Password Protected Archive Files
magneto261290 Jan 22, 2021
3542851
Some fixup in STOP_DUPLICATE_MIRROR
magneto261290 Jan 22, 2021
ee6f61f
Fix Telegram file tar and unzipmirror issue.
magneto261290 Jan 23, 2021
89b39f4
Many minor bug fixes
magneto261290 Jan 28, 2021
8e6b600
Added AUTHORIZED_CHATS in config (env. variables)
magneto261290 Jan 28, 2021
88e1f12
Update bot_utils.py
iamLiquidX Jan 30, 2021
0645a23
Update message_utils.py
iamLiquidX Jan 30, 2021
b569874
Update mirror.py
iamLiquidX Jan 30, 2021
33e8ca1
Update __main__.py
iamLiquidX Jan 30, 2021
325e9fd
Rename config_sample.env to config.env
iamLiquidX Jan 30, 2021
80ae162
Update config.env
iamLiquidX Jan 30, 2021
6aa9399
Update config.env
iamLiquidX Jan 30, 2021
2982833
Update config.env
iamLiquidX Jan 30, 2021
a018382
Update aria.sh
iamLiquidX Jan 30, 2021
2adccbe
Update aria.sh
iamLiquidX Feb 3, 2021
1b36b5d
Update aria.sh
iamLiquidX Feb 3, 2021
8c8607c
Update aria.sh
iamLiquidX Feb 10, 2021
1545e87
Update aria.sh
iamLiquidX Feb 13, 2021
54145f3
Update aria.sh
iamLiquidX Feb 13, 2021
ab75003
Update aria.sh
iamLiquidX Feb 13, 2021
d814bbf
Auto generate String Session and Telegraph Token
magneto261290 Feb 13, 2021
6de66ea
Fix restart if user has not mirrored anything
magneto261290 Feb 13, 2021
98be781
Delete aria.sh
iamLiquidX Feb 14, 2021
309fc4c
Add files via upload
iamLiquidX Feb 14, 2021
fe5622e
Update aria.sh
iamLiquidX Feb 14, 2021
c830666
Random name while generating Telegraph Token
magneto261290 Feb 14, 2021
89db5bc
Fix None FileName in mirroring some TG File
magneto261290 Feb 14, 2021
1789c47
Update __main__.py
iamLiquidX Feb 15, 2021
24559f0
adding speed check command
iamLiquidX Feb 15, 2021
7efa713
added speedtest script
iamLiquidX Feb 15, 2021
19bfe48
added requiremets for speedtest
iamLiquidX Feb 15, 2021
e57b6bb
Create config_sample.env
iamLiquidX Feb 15, 2021
c68b24c
Merge pull request #2 from magneto261290/master
iamLiquidX Feb 15, 2021
fa41914
update to restart command
iamLiquidX Feb 15, 2021
7df994f
Update README.md
iamLiquidX Feb 15, 2021
1b5b05e
A Little More RGB Wouldn't Hurt
iamLiquidX Feb 15, 2021
59fcd5e
Old So Deleted
iamLiquidX Feb 15, 2021
54bd29f
Update requirements.txt
iamLiquidX Feb 15, 2021
8985ff2
Update requirements.txt
iamLiquidX Feb 15, 2021
0f710fb
Update README.md
iamLiquidX Feb 15, 2021
93fe7c6
Update README.md
iamLiquidX Feb 15, 2021
8ddaa09
Update README.md
iamLiquidX Feb 15, 2021
c2fa929
Update bot_utils.py
iamLiquidX Feb 15, 2021
ddfcd64
Update bot_commands.py
iamLiquidX Feb 15, 2021
d7ed1c8
SpeedTest
iamLiquidX Feb 15, 2021
e4e1833
More RGB
iamLiquidX Feb 15, 2021
d454e36
More RGB
iamLiquidX Feb 15, 2021
7f1702e
Update bot_utils.py
iamLiquidX Feb 15, 2021
17e8909
Update bot_utils.py
iamLiquidX Feb 15, 2021
e85c808
Update __main__.py
iamLiquidX Feb 15, 2021
b5f0983
Update mirror.py
iamLiquidX Feb 15, 2021
bb7df1c
Update requirements.txt
iamLiquidX Feb 16, 2021
ae931c2
fixed a critical bug
iamLiquidX Feb 16, 2021
8cdc25d
Update aria.sh
iamLiquidX Feb 16, 2021
c1e807a
Default Trackers
iamLiquidX Feb 16, 2021
490289e
Skip private or NA videos when downloading from yt playlist
iamLiquidX Feb 16, 2021
a393378
Adding Notes Related To Mega Downloads
iamLiquidX Feb 18, 2021
c0be48e
Added Support For Big Size Mega Folders
iamLiquidX Feb 18, 2021
64c61b4
Create Modificaton.md
destiny6520 Feb 18, 2021
9b94f80
Update README.md
destiny6520 Feb 18, 2021
20ca18f
Update and rename Modificaton.md to modificaton.md
destiny6520 Feb 18, 2021
9924f03
Update modificaton.md
destiny6520 Feb 18, 2021
9af542d
Update modificaton.md
destiny6520 Feb 18, 2021
097a69e
Update README.md
destiny6520 Feb 18, 2021
d7c77bd
fixed permanent Line links to respective files
destiny6520 Feb 18, 2021
016c218
all links fixed
destiny6520 Feb 18, 2021
6e7eef3
MEGA: Handle TransferTempError (#210)
a092devs Feb 20, 2021
6f7cca7
MEGA: Handle TransferTempError
iamLiquidX Feb 20, 2021
bfa9b5e
Some minor changes
iamLiquidX Feb 20, 2021
1f94daf
Blind Me
iamLiquidX Feb 20, 2021
d4be16b
trying to fix the issues
iamLiquidX Feb 20, 2021
a509784
Fixed the issues.
iamLiquidX Feb 20, 2021
f562e52
Merge branch 'staging-4.0-mega' of https://github.com/lzzy12/python-a…
magneto261290 Feb 21, 2021
8e470cc
Mega.nz: keep listener reference in global list
JaskaranSM Feb 21, 2021
f00bb8f
Merge pull request #3 from magneto261290/master
iamLiquidX Feb 21, 2021
53d595c
Mega.nz: try to fix dead link bot crash issue
JaskaranSM Feb 21, 2021
24b00a4
Merge pull request #4 from magneto261290/master
iamLiquidX Feb 21, 2021
d83aa73
requirements.txt: use pyrogram v0.18.0 to fix flood wait exceptions
jnelle Mar 5, 2021
fb78dc4
UpToBox Token Config
iamLiquidX Mar 5, 2021
57ab70f
Variable For UpToBox Token
iamLiquidX Mar 5, 2021
c9f575a
UpToBox Support
iamLiquidX Mar 5, 2021
1cee5be
UpToBox Related Things........
iamLiquidX Mar 5, 2021
a6bbf1c
Merge pull request #89 from Billaids/master
noobvishal Mar 6, 2021
55fa911
Merge pull request #6 from magneto261290/master
iamLiquidX Mar 6, 2021
0b8e99d
Merge pull request #7 from iamLiquidX/master
iamLiquidX Mar 6, 2021
a1c210a
Merge pull request #8 from iamLiquidX/Experimental
iamLiquidX Mar 6, 2021
7ba1702
Modified Ytdl
iamLiquidX Mar 9, 2021
d47842c
Just A Diffrent Ytdl Fork
iamLiquidX Mar 9, 2021
1bdd3fa
Merge pull request #9 from iamLiquidX/Experimental
iamLiquidX Mar 9, 2021
dddd9fb
Indian Streaming Sites Support..
iamLiquidX Mar 9, 2021
de64ec1
Update requirements.txt
iamLiquidX Mar 9, 2021
fb03164
Reverting
iamLiquidX Mar 9, 2021
4683011
- Upgrade to PTB 13.4.1
nenokkadine Mar 15, 2021
6bd9320
Merge pull request #10 from nenokkadine/master
iamLiquidX Mar 15, 2021
5c40667
Update README.md
iamLiquidX Mar 15, 2021
e6ed929
Revert "Update PTB and Make YTDL use Aria2c for HLS/DASH"
iamLiquidX Mar 27, 2021
9fea69b
Merge pull request #11 from iamLiquidX/revert-10-master
iamLiquidX Mar 27, 2021
8947d89
Update About Mega Downloads
iamLiquidX Mar 28, 2021
d025019
treewide: prepare for dependency updates
KenHV Mar 3, 2021
721582f
requirements: relax all version constraints
KenHV Apr 10, 2021
7366388
treewide: upgrade codebase to 3.9+ syntax
KenHV Apr 10, 2021
4d34c56
youtube_dl: fix geo bypass for hotstar and sonyliv
KenHV Apr 4, 2021
211666a
init: fix trailing backslash check for DOWNLOAD_DIR
KenHV Apr 10, 2021
1a3e449
restart: use execl() to spawn a new process
KenHV Apr 10, 2021
379aa41
direct_link_generator: fix zippyshare
KenHV Apr 10, 2021
b4991a0
Moving Everything To Wiki
iamLiquidX Apr 11, 2021
531622b
Moving Everything To Wiki
iamLiquidX Apr 11, 2021
94fbc2b
Moving Everything To Wiki
iamLiquidX Apr 11, 2021
26a6ea8
Merge pull request #100 from KenHV/patch-1
magneto261290 Apr 12, 2021
9eb2d13
Fixing The Conflicts For Pull Req. (#16)
iamLiquidX Apr 12, 2021
1d5d53a
Updates And Fixes
iamLiquidX Apr 12, 2021
27c6b76
Update speedtest.py
iamLiquidX Apr 12, 2021
f275e49
Fixing Speedtest Module
iamLiquidX Apr 12, 2021
69d3883
Fix Index URL encode problem
TheFierceWarrior Jul 13, 2020
90079d3
Added support for password protected index links
magneto261290 Apr 18, 2021
ff6d2b6
Updates & Fixes
iamLiquidX Apr 18, 2021
e5e0059
Use Aria Configuration file and Cleanup Dockerfile (#18)
nenokkadine Apr 22, 2021
d6b213d
Credits Update
iamLiquidX Apr 22, 2021
e476b68
Fixing Typossssss
iamLiquidX Apr 22, 2021
6444e77
Limiting Current Downloads
iamLiquidX Apr 22, 2021
d929e9b
Low speed issue in some torrent fixed
iamLiquidX Apr 22, 2021
615ed9e
Delete old TrackList before appending them at every restart (#19)
xd003 Apr 27, 2021
018ec2d
Optimise Docker image (#20)
nenokkadine May 16, 2021
8c816cd
Workflow for base image build (#21)
nenokkadine May 17, 2021
1dfa564
mirror: Fix for uploading telegram file_name of None type
iamLiquidX May 18, 2021
f7167fb
Fix /watch download msg progress
iamLiquidX May 18, 2021
8ce247b
Changing client mask to qBit
iamLiquidX Jun 8, 2021
93b4cd5
added count
iamLiquidX Jun 19, 2021
aa4d007
clone & count tags user
iamLiquidX Jun 19, 2021
339fae1
Update README.md
iamLiquidX Jun 20, 2021
b20683e
zip/unzip gdrive folder/files,fembed support
iamLiquidX Jun 20, 2021
7180660
Added Creds.
iamLiquidX Jun 20, 2021
4d50431
Typo
iamLiquidX Jun 20, 2021
9064440
Fix to zip/unzip getting over 100%
iamLiquidX Jun 27, 2021
6803dcc
Switching to MEGAREST (#27)
iamLiquidX Jul 2, 2021
a7a025d
Fix Python Version not available
nenokkadine Jul 2, 2021
5a1316c
Fix GCC not found error in arm64
nenokkadine Jul 2, 2021
1f3ec64
Add an Example how to mount netrc in container
nenokkadine Jul 3, 2021
955d2db
Update Script and MegaSDKREST
nenokkadine Aug 7, 2021
00cf61e
Some fixes. RGB removed.
iamLiquidX Sep 23, 2021
8aa9894
fixing build error
iamLiquidX Sep 23, 2021
184d5ae
version bump
iamLiquidX Sep 23, 2021
4820af0
Removing some residue
iamLiquidX Sep 23, 2021
8b5032c
residue removal and fixes (#29)
iamLiquidX Sep 23, 2021
2008d0a
Fix version mess
iamLiquidX Sep 23, 2021
ea18773
SA randomisation
iamLiquidX Oct 6, 2021
01494b7
Small fix (#30)
iamLiquidX Oct 13, 2021
3a41090
Refactored arch detection (#33)
May 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: MirrorX Release

on:
push:
tags:
- "v*.*.*"

jobs:
BuildWheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8.12
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Install deps fro Pypi Release
run: |
pip -q install setuptools wheel twine
pip -q install -r requirements.txt
- name: Publish to pypi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/* || exit 0
- name: Upload all the data files to github Release
uses: softprops/action-gh-release@v1
with:
name: MirrorX Release ${{ steps.get_version.outputs.VERSION }}
files: |
dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sleep
run: sleep 60
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: token
password: ${{ secrets.GH_TOKEN }}
- name: Docker meta
id: metaraw
uses: docker/metadata-action@v3
with:
images: ghcr.io/iamliquidx/mirrorx
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64, linux/arm64/v8
push: true
tags: ${{ steps.metaraw.outputs.tags }}
labels: ${{ steps.metaraw.outputs.labels }}
13 changes: 10 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
config.env
*auth_token.txt
*.pyc
downloads/*
download/*
data*
.vscode
.idea
*.json
*.pickle
authorized_chats.txt
log.txt
accounts/*
accounts/*
*.pyc
dht6.dat
aria.conf
.gitignore
dht.dat
build
dist
*.spec
/venv/
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

54 changes: 23 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,30 @@
FROM ubuntu:18.04
FROM python:3.9-slim

WORKDIR /usr/src/app
RUN chmod 777 /usr/src/app
WORKDIR /
# Deps

RUN apt-get -qq update
RUN apt-get -qq install -y python3 python3-pip rar unzip git aria2 g++ gcc autoconf automake \
m4 libtool qt4-qmake make libqt4-dev libcurl4-openssl-dev \
libcrypto++-dev libsqlite3-dev libc-ares-dev \
libsodium-dev libnautilus-extension-dev \
libssl-dev libfreeimage-dev swig curl pv jq ffmpeg locales python3-lxml
SHELL [ "/usr/bin/bash" , "-cel" ]

# Installing mega sdk python binding
ENV MEGA_SDK_VERSION '3.6.4'
RUN git clone https://github.com/meganz/sdk.git sdk
WORKDIR sdk
RUN git checkout v$MEGA_SDK_VERSION && ./autogen.sh && \
./configure --disable-silent-rules --enable-python --disable-examples && \
make -j$(nproc --all) && cd bindings/python/ && \
python3 setup.py bdist_wheel && cd dist/ && \
pip3 install --no-cache-dir megasdk-$MEGA_SDK_VERSION-*.whl
RUN \
[[ ${valid_arch:-aarch64 amd64 x86_64} =~ ${HOST_CPU_ARCH:=$(uname -m)} ]] \
|| echo 'unsupported cpu arch' && exit 1

RUN \
export HOST_CPU_ARCH=$(uname -m) \
sed -i 's/main/main non-free/g' /etc/apt/sources.list && \
apt-get -qq update && \
apt-get -qq install -y tzdata curl aria2 p7zip-full p7zip-rar wget xz-utils libmagic-dev gcc libffi-dev nscd && \
apt-get -y autoremove && rm -rf /var/lib/apt/lists/* && apt-get clean && \
wget -q https://github.com/yzop/gg/raw/main/ffmpeg-git-${HOST_CPU_ARCH}-static.tar.xz && \
tar -xf ff*.tar.xz && rm -rf *.tar.xz && \
mv ff*/ff* /usr/local/bin/ && rm -rf ff* && \
wget -q https://github.com/viswanathbalusu/megasdkrest/releases/latest/download/megasdkrest-${HOST_CPU_ARCH} -O /usr/local/bin/megasdkrest && \
chmod a+x /usr/local/bin/megasdkrest && mkdir /app/ && chmod 777 /app/ && \
pip3 install --no-cache-dir MirrorX && \
apt-get purge -yqq gcc && apt-get -y autoremove && rm -rf /var/lib/apt/lists/* && apt-get clean

COPY requirements.txt .
COPY extract /usr/local/bin
RUN chmod +x /usr/local/bin/extract
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"]
WORKDIR /app

CMD ["MirrorX"]

###
189 changes: 38 additions & 151 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,151 +1,38 @@
# What is this repo about?
This is a telegram bot writen in python for mirroring files on the internet to our beloved Google Drive.

# Inspiration
This project is heavily inspired from @out386 's telegram bot which is written in JS.

# Features supported:
- Mirroring direct download links to google drive
- Mirroring Mega.nz links to google drive (In development stage)
- Mirror Telegram files to google drive
- Mirror all youtube-dl supported links
- Extract zip, rar, tar and many supported file types and uploads to google drive
- Copy files from someone's drive to your drive (using Rclone)
- Service account support in cloning and uploading
- Download progress
- Upload progress
- Download/upload speeds and ETAs
- Docker support
- Uploading To Team Drives.
- Index Link support

# Bot commands to be set in botfather

```
mirror - Start Mirroring
tarmirror - Upload tar (zipped) file
unzipmirror - Extract files
clone - copy folder to drive
watch - mirror YT-DL support link
tarwatch - mirror youtube playlist link as tar
cancel - Cancel a task
cancelall - Cancel all tasks
list - [query] searches files in G-Drive
status - Get Mirror Status message
stats - Bot Usage Stats
help - Get Detailed Help
log - Bot Log [owner only]
```

# How to deploy?
Deploying is pretty much straight forward and is divided into several steps as follows:
## Installing requirements

- Clone this repo:
```
git clone https://github.com/magneto261290/magneto-python-aria mirror-bot/
cd mirror-bot
```

- Install requirements
For Debian based distros
```
sudo apt install python3
sudo snap install docker
```
- For Arch and it's derivatives:
```
sudo pacman -S docker python
```

## Setting up config file
```
cp config_sample.env config.env
```
- Remove the first line saying:
```
_____REMOVE_THIS_LINE_____=True
```
Fill up rest of the fields. Meaning of each fields are discussed below:
- **BOT_TOKEN** : The telegram bot token that you get from @BotFather
- **GDRIVE_FOLDER_ID** : This is the folder ID of the Google Drive Folder to which you want to upload all the mirrors.
- **DOWNLOAD_DIR** : The path to the local folder where the downloads should be downloaded to
- **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)
- **OWNER_ID** : The Telegram user ID (not username) of the owner of the bot
- **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
- **IS_TEAM_DRIVE** : (Optional field) Set to "True" if GDRIVE_FOLDER_ID is from a Team Drive else False or Leave it empty.
- **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.
- **INDEX_URL** : (Optional field) Refer to https://github.com/maple3142/GDIndex/ The URL should not have any trailing '/'
- **API_KEY** : 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.
- **API_HASH** : This is to authenticate to your telegram account for downloading Telegram files. You can get this from https://my.telegram.org
- **USER_SESSION_STRING** : Session string generated by running:
- **MEGA_API_KEY**: Mega.nz api key to mirror mega.nz links. Get it from [Mega SDK Page](https://mega.nz/sdk)
```
python3 generate_string_session.py
```
Note: You can limit maximum concurrent downloads by changing the value of MAX_CONCURRENT_DOWNLOADS in aria.sh. By default, it's set to 2

## Getting Google OAuth API credential file

- Visit the [Google Cloud Console](https://console.developers.google.com/apis/credentials)
- Go to the OAuth Consent tab, fill it, and save.
- Go to the Credentials tab and click Create Credentials -> OAuth Client ID
- Choose Other and Create.
- Use the download button to download your credentials.
- Move that file to the root of mirror-bot, and rename it to credentials.json
- Visit [Google API page](https://console.developers.google.com/apis/library)
- Search for Drive and enable it if it is disabled
- Finally, run the script to generate token file (token.pickle) for Google Drive:
```
pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib
python3 generate_drive_token.py
```
## Deploying

- Start docker daemon (skip if already running):
```
sudo dockerd
```
- Build Docker image:
```
sudo docker build . -t mirror-bot
```
- Run the image:
```
sudo docker run mirror-bot
```

# 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
Many thanks to [AutoRClone](https://github.com/xyou365/AutoRclone) for the scripts
## Generating service accounts
Step 1. Generate service accounts [What is service account](https://cloud.google.com/iam/docs/service-accounts)
---------------------------------
Let us create only the service accounts that we need.
**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.

```
Note: 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.
```

`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 created

NOTE: If you have created SAs in past from this script, you can also just re download the keys by running:
```
python3 gen_sa_accounts.py --download-keys project_id
```

### Add all the service accounts to the Team Drive or folder
- Run:
```
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 (in the root directory of this repository) according to following format:
```
machine host login username password my_youtube_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
<p align="center">
<img width="200" src="https://media4.giphy.com/media/1jWAx072bAJwMebcl7/200w.gif?cid=82a1493bnsutnhqk7gyyjf1k0m8rbad3qp6t6gan3zf9vr6b&rid=200w.gif" alt="Material Bread logo">
</p>


<p align="center">

# This Is A Telegram Bot Written In Python For Mirroring Files On The Internet To Our Beloved Google Drive.
</p>

Here Are Some Things To Get You Started.👇


## 👉[All The Feature Of This Bot Or What This Bot Can Do For You.](https://github.com/iamLiquidX/MirrorX/wiki/Feature-Or-What-This-Bot-Can-Do)

## 👉[How To Deploy](https://github.com/iamLiquidX/MirrorX/wiki/How-To-Deploy)

## 👉[Commands To Use The Bot](https://github.com/iamLiquidX/MirrorX/wiki/Commands-To-Use-This-Bot)

## 👉[Modification Guide](https://github.com/iamLiquidX/MirrorX/wiki/Modification)


For The Most Recent Changes, Please Check The Changelog.👇

## 👉[Changelog](https://github.com/iamLiquidX/MirrorX/wiki/Changelog)



# Credits 👇

1. [Shivam Jha aka lzzy12](https://github.com/lzzy12) & [JaskaranSM aka Zero Cool](https://github.com/jaskaranSM) - They Built This Bot From Scratch.
2. [Sreeraj V R](https://github.com/SVR666)- Added Inline Button, Added Support For Deleting File/Folders From GDrive, Search Results On Telegra.ph.
3. [Archie](https://github.com/archie9211) - Added Support For Extraction Of Archives, Fixed SSL Handshake Error, Update Trackers Dynamically.
4. [Magneto](https://github.com/magneto261290) - Added Alot Of Customization, Support For Custom File Names, Support For Password Protected Archives, Quality Selection Option In YTDL And Much More.
5. [KenHV](https://github.com/KenHV) - Many Fixes And Imporovements.
6. [Anos](https://github.com/destiny6520) - Modification/Customization Guide.
7. [Viswanath](https://github.com/nenokkadine) - Fixes & Improvements, Dockerfile Clean Up, DHT Support In Aria.
8. [breakdowns](https://github.com/breakdowns) - Source Code For Count,Zip/Unzip GDrive Links & Fembed.
1 change: 0 additions & 1 deletion aria.bat

This file was deleted.

7 changes: 0 additions & 7 deletions aria.sh

This file was deleted.

3 changes: 3 additions & 0 deletions bin/MirrorX
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
pip3 install -U MirrorX
MirrorXBot
Loading