Update index.js
Browse files371 unmodified lines37237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340454 unmodified lines459460461435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464371 unmodified lines console.error(e); throw e; }}//let konver = await convertToAudio(buffer, "mp4");//let upload = await uploadBuffer(konver);//let urel = upload != null ? { url_v2: upload } : null;let format = ytdl.chooseFormat(data.formats, { filter: 'audioonly', quality: bitrate });
if (format) { return { title: data.videoDetails.title, description: data.videoDetails.description, channel: data.videoDetails.ownerChannelName, views: formatViews(data.videoDetails.viewCount), publish: data.videoDetails.publishDate, duration: formatDuration(data.videoDetails.lengthSeconds), size: format.contentLength ? formatSize(format.contentLength) : 0, quality: format.audioQuality, thumb: data.videoDetails.thumbnails[0].url, dl_url: format.url, //...urel, };} else { throw new Error('No suitable format found');}} catch (error) {console.error('Error occurred:', error);return error;}}*/
async function ytmp4(url, quality = 'highestvideo') {54 unmodified lines }}
//let konver = await convertToAudio(buffer, "mp4");//let upload = await uploadBuffer(konver);//let urel = upload != null ? { url_v2: upload } : null;let format = ytdl.chooseFormat(data.formats, { filter: 'audioonly', quality: bitrate });
if (format) { return { title: data.videoDetails.title, description: data.videoDetails.description, channel: data.videoDetails.ownerChannelName, views: formatViews(data.videoDetails.viewCount), publish: data.videoDetails.publishDate, duration: formatDuration(data.videoDetails.lengthSeconds), size: format.contentLength ? formatSize(format.contentLength) : 0, quality: format.audioQuality, thumb: data.videoDetails.thumbnails[0].url, dl_url: format.url, //...urel, };} else { throw new Error('No suitable format found');}} catch (error) {console.error('Error occurred:', error);return error;}}
// Fungsi untuk mengkonversi video dari YouTubeconst convert = async (url, v_id, ftype, fquality, fname, token, timeExpire) => {index.js+27-27