Skip to content

Commit b2b655c

Browse files
authored
Merge pull request #5 from speechmatics/stream-urls-from-env
Allow for stream url overrides from env variables
2 parents 53acae6 + 79bd6b7 commit b2b655c

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

stream_transcriber/streams.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,30 +64,37 @@ class SupportedStream:
6464

6565
SUPPORTED_STREAMS: Dict[str, SupportedStream] = {
6666
"english": SupportedStream(
67-
url="https://stream.live.vc.bbcmedia.co.uk/bbc_world_service",
68-
# pylint: disable=locally-disabled, line-too-long
69-
# url="https://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/high/cfs/bbc_world_service.m3u8",
67+
url=os.getenv(
68+
"STREAM_URL_EN", "https://stream.live.vc.bbcmedia.co.uk/bbc_world_service"
69+
),
7070
language="en",
7171
translation_languages=["fr", "de", "ja", "ko", "es"],
7272
),
7373
"german": SupportedStream(
74-
# pylint: disable=locally-disabled, line-too-long
75-
url="https://icecast.ndr.de/ndr/ndrinfo/niedersachsen/mp3/128/stream.mp3?1680704013057&aggregator=web",
74+
url=os.getenv(
75+
"STREAM_URL_DE",
76+
# pylint: disable=locally-disabled, line-too-long
77+
"https://icecast.ndr.de/ndr/ndrinfo/niedersachsen/mp3/128/stream.mp3?1680704013057&aggregator=web",
78+
),
7679
language="de",
7780
translation_languages=["en"],
7881
),
7982
"french": SupportedStream(
80-
url="https://icecast.radiofrance.fr/franceinter-midfi.mp3",
83+
url=os.getenv(
84+
"STREAM_URL_FR", "https://icecast.radiofrance.fr/franceinter-midfi.mp3"
85+
),
8186
language="fr",
8287
translation_languages=["en"],
8388
),
8489
"spanish": SupportedStream(
85-
url="https://25493.live.streamtheworld.com/CADENASERAAC_SC",
90+
url=os.getenv(
91+
"STREAM_URL_ES", "https://25493.live.streamtheworld.com/CADENASERAAC_SC"
92+
),
8693
language="es",
8794
translation_languages=["en"],
8895
),
8996
"korean": SupportedStream(
90-
url="http://fmt01.egihosting.com:9468/",
97+
url=os.getenv("STREAM_URL_KO", "http://fmt01.egihosting.com:9468/"),
9198
language="ko",
9299
translation_languages=["en"],
93100
),

0 commit comments

Comments
 (0)