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

Expose the track object instead of just the raw URL in createStream() #1919

Open
retrouser955 opened this issue Jul 2, 2024 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@retrouser955
Copy link
Collaborator

Describe the feature you would like
Instead of createStream(ext, url) being, expose the actual track instead of just the URL (createStream(track)). This would make devx way easier.

@discord-player/extractor

@retrouser955 retrouser955 added the enhancement New feature or request label Jul 2, 2024
@twlite
Copy link
Collaborator

twlite commented Jul 2, 2024

Can you provide an example

@retrouser955
Copy link
Collaborator Author

Can you provide an example

Current

player.extractors.register(SpotifyExtractor, {
  async createStream(ext, url) {
    const trackData = await ext.handle(url)
    const search = searchOnYoutube(`${trackData.author} - ${trackData.title}`)
    const streamURL = getStreamURL(search.url)
    return streamURL
  }
})

Change

player.extractors.register(SpotifyExtractor, {
  async createStream(ext, track) {
    const search = searchOnYoutube(`${track.author} - ${track.title}`)
    const streamURL = getStreamURL(search.url)
    return streamURL
  }
})

@twlite
Copy link
Collaborator

twlite commented Jul 2, 2024

Ok doesn't seem complicated, lets add track as the 3rd parameter to avoid breaking changes

@retrouser955
Copy link
Collaborator Author

Ok doesn't seem complicated, lets add track as the 3rd parameter to avoid breaking changes

Alright thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants