Compare commits
2 commits
9b10e525f0
...
fda08d7d0d
Author | SHA1 | Date | |
---|---|---|---|
fda08d7d0d | |||
75c2713536 |
3 changed files with 9 additions and 5 deletions
|
@ -35,6 +35,7 @@ services:
|
||||||
build: .
|
build: .
|
||||||
volumes:
|
volumes:
|
||||||
- .:/src/techrec
|
- .:/src/techrec
|
||||||
|
- rec:/rec
|
||||||
- ./docker/output:/src/output
|
- ./docker/output:/src/output
|
||||||
ports:
|
ports:
|
||||||
- 8000:8000
|
- 8000:8000
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import logging
|
|
||||||
|
|
||||||
AUDIO_INPUT = "http://storage/ror"
|
AUDIO_INPUT = "http://storage/ror"
|
||||||
|
# decomment this if you want to test with local audio source
|
||||||
|
# AUDIO_INPUT = "/rec/ror"
|
||||||
AUDIO_OUTPUT = "/src/output"
|
AUDIO_OUTPUT = "/src/output"
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
HOST = "0.0.0.0"
|
HOST = "0.0.0.0"
|
||||||
|
|
|
@ -25,8 +25,10 @@ async def get_timefile_exact(time) -> str:
|
||||||
)
|
)
|
||||||
if path.startswith("http://") or path.startswith("https://"):
|
if path.startswith("http://") or path.startswith("https://"):
|
||||||
logger.info(f"downloading: {path}")
|
logger.info(f"downloading: {path}")
|
||||||
local = await download(path,
|
local = await download(
|
||||||
basic_auth=get_config()['AUDIO_INPUT_BASICAUTH'])
|
path,
|
||||||
|
basic_auth=get_config()['AUDIO_INPUT_BASICAUTH'],
|
||||||
|
)
|
||||||
return local
|
return local
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
@ -122,7 +124,8 @@ async def create_mp3(
|
||||||
file = await get_timefile(begin)
|
file = await get_timefile(begin)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Error while retrieving file: %s", e)
|
logger.error("Error while retrieving file: %s", e)
|
||||||
intervals.append((file, start_cut, end_cut))
|
else:
|
||||||
|
intervals.append((file, start_cut, end_cut))
|
||||||
if os.path.exists(outfile):
|
if os.path.exists(outfile):
|
||||||
raise OSError("file '%s' already exists" % outfile)
|
raise OSError("file '%s' already exists" % outfile)
|
||||||
for path, _s, _e in intervals:
|
for path, _s, _e in intervals:
|
||||||
|
|
Loading…
Reference in a new issue