- Fix typo
- Automatic stopped after 300 second if dead torrent
- Stop clone gdrive link limit
This commit is contained in:
Hafitz Setya 2021-03-22 16:06:32 +07:00 committed by GitHub
parent faf2d51308
commit e3adb19880
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 9 deletions

View File

@ -26,7 +26,7 @@ python3 generate_drive_token.py
## Deployment
Give Star & Fork this repo, than upload **token.pickle** to your forks
Give Star & Fork this repo, then upload **token.pickle** to your forks
<p><a href="https://heroku.com/deploy"> <img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku" /></a></p>

View File

@ -4,7 +4,7 @@ export MAX_CONCURRENT_DOWNLOADS=7
aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --check-certificate=false\
--max-connection-per-server=10 --rpc-max-request-size=1024M \
--bt-tracker="[$tracker_list]" --bt-max-peers=0 --seed-time=0.01 --min-split-size=10M \
--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 \
--follow-torrent=mem --split=10 \
--daemon=true --allow-overwrite=true --max-overall-download-limit=$MAX_DOWNLOAD_SPEED \
--max-overall-upload-limit=1K --max-concurrent-downloads=$MAX_CONCURRENT_DOWNLOADS \

View File

@ -63,7 +63,7 @@ class AriaDownloadHelper(DownloadHelper):
def __onDownloadStopped(self, api, gid):
LOGGER.info(f"onDownloadStop: {gid}")
dl = getDownloadByGid(gid)
if dl: dl.getListener().onDownloadError('Download stopped by user!')
if dl: dl.getListener().onDownloadError('Dead torrent!')
@new_thread
def __onDownloadError(self, api, gid):

View File

@ -269,10 +269,7 @@ class GoogleDriveHelper:
if err.resp.get('content-type', '').startswith('application/json'):
reason = json.loads(err.content).get('error').get('errors')[0].get('reason')
if reason == 'userRateLimitExceeded' or reason == 'dailyLimitExceeded':
if USE_SERVICE_ACCOUNTS:
self.switchServiceAccount()
LOGGER.info(f"Got: {reason}, Trying Again.")
return self.copyFile(file_id,dest_id)
raise err
else:
raise err
@ -371,7 +368,13 @@ class GoogleDriveHelper:
err = err.last_attempt.exception()
err = str(err).replace('>', '').replace('<', '')
LOGGER.error(err)
return err
if "User rate limit exceeded" in str(err):
msg = "User rate limit exceeded."
elif "File not found" in str(err):
msg = "File not found."
else:
msg = f"Error.\n{err}"
return msg, ""
return msg, InlineKeyboardMarkup(buttons.build_menu(2))
def cloneFolder(self, name, local_path, folder_id, parent_id):
@ -501,7 +504,7 @@ class GoogleDriveHelper:
spaces='drive',
pageSize=200,
fields='files(id, name, mimeType, size)',
orderBy='modifiedTime desc').execute()
orderBy='name asc').execute()
content_count = 0
if response["files"]:
msg += f'<h4>{len(response["files"])} Results : {fileName}</h4><br><br>'