Update app.py
Browse files11 unmodified lines1213141516171819202122130 unmodified lines15315415515615715815925 unmodified lines18518618718218318818919019119229 unmodified lines22222322421922522622122711 unmodified linesfrom dash.exceptions import PreventUpdateimport threadingfrom pytube import YouTubeimport logging
# Set up logginglogging.basicConfig(level=logging.DEBUG)logger = logging.getLogger(__name__)
print("Script started")
130 unmodified lines dbc.Row([ dbc.Col([ html.H1("Video Transcription with Speaker Separation", className="text-center mb-4"), html.Div("If you can see this, the app is working!", className="text-center mb-4"), # Debug element dbc.Card([ dbc.CardBody([ dbc.Input(id="video-url", type="text", placeholder="Enter video URL"),25 unmodified lines transcript = transcribe_video(url) return transcript except Exception as e: import traceback return f"An error occurred: {str(e)}\n\nTraceback:\n{traceback.format_exc()}" logger.exception("Error in transcription:") return f"An error occurred: {str(e)}"
# Run transcription in a separate thread thread = threading.Thread(target=transcribe)29 unmodified lines return dict(content=transcript, filename="transcript.txt")
if __name__ == '__main__': print("Starting the Dash application...") logger.info("Starting the Dash application...") app.run(debug=True, host='0.0.0.0', port=7860) print("Dash application has finished running.") logger.info("Dash application has finished running.")app.py+10-4