mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-12 20:25:06 +01:00
fix + test
This commit is contained in:
parent
1f6c7c8ead
commit
cbb519d73e
3 changed files with 13 additions and 1 deletions
|
@ -18,6 +18,7 @@ export default function(r, host, audioFormat, isAudioOnly, lang, isAudioMuted) {
|
|||
if (isAudioOnly && !r.picker) action = "audio";
|
||||
if (r.picker) action = "picker";
|
||||
if (isAudioMuted) action = "muteVideo";
|
||||
if (r.isPhoto) action = "photo";
|
||||
|
||||
if (action === "picker" || action === "audio") {
|
||||
defaultParams.filename = r.audioFilename;
|
||||
|
@ -26,6 +27,9 @@ export default function(r, host, audioFormat, isAudioOnly, lang, isAudioMuted) {
|
|||
}
|
||||
|
||||
switch (action) {
|
||||
case "photo":
|
||||
responseType = 1;
|
||||
break;
|
||||
case "video":
|
||||
switch (host) {
|
||||
case "bilibili":
|
||||
|
|
|
@ -74,7 +74,7 @@ export default async function(obj) {
|
|||
} else if (data?.shortcode_media?.display_url) {
|
||||
return {
|
||||
urls: data?.shortcode_media?.display_url,
|
||||
filename: 'image.jpg'
|
||||
isPhoto: true
|
||||
}
|
||||
} else {
|
||||
return { error: 'ErrorEmptyDownload' }
|
||||
|
|
|
@ -850,6 +850,14 @@
|
|||
}
|
||||
}],
|
||||
"instagram": [{
|
||||
"name": "single photo post",
|
||||
"url": "https://www.instagram.com/p/CwIgW8Yu5-I/",
|
||||
"params": {},
|
||||
"expected": {
|
||||
"code": 200,
|
||||
"status": "redirect"
|
||||
}
|
||||
}, {
|
||||
"name": "various picker (photos + video)",
|
||||
"url": "https://www.instagram.com/p/CvYrSgnsKjv/",
|
||||
"params": {},
|
||||
|
|
Loading…
Reference in a new issue