Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.3.0] Empty YouTube tracks #1731

Closed
kiritokatklian opened this issue May 6, 2023 · 4 comments
Closed

[6.3.0] Empty YouTube tracks #1731

kiritokatklian opened this issue May 6, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@kiritokatklian
Copy link

Describe the bug
Searching for a song using the YouTube extractor returns an empty array of tracks. This still works fine on 6.2.1, but stopped working in 6.3.0

To Reproduce
Steps to reproduce the behavior:

Update to 6.3.0 then use the following code:

const { YouTubeExtractor } = require('@discord-player/extractor')

const tracks = await player.search("Example", {
		requestedBy: interaction.user,
		searchEngine: YouTubeExtractor.identifier
	})
		.then(x => x.tracks)
		.catch(e => console.error(e))

console.log(tracks) // []

Expected behavior
Receive an array of tracks.

Screenshots
n/a

Please complete the following information:

  • Node Version: 19.9.0
  • Discord Player Version: 6.3.0
  • Discord.js Version: 14.10.2

Additional context

  • play-dl Version: 1.9.2

Tried replacing play-dl with ytdl-core, specifically from this issue, but that didn't fix it.

The only way I got it working again is by downgrading back to 6.2.1, switching back to play-dl, and using QueryType.YOUTUBE instead of YouTubeExtractor.identifier.

@kiritokatklian kiritokatklian added the bug Something isn't working label May 6, 2023
@Crocross
Copy link
Contributor

Crocross commented May 6, 2023

Did you load the extractor too?

await player.extractors.register(YoutubeExtractor, {});

I'm also not sure if you need the searchEngine part in this case.

@twlite
Copy link
Collaborator

twlite commented May 6, 2023

The searchEngine: YouTubeExtractor.identifier is invalid. Use

searchEngine: `ext:${YouTubeExtractor.identifier}`

Also make sure youtube extractor is loaded and activated before executing search

@kiritokatklian
Copy link
Author

@Crocross yes I've tried both loadDefault() and registering only YouTubeExtractor. Both removed the warning about no extractors being registered, but both gave empty tracks too.

@skdhg Thanks! Prepending ext: fixed the issue. I didn't see it in the guide on the docs website, so I'm guessing this is a bug or at least not the intended way of using it. If not, then it'd be handy to update the docs to include it to avoid confusion in the future.

Thanks again!

@twlite
Copy link
Collaborator

twlite commented May 6, 2023

I didn't see it in the guide on the docs website, so I'm guessing this is a bug or at least not the intended way of using it. If not, then it'd be handy to update the docs to include it to avoid confusion in the future.

thanks for pointing this out @kiritokatklian

There's a mistake in the guide. It should be

+ import { SoundCloudExtractor } from '@discord-player/extractor';
+
+ const result = await player.search(query, {
+    // always use soundcloud extractor
-    searchEngine: SoundCloudExtractor.identifier
+    searchEngine: `ext:${SoundCloudExtractor.identifier}`
+});

@twlite twlite closed this as completed May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants