Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,27 +28,27 @@ def main():
|
|
| 28 |
else:
|
| 29 |
st.write("Provided URL did not contain captions")
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
|
| 53 |
if __name__ == "__main__":
|
| 54 |
main()
|
|
|
|
| 28 |
else:
|
| 29 |
st.write("Provided URL did not contain captions")
|
| 30 |
|
| 31 |
+
start_index = st.session_state.get('start_index', 0)
|
| 32 |
+
end_index = start_index + 6
|
| 33 |
+
|
| 34 |
+
# Display caption table
|
| 35 |
+
st.write("## Caption Table")
|
| 36 |
+
st.write("| Timestamp | Original |")
|
| 37 |
+
st.write("|-----------|----------|")
|
| 38 |
+
for i in range(start_index, min(end_index, len(captions_list))):
|
| 39 |
+
st.write(f"| {captions_list[i]['Timestamp']} | {captions_list[i]['Original']} |")
|
| 40 |
+
|
| 41 |
+
# Navigation buttons
|
| 42 |
+
col1, col2, col3 = st.columns([1, 8, 1])
|
| 43 |
+
if col1.button("Previous") and start_index > 0:
|
| 44 |
+
start_index -= 6
|
| 45 |
+
end_index -= 6
|
| 46 |
+
st.session_state['start_index'] = start_index
|
| 47 |
+
|
| 48 |
+
if col3.button("Next") and end_index < len(captions_list):
|
| 49 |
+
start_index += 6
|
| 50 |
+
end_index += 6
|
| 51 |
+
st.session_state['start_index'] = start_index
|
| 52 |
|
| 53 |
if __name__ == "__main__":
|
| 54 |
main()
|