Changement dans le tab 3, on envoie toujours pour mp4 et on reçoit un zip
This commit is contained in:
parent
62cd159d0f
commit
a0e2067f2b
1 changed files with 9 additions and 18 deletions
27
app_tab3.py
27
app_tab3.py
|
@ -48,17 +48,13 @@ def app_tab3():
|
|||
vmargin = st.number_input("Vertical margin:",
|
||||
value=int(response_format_parameters.get("vmargin")),
|
||||
step=10)
|
||||
extension = st.selectbox("Extension:", ["jpg", "pdf", "mp4"])
|
||||
if extension == "mp4":
|
||||
fps = st.number_input("FPS:",
|
||||
value=int(response_format_parameters.get("fps")),
|
||||
step=1)
|
||||
stilltime = st.number_input("Still time:",
|
||||
value=int(response_format_parameters.get("stilltime")),
|
||||
step=1)
|
||||
else:
|
||||
fps = 0
|
||||
stilltime = 0
|
||||
extension = "mp4"
|
||||
fps = st.number_input("FPS:",
|
||||
value=int(response_format_parameters.get("fps")),
|
||||
step=1)
|
||||
stilltime = st.number_input("Still time:",
|
||||
value=int(response_format_parameters.get("stilltime")),
|
||||
step=1)
|
||||
|
||||
# Envoi
|
||||
if st.button("Generate post"):
|
||||
|
@ -91,14 +87,9 @@ def app_tab3():
|
|||
file_data = response.content
|
||||
datef = datetime.datetime.now().strftime("%m-%d-%Y")
|
||||
|
||||
if document_specs.extension in ["jpg"]:
|
||||
extn = "zip"
|
||||
else:
|
||||
extn = document_specs.extension
|
||||
|
||||
file_name = f"{document_specs.style}-{document_specs.format}-{datef}-output.{extn}"
|
||||
file_name = f"{document_specs.style}-{document_specs.format}-{datef}-output.zip"
|
||||
|
||||
st.download_button('Télécharger', file_data, file_name=file_name)
|
||||
else:
|
||||
# If the request is unsuccessful, display the error status code and message
|
||||
st.error(f"Request failed with status code {response.status_code}: {response.text}")
|
||||
st.error(f"Request failed with status code {response.status_code}: {response.text}")
|
Reference in a new issue