mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 19:28:29 +00:00
coub: remove testing file
i need to stop creating testing files in code so i stop forgetting to delete them
This commit is contained in:
parent
83ba2f8fe3
commit
e19a524523
@ -1,31 +0,0 @@
|
|||||||
async function a(id) {
|
|
||||||
const req = await fetch(`https://coub.com/view/${id}/`, {
|
|
||||||
method: "GET",
|
|
||||||
headers: {
|
|
||||||
"user-agent": "firefox",
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(request => request.text())
|
|
||||||
.catch(() => {return {error:'ClickToCopy'}});
|
|
||||||
|
|
||||||
if (!req) return { error: 'ErrorEmptyDownload' };
|
|
||||||
const infoScript = req?.split('{"flag":')[1]
|
|
||||||
const downloadLinks = infoScript?.split('"html5":')[1].split(',"mobile"')[0];
|
|
||||||
const videoUrl = downloadLinks?.split('"https://')[1].split('"')[0];
|
|
||||||
const audioUrl = downloadLinks?.split('"https://')[3].split('"')[0];
|
|
||||||
|
|
||||||
if (videoUrl?.includes('.mp4') && audioUrl?.includes('.mp3')) {
|
|
||||||
return {
|
|
||||||
urls: [
|
|
||||||
'https://' + videoUrl,
|
|
||||||
'https://' + audioUrl
|
|
||||||
],
|
|
||||||
filename: `coub_${id}.mp4`,
|
|
||||||
audioFilename: `coub_${id}_audio`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return { error: 'ErrorEmptyDownload' }
|
|
||||||
}
|
|
||||||
|
|
||||||
a("dhxy").then(console.log)
|
|
Loading…
Reference in New Issue
Block a user