mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 18:59:19 +00:00
Support unlisted and direct url for YouTube
This commit is contained in:
@@ -237,7 +237,30 @@ class DiscordMusicPlayer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Construct our own YouTubeVideo for unlisted videos or somehow the search failed
|
let yt_info = await playdl.video_info("https://www.youtube.com/watch?v=" + youtubeLink.videoId);
|
||||||
|
if(yt_info) {
|
||||||
|
return new YouTubeVideo({
|
||||||
|
id: yt_info.video_details.id,
|
||||||
|
url: yt_info.video_details.url,
|
||||||
|
type: yt_info.video_details.type,
|
||||||
|
title: yt_info.video_details.title,
|
||||||
|
description: yt_info.video_details.description,
|
||||||
|
durationRaw: yt_info.video_details.durationRaw,
|
||||||
|
durationInSec: yt_info.video_details.durationInSec,
|
||||||
|
uploadedAt: yt_info.video_details.uploadedAt,
|
||||||
|
upcoming: yt_info.video_details.upcoming,
|
||||||
|
views: yt_info.video_details.views,
|
||||||
|
thumbnails: yt_info.video_details.thumbnails,
|
||||||
|
channel: yt_info.video_details.channel,
|
||||||
|
likes: yt_info.video_details.likes,
|
||||||
|
live: yt_info.video_details.live,
|
||||||
|
private: yt_info.video_details.private,
|
||||||
|
tags: yt_info.video_details.tags,
|
||||||
|
discretionAdvised: yt_info.video_details.discretionAdvised,
|
||||||
|
music: yt_info.video_details.music
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user