TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.75k stars 3.09k forks source link

Start YouTube Mix from inside NewPipe #3583

Open XiangRongLin opened 4 years ago

XiangRongLin commented 4 years ago

Describe the feature you want

Start a YouTube (music) mix from the video details screen

Is your feature request related to a problem? Please describe it

With TeamNewPipe/NewPipeExtractor#280 coming soon ™, i want to be able to start them from NewPipe. Currently i have to share them from the YouTube App to my debug build version and save the playlist.

Related Issue for youtube music mix; #3250

Additional context

~I am willing to implement it myself, but i want to get suggestions for the UI.~ I also want to know if this is possible/wanted, since it is a youtube only feature Possible would be:

How will you/everyone benefit from this feature?

Allow user to get an easily accessible "radio" feature for YouTube

Stypox commented 4 years ago

I second this, I would like to have this feature, too. I don't think having a scrollable bar would be a good UI, so I'd say it would be better to add it just below the next video. This would also mean that if someone disabled suggestions, he wouldn't be able to access mixes, but I think this is consistent (i.e. a mix is, actually, a suggestion). But I am not sure. A question: how would you be able to detect that a video presents a mix on youtube? Will you make the function that generates the mix url return null if the video does not have a mix item on the right?

wb9688 commented 4 years ago

@Stypox: All videos and channels have a mix, and Music videos/songs have a Music mix as well. Channel mixes are RDCM + channel ID, video mixes are RD + video ID, and Music mixes are RDAMVM + Music video/song ID. My mixes also exist, but I'm not sure what they are. I suggest adding a getAvailableMixes() (or getAvailableRadios() or whatever) function to ChannelExtractors and StreamExtractors (and of course also ChannelInfo and StreamInfo), which returns an array of mixes that exist for that channel/stream, and adding some button to show available mixes and open them in the ⋮ menu. I actually thought about this as well, but forgot to open an issue. We should also add support for SoundCloud's stations in NewPipeExtractor and also return them in the function to get the available mixes.

Stypox commented 4 years ago

I know mixes can always be generated using the base urls and the video id, but YouTube not always shows "Mix" playlists on the right. It would not be useful to show a mix for a video which is not music.

wb9688 commented 4 years ago

@Stypox: If you want YouTube's behavior exactly, you should make the next videos list use a MixedInfoItemsCollector and parse the playlists in it as well. However my suggestion was to do the following: adding some button to show available mixes and open them in the ⋮ menu, so that you can always start a mix anywhere.

Stypox commented 4 years ago

That would be a good-ui solution, too

ShareASmile commented 3 years ago

Any update on this?

XiangRongLin commented 3 years ago

I have no plans so far for this. Even though I implemented the extractor for mixes, now I don't really need that feature anymore. Since the extractor for mixes got recently merged, anyone who wants to do the UI part can do so. I can help with extractor changes if needed (see https://github.com/TeamNewPipe/NewPipe/issues/3583#issuecomment-628522388)

A new UI solution is also needed since the proposed UI-solution from @wb9688 doesn't work anymore since the 3dot menu doesn't exist anymore.

However my suggestion was to do the following: adding some button to show available mixes and open them in the ⋮ menu, so that you can always start a mix anywhere.

Another idea would be to add buttons after #4534 is merged. I haven't looked at it too closely, but i hope that its dynamic. Meaning if more buttons get added it will expand into new rows if necessary. This would cover video mixes. For channel mixes the 3dot option can be used.

Stypox commented 3 years ago

How should channel mixes (like this) be handled? The url requires both the channel ID and the video ID of the first video, and the obtained playlist changes its contents based on both (e.g. try opening this and this in newpipe)

XiangRongLin commented 3 years ago

I would recommend carving out the channel mixes out from here and only implement "normal" mixes first.

The discussion about how to handle them can also be moved into a seperate issue

Stypox commented 3 years ago

Ok, good idea. Another two questions:

XiangRongLin commented 3 years ago
  1. I'd also do StreamExtractor.
  2. Instead of distinguishing it by the order, why not wrap the String into a small class with a type field. The type field could either be another String or an enum or some sort. So this way the diffentiation is explicit in the type field instead of implicit from the order. Downside is the overhead of the wrapper class.

    class Mix {
    static String YOUTUBE_MIX = "youtube_mix";
    
    String type;
    String url;
    }

But non the less I would take the List<T> approach over the one with multiple methods. Here the method number could grow very big, depending on what the specific services need.


What could also be done is public String getMixUrl(String type) because usually you don't need the urls for all types of mixes, but just the one that you want to display now. Same here, instead of String an enum could be used

Stypox commented 3 years ago

I like the public String getMixUrl(String type) approach. Let's use an enum so as to reduce typing errors.