Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -126,14 +126,13 @@ def dl(inp):
|
|
126 |
out_file=[]
|
127 |
try:
|
128 |
inp_out=inp.replace("https://","")
|
129 |
-
inp_out=inp_out.replace("/","_").replace(".","_")
|
130 |
-
os.system(f'yt-dlp "{inp}" --trim-filenames
|
131 |
out = f"{uid}/{inp_out}.mp4"
|
132 |
capture = cv2.VideoCapture(out)
|
133 |
fps = capture.get(cv2.CAP_PROP_FPS)
|
134 |
capture.release()
|
135 |
except Exception as e:
|
136 |
-
print (e)
|
137 |
out = None
|
138 |
return out,out,out,out,fps
|
139 |
def dl_json(inp):
|
@@ -141,7 +140,7 @@ def dl_json(inp):
|
|
141 |
out_file=[]
|
142 |
try:
|
143 |
inp_out=inp.replace("https://","")
|
144 |
-
inp_out=inp_out.replace("/","_").replace(".","_")
|
145 |
os.system(f'yt-dlp "{inp}" --write-info-json --skip-download -o "{inp_out}"')
|
146 |
out_file.append(f"{inp_out}.info.json")
|
147 |
out_json=f'{inp_out}.info.json'
|
|
|
126 |
out_file=[]
|
127 |
try:
|
128 |
inp_out=inp.replace("https://","")
|
129 |
+
inp_out=inp_out.replace("/","_").replace(".","_").replace("=","_").replace("?","_")
|
130 |
+
os.system(f'yt-dlp "{inp}" --trim-filenames 160 -o "{uid}/{inp_out}.mp4" -S res,mp4 --recode mp4')
|
131 |
out = f"{uid}/{inp_out}.mp4"
|
132 |
capture = cv2.VideoCapture(out)
|
133 |
fps = capture.get(cv2.CAP_PROP_FPS)
|
134 |
capture.release()
|
135 |
except Exception as e:
|
|
|
136 |
out = None
|
137 |
return out,out,out,out,fps
|
138 |
def dl_json(inp):
|
|
|
140 |
out_file=[]
|
141 |
try:
|
142 |
inp_out=inp.replace("https://","")
|
143 |
+
inp_out=inp_out.replace("/","_").replace(".","_").replace("=","_").replace("?","_")
|
144 |
os.system(f'yt-dlp "{inp}" --write-info-json --skip-download -o "{inp_out}"')
|
145 |
out_file.append(f"{inp_out}.info.json")
|
146 |
out_json=f'{inp_out}.info.json'
|