Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit e3adb19

Browse files
authored
v4.4 (#31)
- Fix typo - Automatic stopped after 300 second if dead torrent - Stop clone gdrive link limit
1 parent faf2d51 commit e3adb19

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ python3 generate_drive_token.py
2626

2727
## Deployment
2828

29-
Give Star & Fork this repo, than upload **token.pickle** to your forks
29+
Give Star & Fork this repo, then upload **token.pickle** to your forks
3030

3131
<p><a href="https://heroku.com/deploy"> <img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku" /></a></p>
3232

aria.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export MAX_CONCURRENT_DOWNLOADS=7
44

55
aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --check-certificate=false\
66
--max-connection-per-server=10 --rpc-max-request-size=1024M \
7-
--bt-tracker="[$tracker_list]" --bt-max-peers=0 --seed-time=0.01 --min-split-size=10M \
7+
--bt-tracker="[$tracker_list]" --bt-max-peers=0 --bt-tracker-connect-timeout=300 --bt-stop-timeout=300 --seed-time=0.01 --min-split-size=10M \
88
--follow-torrent=mem --split=10 \
99
--daemon=true --allow-overwrite=true --max-overall-download-limit=$MAX_DOWNLOAD_SPEED \
1010
--max-overall-upload-limit=1K --max-concurrent-downloads=$MAX_CONCURRENT_DOWNLOADS \

bot/helper/mirror_utils/download_utils/aria2_download.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __onDownloadPause(self, api, gid):
6363
def __onDownloadStopped(self, api, gid):
6464
LOGGER.info(f"onDownloadStop: {gid}")
6565
dl = getDownloadByGid(gid)
66-
if dl: dl.getListener().onDownloadError('Download stopped by user!')
66+
if dl: dl.getListener().onDownloadError('Dead torrent!')
6767

6868
@new_thread
6969
def __onDownloadError(self, api, gid):

bot/helper/mirror_utils/upload_utils/gdriveTools.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,7 @@ def copyFile(self, file_id, dest_id):
269269
if err.resp.get('content-type', '').startswith('application/json'):
270270
reason = json.loads(err.content).get('error').get('errors')[0].get('reason')
271271
if reason == 'userRateLimitExceeded' or reason == 'dailyLimitExceeded':
272-
if USE_SERVICE_ACCOUNTS:
273-
self.switchServiceAccount()
274-
LOGGER.info(f"Got: {reason}, Trying Again.")
275-
return self.copyFile(file_id,dest_id)
272+
raise err
276273
else:
277274
raise err
278275

@@ -371,7 +368,13 @@ def clone(self, link):
371368
err = err.last_attempt.exception()
372369
err = str(err).replace('>', '').replace('<', '')
373370
LOGGER.error(err)
374-
return err
371+
if "User rate limit exceeded" in str(err):
372+
msg = "User rate limit exceeded."
373+
elif "File not found" in str(err):
374+
msg = "File not found."
375+
else:
376+
msg = f"Error.\n{err}"
377+
return msg, ""
375378
return msg, InlineKeyboardMarkup(buttons.build_menu(2))
376379

377380
def cloneFolder(self, name, local_path, folder_id, parent_id):
@@ -501,7 +504,7 @@ def drive_list(self, fileName):
501504
spaces='drive',
502505
pageSize=200,
503506
fields='files(id, name, mimeType, size)',
504-
orderBy='modifiedTime desc').execute()
507+
orderBy='name asc').execute()
505508
content_count = 0
506509
if response["files"]:
507510
msg += f'<h4>{len(response["files"])} Results : {fileName}</h4><br><br>'

0 commit comments

Comments
 (0)