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

Switch to lavalink's new YouTube audio source manager #1552

Merged
merged 6 commits into from
May 10, 2024

Conversation

MichailiK
Copy link
Collaborator

@MichailiK MichailiK commented Apr 22, 2024

The lavalink devs seem to be separating the YouTube audio source manager into its own library: https://github.com/lavalink-devs/youtube-source. The new source manager seems to be more resilient against YouTube playback breaking.

This PR:

  • switches to this new audio source manager
  • removes the AudioSourceManagers.registerRemoteSources(this); call and instead registers each audio source manager lavaplayer provides individually, EXCEPT for the YouTube one
    • looking at lavaplayer's code, it doesn't look like you can exclude specific source managers, so to exclude the lavaplayer's built-in YouTube source manager, we have to register each source manager individually :/
  • reverts to a stable version of lavaplayer
  • gets rid of the logback filter we made to hide the "no google account provided thus cant play age restricted videos" log message, as its not present in that source manager.

@MichailiK MichailiK added this to the 0.4.1 milestone Apr 22, 2024
@MichailiK MichailiK force-pushed the new-youtube-lavaplayer-source branch from 5c21773 to 422deed Compare April 22, 2024 21:13
@MichailiK MichailiK changed the title Switch to new lavalink's new YouTube audio source manager Switch to lavalink's new YouTube audio source manager Apr 22, 2024
@ALocked1
Copy link

This change makes it so that you are required to use the full YouTube playlist link rather than just the playlist ID. If your local playlist txt files are still using just the ID, they will not work anymore; you have to add https://youtube.com/playlist?list= to the front of the ID.
image

@MichailiK
Copy link
Collaborator Author

I have asked the lavalink devs about that issue just now. They very graciously & rapidly provided a fix for this! I've updated the dependency to its latest version again.

@IngwiePhoenix
Copy link

LGTM!

Not a Java-pro or alike, so I can not contribute much - except say that the previously mentioned fork does indeed work.
Whwn can we expect a merge?

@jagrosh jagrosh merged commit 0afb3db into jagrosh:master May 10, 2024
2 checks passed
DaniDipp added a commit to Team-Sneakymouse/MusicBot that referenced this pull request Jul 13, 2024
commit 8733899
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Wed Jul 10 17:35:50 2024 -0400

    Update bug-report.yml

commit e5fd05e
Author: Moritz Bender <35152647+Morilli@users.noreply.github.com>
Date:   Wed Jul 10 13:19:13 2024 +0200

    Update dependencies to fix youtube issues (jagrosh#1609)

commit 6a5a9c7
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Fri May 10 17:43:49 2024 -0400

    Change playlist page count (jagrosh#1542)

    * change playlist page count

    * make the value configurable

    * small refactor

commit 8557f7a
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 21:36:43 2024 +0200

    Log track exceptions in the audio handler (jagrosh#1558)

commit 48e62f1
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 21:32:30 2024 +0200

    Revert "Always self-deafen (jagrosh#1491)" (jagrosh#1551)

    This reverts commit a7807b9.

commit 6f12c33
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Fri May 10 15:23:30 2024 -0400

    custom eval engine (jagrosh#1530)

commit 0afb3db
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 20:19:11 2024 +0200

    Switch to lavalink's new YouTube audio source manager (jagrosh#1552)

    * Switch to new lavalink's new YouTube audio source manager

    * Add back setPlaylistPageCount call for the youtube audio source manager

    * Manually add all the individual audio sources EXCEPT for old youtube

    * Remove unused import

    * Upgrade lavaplayer-youtube-source to 1.0.3

    * Upgrade lavaplayer-youtube-source to 1.0.4

commit 81322ef
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 20:14:28 2024 +0200

    Add seek command (supersedes jagrosh#344) (jagrosh#674)

    * Add seek command

    * Combine nested if statements

    * Put the seek command in correct place to keep alphabetical order

    * Add license header

    * Brackets on next line

    * Restructure if-statements

    * Check for permissions with DJCommand#checkDJPermission

    * Make regex slightly smaller

    * Optimize imports

    * Output length of current track if requested seek time is invalid

    * Restate seeked point when seeked successfully

    * Add empty newline at end of file to keep consistency

    * Create TimeUtil class for parsing and formatting time

    * Move FormatUtil#formatTime to TimeUtil, and refactor

    * Apply requested changes (Pass 2)

    * Seek based on current position in track

    * Apply requested changes (Pass 3)

    * Add javadoc param

    * Apply requested changes (Pass 4)

    * Fix merge

    * Avoid reassigning parameter (Codacy)

    * Rework timestamp parsing

    * Refactor timestamp parsing

    * Apply requested changes (Pass 5)

    * Add examples in help

    * Apply requested changes (Pass 6)

    * Fix missing import

    * Keep track of start timestamp & add "unit" times

    * Fix my abdominal merge with QueuedTrack

    * Use RequestMetadata to store start timestamp

    * Store request info in request metadata

    * Add regex to try getting a timestamp from the url

    * Require RequestMetadata for QueuedTracks

    * Add some unit tests for unit seeking

    * Add docs & examples

    ---------

    Co-authored-by: Whew., Inc <22574706+Whew-Inc@users.noreply.github.com>
DaniDipp added a commit to Team-Sneakymouse/MusicBot that referenced this pull request Jul 13, 2024
commit 8733899
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Wed Jul 10 17:35:50 2024 -0400

    Update bug-report.yml

commit e5fd05e
Author: Moritz Bender <35152647+Morilli@users.noreply.github.com>
Date:   Wed Jul 10 13:19:13 2024 +0200

    Update dependencies to fix youtube issues (jagrosh#1609)

commit 6a5a9c7
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Fri May 10 17:43:49 2024 -0400

    Change playlist page count (jagrosh#1542)

    * change playlist page count

    * make the value configurable

    * small refactor

commit 8557f7a
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 21:36:43 2024 +0200

    Log track exceptions in the audio handler (jagrosh#1558)

commit 48e62f1
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 21:32:30 2024 +0200

    Revert "Always self-deafen (jagrosh#1491)" (jagrosh#1551)

    This reverts commit a7807b9.

commit 6f12c33
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Fri May 10 15:23:30 2024 -0400

    custom eval engine (jagrosh#1530)

commit 0afb3db
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 20:19:11 2024 +0200

    Switch to lavalink's new YouTube audio source manager (jagrosh#1552)

    * Switch to new lavalink's new YouTube audio source manager

    * Add back setPlaylistPageCount call for the youtube audio source manager

    * Manually add all the individual audio sources EXCEPT for old youtube

    * Remove unused import

    * Upgrade lavaplayer-youtube-source to 1.0.3

    * Upgrade lavaplayer-youtube-source to 1.0.4

commit 81322ef
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 20:14:28 2024 +0200

    Add seek command (supersedes jagrosh#344) (jagrosh#674)

    * Add seek command

    * Combine nested if statements

    * Put the seek command in correct place to keep alphabetical order

    * Add license header

    * Brackets on next line

    * Restructure if-statements

    * Check for permissions with DJCommand#checkDJPermission

    * Make regex slightly smaller

    * Optimize imports

    * Output length of current track if requested seek time is invalid

    * Restate seeked point when seeked successfully

    * Add empty newline at end of file to keep consistency

    * Create TimeUtil class for parsing and formatting time

    * Move FormatUtil#formatTime to TimeUtil, and refactor

    * Apply requested changes (Pass 2)

    * Seek based on current position in track

    * Apply requested changes (Pass 3)

    * Add javadoc param

    * Apply requested changes (Pass 4)

    * Fix merge

    * Avoid reassigning parameter (Codacy)

    * Rework timestamp parsing

    * Refactor timestamp parsing

    * Apply requested changes (Pass 5)

    * Add examples in help

    * Apply requested changes (Pass 6)

    * Fix missing import

    * Keep track of start timestamp & add "unit" times

    * Fix my abdominal merge with QueuedTrack

    * Use RequestMetadata to store start timestamp

    * Store request info in request metadata

    * Add regex to try getting a timestamp from the url

    * Require RequestMetadata for QueuedTracks

    * Add some unit tests for unit seeking

    * Add docs & examples

    ---------

    Co-authored-by: Whew., Inc <22574706+Whew-Inc@users.noreply.github.com>
DaniDipp added a commit to Team-Sneakymouse/MusicBot that referenced this pull request Jul 13, 2024
commit 8733899
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Wed Jul 10 17:35:50 2024 -0400

    Update bug-report.yml

commit e5fd05e
Author: Moritz Bender <35152647+Morilli@users.noreply.github.com>
Date:   Wed Jul 10 13:19:13 2024 +0200

    Update dependencies to fix youtube issues (jagrosh#1609)

commit 6a5a9c7
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Fri May 10 17:43:49 2024 -0400

    Change playlist page count (jagrosh#1542)

    * change playlist page count

    * make the value configurable

    * small refactor

commit 8557f7a
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 21:36:43 2024 +0200

    Log track exceptions in the audio handler (jagrosh#1558)

commit 48e62f1
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 21:32:30 2024 +0200

    Revert "Always self-deafen (jagrosh#1491)" (jagrosh#1551)

    This reverts commit a7807b9.

commit 6f12c33
Author: John Grosh <john.a.grosh@gmail.com>
Date:   Fri May 10 15:23:30 2024 -0400

    custom eval engine (jagrosh#1530)

commit 0afb3db
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 20:19:11 2024 +0200

    Switch to lavalink's new YouTube audio source manager (jagrosh#1552)

    * Switch to new lavalink's new YouTube audio source manager

    * Add back setPlaylistPageCount call for the youtube audio source manager

    * Manually add all the individual audio sources EXCEPT for old youtube

    * Remove unused import

    * Upgrade lavaplayer-youtube-source to 1.0.3

    * Upgrade lavaplayer-youtube-source to 1.0.4

commit 81322ef
Author: Michaili K <git@michaili.dev>
Date:   Fri May 10 20:14:28 2024 +0200

    Add seek command (supersedes jagrosh#344) (jagrosh#674)

    * Add seek command

    * Combine nested if statements

    * Put the seek command in correct place to keep alphabetical order

    * Add license header

    * Brackets on next line

    * Restructure if-statements

    * Check for permissions with DJCommand#checkDJPermission

    * Make regex slightly smaller

    * Optimize imports

    * Output length of current track if requested seek time is invalid

    * Restate seeked point when seeked successfully

    * Add empty newline at end of file to keep consistency

    * Create TimeUtil class for parsing and formatting time

    * Move FormatUtil#formatTime to TimeUtil, and refactor

    * Apply requested changes (Pass 2)

    * Seek based on current position in track

    * Apply requested changes (Pass 3)

    * Add javadoc param

    * Apply requested changes (Pass 4)

    * Fix merge

    * Avoid reassigning parameter (Codacy)

    * Rework timestamp parsing

    * Refactor timestamp parsing

    * Apply requested changes (Pass 5)

    * Add examples in help

    * Apply requested changes (Pass 6)

    * Fix missing import

    * Keep track of start timestamp & add "unit" times

    * Fix my abdominal merge with QueuedTrack

    * Use RequestMetadata to store start timestamp

    * Store request info in request metadata

    * Add regex to try getting a timestamp from the url

    * Require RequestMetadata for QueuedTracks

    * Add some unit tests for unit seeking

    * Add docs & examples

    ---------

    Co-authored-by: Whew., Inc <22574706+Whew-Inc@users.noreply.github.com>
ElerWohlmuthFH pushed a commit to ElerWohlmuthFH/MusicBot that referenced this pull request Sep 20, 2024
* Switch to new lavalink's new YouTube audio source manager

* Add back setPlaylistPageCount call for the youtube audio source manager

* Manually add all the individual audio sources EXCEPT for old youtube

* Remove unused import

* Upgrade lavaplayer-youtube-source to 1.0.3

* Upgrade lavaplayer-youtube-source to 1.0.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants