quick fix
This commit is contained in:
parent
e8274a1a65
commit
55eb1c76c5
@ -48,8 +48,7 @@ function getVideoInfo (arg) {
|
|||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
yt.on('close', function () {
|
yt.on('close', function () {
|
||||||
let ftdata = output.split('\n')
|
let ftdata = output.trim().split('\n')
|
||||||
console.log(ftdata.length)
|
|
||||||
if (ftdata.length > 1) {
|
if (ftdata.length > 1) {
|
||||||
let composite = []
|
let composite = []
|
||||||
for (let i in ftdata) {
|
for (let i in ftdata) {
|
||||||
|
@ -67,7 +67,7 @@ async function getTrackMetaReal (id) {
|
|||||||
candidates.push(obj)
|
candidates.push(obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (candidates.length) {
|
if (candidates.length && !bestMatch) {
|
||||||
// Sort candidates by view count
|
// Sort candidates by view count
|
||||||
candidates = candidates.sort(function (a, b) {
|
candidates = candidates.sort(function (a, b) {
|
||||||
return b.view_count - a.view_count
|
return b.view_count - a.view_count
|
||||||
@ -78,7 +78,7 @@ async function getTrackMetaReal (id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If there were no suitable candidates, just take the first response
|
// If there were no suitable candidates, just take the first response
|
||||||
if (!candidates.length) bestMatch = dldata[0]
|
if (!candidates.length && !bestMatch) bestMatch = dldata[0]
|
||||||
|
|
||||||
externalTracks[id] = {
|
externalTracks[id] = {
|
||||||
id: trdata.id,
|
id: trdata.id,
|
||||||
|
Loading…
Reference in New Issue
Block a user