Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -60,8 +60,13 @@ def dlvid(vid):
|
|
60 |
os.remove("test.mp4")
|
61 |
|
62 |
# 使用 ffmpeg 将 m3u8 转换为 mp4
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
65 |
os.system(ffmpeg_command)
|
66 |
return 'test.mp4'
|
67 |
else:
|
|
|
60 |
os.remove("test.mp4")
|
61 |
|
62 |
# 使用 ffmpeg 将 m3u8 转换为 mp4
|
63 |
+
cookie_dict = s.cookies.get_dict()
|
64 |
+
cookie_string = ''
|
65 |
+
for key, value in cookie_dict.items():
|
66 |
+
cookie_string += f'{key}={value}; path=/; domain={response.url.split("//")[1].split("/")[0]}; '
|
67 |
+
|
68 |
+
ffmpeg_command = f'ffmpeg -protocol_whitelist "concat,file,http,https,tcp,tls,crypto" -i "{mp3link}" -c copy -cookies "{cookie_string}" "test.mp4"'
|
69 |
+
|
70 |
os.system(ffmpeg_command)
|
71 |
return 'test.mp4'
|
72 |
else:
|