Alexander Seifert commited on
Commit
b602cc6
1 Parent(s): 5d9101b

add passwords again

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import base64
 
2
 
3
  import modal
4
  import streamlit as st
@@ -29,9 +30,13 @@ def run():
29
  label="Transkribieren", disabled=(not audio_file and not url)
30
  )
31
 
 
 
 
 
32
  if audio_file is not None:
33
  st.audio(audio_file)
34
- cutoff = None if password == "" else 60_000
35
  audio_file = AudioSegment.from_file(audio_file)[:cutoff]
36
  audio_b64 = base64.b64encode(audio_file.export().read()).decode("ascii")
37
  if url:
 
1
  import base64
2
+ import os
3
 
4
  import modal
5
  import streamlit as st
 
30
  label="Transkribieren", disabled=(not audio_file and not url)
31
  )
32
 
33
+ if password not in [os.environ["PASSWORD"], os.environ["ROOT_PASSWORD"]]:
34
+ st.error("Zugriffscode ist falsch.")
35
+ st.stop()
36
+
37
  if audio_file is not None:
38
  st.audio(audio_file)
39
+ cutoff = None if password == os.environ["ROOT_PASSWORD"] else 60_000
40
  audio_file = AudioSegment.from_file(audio_file)[:cutoff]
41
  audio_b64 = base64.b64encode(audio_file.export().read()).decode("ascii")
42
  if url: