File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1414from typing import TYPE_CHECKING , Callable , TextIO , Union
1515
1616from loguru import logger
17+ from requests .exceptions import ConnectionError # noqa: A004
1718
1819from aria2p .client import Client , ClientException
1920from aria2p .downloads import Download
@@ -152,7 +153,11 @@ def add_torrent(
152153 torrent_contents = stream .read ()
153154 encoded_contents = b64encode (torrent_contents ).decode ("utf8" )
154155
155- gid = self .client .add_torrent (encoded_contents , uris , client_options , position )
156+ try :
157+ gid = self .client .add_torrent (encoded_contents , uris , client_options , position )
158+ except ConnectionError :
159+ logger .error ("Torrent too big? Try increasing max size with aria2c's --rpc-max-request-size option" )
160+ raise
156161
157162 return self .get_download (gid )
158163
You can’t perform that action at this time.
0 commit comments