[Hotfix] Fix bug where the link have 302 request are treated as torrents

Download.is_torrent introduced in aria2p v0.9.0
https://github.com/pawamoy/aria2p/issues/53

Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
lzzy12 2020-04-06 22:54:18 +05:30
parent 6ceb2ea8de
commit b8730f7f07
2 changed files with 6 additions and 4 deletions

View File

@ -24,11 +24,13 @@ class AriaDownloadHelper(DownloadHelper):
def __onDownloadComplete(self, api: API, gid):
with self._resource_lock:
if self.gid == gid:
if api.get_download(gid).followed_by_ids:
self.gid = api.get_download(gid).followed_by_ids[0]
download = api.get_download(gid)
if download.followed_by_ids:
self.gid = download.followed_by_ids[0]
with download_dict_lock:
download_dict[self._listener.uid] = AriaDownloadStatus(self.gid, self._listener)
download_dict[self._listener.uid].is_torrent =True
if download.is_torrent:
download_dict[self._listener.uid].is_torrent = True
update_all_messages()
LOGGER.info(f'Changed gid from {gid} to {self.gid}')
else:

View File

@ -2,7 +2,7 @@ python-telegram-bot==12.2.0
google-api-python-client>=1.7.11,<1.7.20
google-auth-httplib2>=0.0.3,<0.1.0
google-auth-oauthlib>=0.4.1,<0.10.0
aria2p>=0.3.0,<0.10.0
aria2p>=0.9.0,<0.15.0
python-dotenv>=0.10
tenacity>=6.0.0
python-magic