Update app.py
Browse files
app.py
CHANGED
@@ -43,15 +43,15 @@ def dl(inp,img):
|
|
43 |
try:
|
44 |
inp_out=inp.replace("https://","")
|
45 |
inp_out=inp_out.replace("/","_").replace(".","_").replace("=","_").replace("?","_")
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
out = f"{uid}/{inp_out}.mp4"
|
52 |
-
capture = cv2.VideoCapture(out)
|
53 |
-
fps = capture.get(cv2.CAP_PROP_FPS)
|
54 |
-
capture.release()
|
55 |
except Exception as e:
|
56 |
print(e)
|
57 |
out = None
|
|
|
43 |
try:
|
44 |
inp_out=inp.replace("https://","")
|
45 |
inp_out=inp_out.replace("/","_").replace(".","_").replace("=","_").replace("?","_")
|
46 |
+
|
47 |
+
#os.system(f'yt-dlp "{inp}" --trim-filenames 160 -o "{uid}/{inp_out}.mp4" -S res,mp4 --recode mp4')
|
48 |
+
os.system(f'yt-dlp --skip-download --write-subs --write-auto-subs --sub-lang en "{inp}" -o "{uid}/{inp_out}.txt"')
|
49 |
+
with open(f"{uid}/{inp_out}.txt") as f:
|
50 |
+
print(f.read())
|
51 |
+
#out = f"{uid}/{inp_out}.mp4"
|
52 |
+
#capture = cv2.VideoCapture(out)
|
53 |
+
#fps = capture.get(cv2.CAP_PROP_FPS)
|
54 |
+
#capture.release()
|
55 |
except Exception as e:
|
56 |
print(e)
|
57 |
out = None
|