mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-23 09:15:29 +01:00
parent
4bce011b0c
commit
fcbff53a7a
|
@ -90,6 +90,6 @@
|
|||
"spotify-web-api-node": "^5.0.2",
|
||||
"sqlite3": "^5.0.2",
|
||||
"youtube.ts": "^0.2.0",
|
||||
"ytdl-core": "^4.8.3"
|
||||
"ytdl-core": "^4.9.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,16 @@ export default class {
|
|||
|
||||
async youtubeVideo(url: string): Promise<QueuedSong|null> {
|
||||
try {
|
||||
const videoDetails = await this.youtube.videos.get(url);
|
||||
// Clean URL
|
||||
const u = new URL(url);
|
||||
|
||||
for (const [name] of u.searchParams) {
|
||||
if (name !== 'v') {
|
||||
u.searchParams.delete(name);
|
||||
}
|
||||
}
|
||||
|
||||
const videoDetails = await this.youtube.videos.get(u.toString());
|
||||
|
||||
return {
|
||||
title: videoDetails.snippet.title,
|
||||
|
|
11
yarn.lock
11
yarn.lock
|
@ -3295,7 +3295,7 @@ youtube.ts@^0.2.0:
|
|||
axios "^0.19.0"
|
||||
ytdl-core "^4.0.3"
|
||||
|
||||
ytdl-core@^4.0.3, ytdl-core@^4.8.3:
|
||||
ytdl-core@^4.0.3:
|
||||
version "4.8.3"
|
||||
resolved "https://registry.yarnpkg.com/ytdl-core/-/ytdl-core-4.8.3.tgz#21570d1834db13dec7828cf87bbf4c83c0fe68d7"
|
||||
integrity sha512-cWCBeX4FCgjcKmuVK384MT582RIAakpUSeMF/NPVmhO8cWiG+LeQLnBordvLolb0iXYzfUvalgmycYAE5Sy6Xw==
|
||||
|
@ -3303,3 +3303,12 @@ ytdl-core@^4.0.3, ytdl-core@^4.8.3:
|
|||
m3u8stream "^0.8.3"
|
||||
miniget "^4.0.0"
|
||||
sax "^1.1.3"
|
||||
|
||||
ytdl-core@^4.9.1:
|
||||
version "4.9.1"
|
||||
resolved "https://registry.yarnpkg.com/ytdl-core/-/ytdl-core-4.9.1.tgz#f587e2bd8329b5133c0bac4ce5ee1f3c7a1175a9"
|
||||
integrity sha512-6Jbp5RDhUEozlaJQAR+l8oV8AHsx3WUXxSyPxzE6wOIAaLql7Hjiy0ZM58wZoyj1YEenlEPjEqcJIjKYKxvHtQ==
|
||||
dependencies:
|
||||
m3u8stream "^0.8.3"
|
||||
miniget "^4.0.0"
|
||||
sax "^1.1.3"
|
||||
|
|
Loading…
Reference in a new issue