snuffyDev / Beatbump

Alternative YouTube Music frontend built with Svelte/SvelteKit 🎧
https://beatbump.io/
GNU Affero General Public License v3.0
1.07k stars 89 forks source link

Implement Sponsorblock #22

Closed davidcollini closed 2 years ago

davidcollini commented 2 years ago

Implementing sponsorblock to skip non-music sections of music videos would be great since a lot of music videos have intros that last multiple minutes

References for other projects that have sponsorblock implemented: https://github.com/FreeTubeApp/FreeTube https://github.com/TeamPiped/Piped https://github.com/nukeop/nuclear

ArjixWasTaken commented 2 years ago

YoutubeVanced is closed source, so it is useless to share it as a reference.

davidcollini commented 2 years ago

YoutubeVanced is closed source, so it is useless to share it as a reference.

I just assumed that it was open source since it has a GitHub, I’ve removed it from the list

ghost commented 2 years ago

Doesn't youtube music not have any music videos? Can you send an example of a song on YTmusic that is a music video?

davidcollini commented 2 years ago

The thing about YouTube music and music videos is that YouTube has an automatic system for detecting when the non-music parts of music videos are and they skip the music video part, and they do this because on the app, you can watch music videos instead of looking at the album cover, but when scraping data from this, you get the full music video and that's the problem Beatbump is having (@snuffydev correct me if any of this is wrong) (Also music videos on Beatbump only appear in albums, not when searching for a song)

Fjuro commented 2 years ago

Nope, you're wrong, YouTube Music has two types of videos - "normal" YouTube videos and basically music-only videos, which are the same as on other platforms - they are usually uploaded automatically by YouTube on channels with names like "Channel - Topic".

davidcollini commented 2 years ago

@Fjuro do you know if there's any way that YouTube music links together music videos and normal songs, since this issue can be closed if the song is able to be played instead of the music video when the music video is detected, also thanks for the correction :)

Fjuro commented 2 years ago

I don't think so, I only know it sometimes links the normal songs to the real artists' channels but I don't think it links the songs like that

davidcollini commented 2 years ago

That's what I expected so implementing sponsorblock still seems like the best way to solve this problem

snuffyDev commented 2 years ago

See, SponsorBlock wouldn't directly solve the problem of Music Videos, only would mask the fact of it. After a year+ of looking at the YouTube Music API, here's my current knowledge of how things work.

Since YouTube Music is just YouTube with a fancy frontend, naturally all pre-YouTube Music videos will be available to listen to. Heres an example: https://music.youtube.com/watch?v=_XI1DD_vJuY

Meanwhile you also may have the Official Audio track: https://music.youtube.com/watch?v=GI4MKy4w5lY&feature=share

Here's the catch though, if you go to the Album and play the song, you end up with the music video: https://music.youtube.com/watch?v=_XI1DD_vJuY&list=OLAK5uy_lygnisYueQ8YKv7JxwJS6zjJsmnStjRb0

This is a deliberate choice by whoever is managing the channel, which there's not really any way around it.

Whats this mean?

All of this shows that there really isn't a problem at hand, since YouTube Music's API is working as expected, same with Beatbump.

How I feel about it

The main problem with adding SponsorBlock is how much it would add in terms of weight to the project, as well as making any performance gains potentially be reversed. In order to get Beatbump to be as fast as it's expected/wanted/needed to be by those who use it, I've taken every possible step towards furthering that area of the project.

My main issue with this would be not only the amount of work required to do it, and maintain it -- but also the possibility of it being a step in the wrong direction. Many of the ways I could implement it (or something similar) would lead to slower load times, more data for the end-user to download and do stuff with, and overall could be a negative impact on the user experience -- especially if their Internet's really low-speed or their device is "low end". I understand that speed is not everything, but I do believe that if this were to be added, it would definitely need to be later down the line. Right now I feel Beatbump should consolidate the lessons already learned, and do one thing and to do it well, before trying to do more than "just play music"

Looking towards hearing thoughts and viewpoints about it

davidcollini commented 2 years ago

Okay this is all well and good, but the thing about this that confuses me is that in the YouTube music app there's an option to switch between the album cover and music video, and if we can find out how this works, it can potentially be implemented in Beatbump https://user-images.githubusercontent.com/89056889/161380969-e63aeb76-5632-4c0a-ac11-ae312164b999.MOV

Fjuro commented 2 years ago

@IronMaltese As far as I know, that feature just switches between video with audio and audio-only, basically just to save data - but it doesn't change the audio track, it always uses audio from the music video. @snuffyDev Also, about adding SponsorBlock - if you're worried about performance, you could just make it optional

davidcollini commented 2 years ago

I think putting optional sponsorblock support should be added at a certain point aswell

davidcollini commented 2 years ago

This feature on YouTube music links the album cover and the music video, currently on Beatbump the music video thumbnail shows up when playing a song in an album with a music video, if it can be found out how this is done, it can be implemented in Beatbump

davidcollini commented 2 years ago

I'm closing this since #113 is a better solution