mirror of
https://github.com/mwalbeck/podfox.git
synced 2025-04-13 09:41:45 +00:00
Exception handling for connections error and timeouts
This commit is contained in:
parent
fce25a5532
commit
86f1a6bd45
1 changed files with 5 additions and 2 deletions
|
@ -39,7 +39,10 @@ import re
|
||||||
|
|
||||||
from email.utils import parsedate
|
from email.utils import parsedate
|
||||||
from time import time, mktime, gmtime, strftime, sleep
|
from time import time, mktime, gmtime, strftime, sleep
|
||||||
|
<<<<<<< cc4abf40a2e4fe00e52aff8d4e1c21d2219455f6
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
=======
|
||||||
|
>>>>>>> Exception handling for connections error and timeouts
|
||||||
|
|
||||||
CONFIGURATION = {}
|
CONFIGURATION = {}
|
||||||
|
|
||||||
|
@ -331,11 +334,11 @@ def download_single(folder, url, filename):
|
||||||
if 'connection_retries' in CONFIGURATION:
|
if 'connection_retries' in CONFIGURATION:
|
||||||
connection_retries = CONFIGURATION['connection_retries']
|
connection_retries = CONFIGURATION['connection_retries']
|
||||||
else:
|
else:
|
||||||
connection_retries = 9
|
connection_retries = 3
|
||||||
|
|
||||||
if filename is None:
|
if filename is None:
|
||||||
filename = get_original_filename(url)
|
filename = get_original_filename(url)
|
||||||
|
|
||||||
print_green("{:s} downloading".format(filename))
|
print_green("{:s} downloading".format(filename))
|
||||||
for i in range(connection_retries):
|
for i in range(connection_retries):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Reference in a new issue