euler314 commited on
Commit
0f332b0
·
verified ·
1 Parent(s): fb399cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py CHANGED
@@ -1,6 +1,33 @@
1
  import streamlit as st
2
  # Must be the first Streamlit command
3
  st.set_page_config(page_title="Advanced File Downloader", layout="wide")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  import os
6
  import subprocess
 
1
  import streamlit as st
2
  # Must be the first Streamlit command
3
  st.set_page_config(page_title="Advanced File Downloader", layout="wide")
4
+ import os
5
+ import subprocess
6
+
7
+ # Playwright dependency installation
8
+ def install_playwright_dependencies():
9
+ try:
10
+ subprocess.run(['sudo', 'apt-get', 'update'], check=True)
11
+ dependencies = [
12
+ 'libnss3',
13
+ 'libnspr4',
14
+ 'libatk1.0-0',
15
+ 'libatk-bridge2.0-0',
16
+ 'libcups2',
17
+ 'libxcomposite1',
18
+ 'libxdamage1',
19
+ 'libatspi2.0-0'
20
+ ]
21
+ subprocess.run(['sudo', 'apt-get', 'install', '-y'] + dependencies, check=True)
22
+ subprocess.run(['playwright', 'install'], check=True)
23
+ st.success("Successfully installed Playwright dependencies")
24
+ except subprocess.CalledProcessError as e:
25
+ st.error(f"Error installing dependencies: {e}")
26
+ except Exception as e:
27
+ st.error(f"Unexpected error: {e}")
28
+
29
+ # Call the installation function
30
+ install_playwright_dependencies()
31
 
32
  import os
33
  import subprocess