Skip to content

Commit

Permalink
Added TORRENT_TIMEOUT feature
Browse files Browse the repository at this point in the history
*this will fix from dead torrents which spams load on bot which not gonna works

Signed-off-by: harshhaareddy <[email protected]>
  • Loading branch information
harshhaareddy committed May 15, 2022
1 parent 4c8b81e commit 59212b5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ Fill up rest of the fields. Meaning of each fields are discussed below:
- **CLONE_LIMIT**: To limit cloning Google Drive (leave space between number and unit, Available units is (gb or GB, tb or TB), Examples: `100 gb, 100 GB, 10 tb, 10 TB`
- **MEGA_LIMIT**: To limit downloading Mega (leave space between number and unit, Available units is (gb or GB, tb or TB), Examples: `100 gb, 100 GB, 10 tb, 10 TB`
- **TORRENT_DIRECT_LIMIT**: To limit the Torrent/Direct mirror size, Leave space between number and unit. Available units is (gb or GB, tb or TB), Examples: `100 gb, 100 GB, 10 tb, 10 TB`
- **TORRENT_TIMEOUT**: Timeout of dead torrents downloading with qBittorrent and Aria2c in seconds.
- **TAR_UNZIP_LIMIT**: To limit mirroring as Tar or unzipmirror. Available units is (gb or GB, tb or TB), Examples: `100 gb, 100 GB, 10 tb, 10 TB`
- **VIEW_LINK**: View Link button to open file Index Link in browser instead of direct download link, you can figure out if it's compatible with your Index code or not, open any video from you Index and check if the END of link from browser link bar is `?a=view`, if yes make it `True` it will work (Compatible with [Bhadoo Index](https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index) Code)
- **UPTOBOX_TOKEN**: Uptobox token to mirror uptobox links. Get it from [Uptobox Premium Account](https://uptobox.com/my_account).
Expand Down
6 changes: 5 additions & 1 deletion aria.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
if [ -z $TORRENT_TIMEOUT ]
then
TORRENT_TIMEOUT=0
fi
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=180 --min-split-size=10M --follow-torrent=mem --split=10 \
--bt-stop-timeout=$TORRENT_TIMEOUT --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 \
Expand Down
7 changes: 7 additions & 0 deletions bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ def get_client() -> qba.TorrentsAPIMixIn:
except KeyError:
TAR_UNZIP_LIMIT = None
try:
TORRENT_TIMEOUT = getConfig('TORRENT_TIMEOUT')
if len(TORRENT_TIMEOUT) == 0:
raise KeyError
TORRENT_TIMEOUT = int(TORRENT_TIMEOUT)
except:
TORRENT_TIMEOUT = None
try:
BUTTON_FOUR_NAME = getConfig('BUTTON_FOUR_NAME')
BUTTON_FOUR_URL = getConfig('BUTTON_FOUR_URL')
if 0 in (len(BUTTON_FOUR_NAME), len(BUTTON_FOUR_URL)):
Expand Down

0 comments on commit 59212b5

Please sign in to comment.