Fix logic if failing to download
This commit is contained in:
parent
9b10e525f0
commit
75c2713536
1 changed files with 6 additions and 3 deletions
|
@ -25,8 +25,10 @@ async def get_timefile_exact(time) -> str:
|
|||
)
|
||||
if path.startswith("http://") or path.startswith("https://"):
|
||||
logger.info(f"downloading: {path}")
|
||||
local = await download(path,
|
||||
basic_auth=get_config()['AUDIO_INPUT_BASICAUTH'])
|
||||
local = await download(
|
||||
path,
|
||||
basic_auth=get_config()['AUDIO_INPUT_BASICAUTH'],
|
||||
)
|
||||
return local
|
||||
return path
|
||||
|
||||
|
@ -122,6 +124,7 @@ async def create_mp3(
|
|||
file = await get_timefile(begin)
|
||||
except Exception as e:
|
||||
logger.error("Error while retrieving file: %s", e)
|
||||
else:
|
||||
intervals.append((file, start_cut, end_cut))
|
||||
if os.path.exists(outfile):
|
||||
raise OSError("file '%s' already exists" % outfile)
|
||||
|
|
Loading…
Reference in a new issue