1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

get_media: catch urlerror here?

This commit is contained in:
Johan Andersson 2014-12-25 23:48:34 +01:00
parent bbbd779282
commit 7671a26810

View File

@ -98,10 +98,18 @@ def get_media(url, options):
log.info("Episode %d of %d", idx + 1, len(episodes))
# get_one_media overwrites options.output...
get_one_media(substream, copy.copy(options))
try:
# get_one_media overwrites options.output...
get_one_media(substream, copy.copy(options))
except URLError as e:
log.error("Cant find that page: %s", e.reason)
return
else:
get_one_media(stream, options)
try:
get_one_media(stream, options)
except URLError as e:
log.error("Cant find that page: %s", e.reason)
sys.exit(2)
def get_one_media(stream, options):
if not options.output or os.path.isdir(options.output):