Spaces:
Paused
Paused
Update index.js
Browse files
index.js
CHANGED
|
@@ -273,7 +273,7 @@ async function getAudioMP3Url(videoUrl) {
|
|
| 273 |
const config = { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36', 'Referer': 'https://cobalt.tools/' } };
|
| 274 |
*/
|
| 275 |
let obj = { url: videoUrl }
|
| 276 |
-
const video = await
|
| 277 |
const path_audio = path.join(tempDir, generateRandomName(10) + '.mp3');
|
| 278 |
const id_video = await GetId(videoUrl);
|
| 279 |
const infoVids = await getVideoDetailsWithApi(id_video);
|
|
@@ -282,7 +282,7 @@ async function getAudioMP3Url(videoUrl) {
|
|
| 282 |
|
| 283 |
await new Promise((resolve, reject) => {
|
| 284 |
ffmpeg()
|
| 285 |
-
.input(video
|
| 286 |
.outputOptions('-f mp3')
|
| 287 |
.outputOptions('-acodec libmp3lame')
|
| 288 |
.outputOptions('-ab 128k')
|
|
|
|
| 273 |
const config = { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36', 'Referer': 'https://cobalt.tools/' } };
|
| 274 |
*/
|
| 275 |
let obj = { url: videoUrl }
|
| 276 |
+
const video = await axios.get("https://mxmxk-helper.hf.space/yt/dl?url=" + obj.url + "&type=audio");
|
| 277 |
const path_audio = path.join(tempDir, generateRandomName(10) + '.mp3');
|
| 278 |
const id_video = await GetId(videoUrl);
|
| 279 |
const infoVids = await getVideoDetailsWithApi(id_video);
|
|
|
|
| 282 |
|
| 283 |
await new Promise((resolve, reject) => {
|
| 284 |
ffmpeg()
|
| 285 |
+
.input(video)
|
| 286 |
.outputOptions('-f mp3')
|
| 287 |
.outputOptions('-acodec libmp3lame')
|
| 288 |
.outputOptions('-ab 128k')
|