Spaces:
Running
Running
Commit
·
3a9b42e
1
Parent(s):
4484b9f
IDK
Browse files- app.py +10 -0
- requirements.txt +0 -3
app.py
CHANGED
@@ -4,6 +4,16 @@ import yt_dlp
|
|
4 |
import subprocess
|
5 |
import gradio as gr
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
# Deteksi orientasi video berdasarkan URL atau metadata
|
8 |
def get_orientation(url):
|
9 |
result = subprocess.run(['yt-dlp', '--get-filename', '-o', '%(width)sx%(height)s', url], capture_output=True, text=True)
|
|
|
4 |
import subprocess
|
5 |
import gradio as gr
|
6 |
|
7 |
+
# Install yt-dlp
|
8 |
+
try:
|
9 |
+
|
10 |
+
print("yt-dlp sudah terinstal.")
|
11 |
+
except ImportError:
|
12 |
+
print("yt-dlp belum terinstal, menginstal sekarang...")
|
13 |
+
subprocess.run(['pip', 'install', 'yt-dlp', 'mutagen'])
|
14 |
+
import yt_dlp
|
15 |
+
print("yt-dlp berhasil diinstal.")
|
16 |
+
|
17 |
# Deteksi orientasi video berdasarkan URL atau metadata
|
18 |
def get_orientation(url):
|
19 |
result = subprocess.run(['yt-dlp', '--get-filename', '-o', '%(width)sx%(height)s', url], capture_output=True, text=True)
|
requirements.txt
CHANGED
@@ -1,5 +1,2 @@
|
|
1 |
-
os
|
2 |
-
re
|
3 |
-
subprocess
|
4 |
gradio
|
5 |
yt-dlp
|
|
|
|
|
|
|
|
|
1 |
gradio
|
2 |
yt-dlp
|