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

Start YouTube Mix from inside NewPipe #3583

Open
XiangRongLin opened this issue May 13, 2020 · 12 comments
Open

Start YouTube Mix from inside NewPipe #3583

XiangRongLin opened this issue May 13, 2020 · 12 comments
Labels
feature request Issue is related to a feature in the app youtube Service, https://www.youtube.com/

Comments

@XiangRongLin
Copy link
Collaborator

XiangRongLin commented May 13, 2020

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:

  • Like YouTube, having the second suggestion be a youtube mix and, when youtube music mix is implemented, having the third suggestion be a youtube music mix.
  • Make the bar scrollable horizontally and add 2 radio icons. Problem is that just touching the other icons shows the hint "Hold to enqueue". So that message would always pop up when scrolling.

How will you/everyone benefit from this feature?

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

@XiangRongLin XiangRongLin added the feature request Issue is related to a feature in the app label May 13, 2020
@Stypox
Copy link
Member

Stypox commented May 14, 2020

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?

@Stypox Stypox added the youtube Service, https://www.youtube.com/ label May 14, 2020
@wb9688
Copy link
Contributor

wb9688 commented May 14, 2020

@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
Copy link
Member

Stypox commented May 14, 2020

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
Copy link
Contributor

wb9688 commented May 14, 2020

@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
Copy link
Member

Stypox commented May 14, 2020

That would be a good-ui solution, too

@ShareASmile
Copy link
Collaborator

Any update on this?

@XiangRongLin
Copy link
Collaborator Author

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 #3583 (comment))

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
Copy link
Member

Stypox commented Jul 8, 2021

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
Copy link
Collaborator Author

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
Copy link
Member

Stypox commented Jul 8, 2021

Ok, good idea. Another two questions:

  • Would it be better to add a getMixUrls() to StreamExtractor or to StreamLinkHandlerFactory? The advantage of the first approach would be that the mix urls could be generated based on the information of an extracted StreamInfo (it's not needed for youtube but it may be for other services); the advantage of the second approach is that mix urls could be generated just with the video id (but it may not be enough for some services). So I'd go with the StreamExtractor approach.
  • What should getMixUrls() return? A List<String> would be the simpler approach (with two/three urls for youtube: normal mix and yt music mix, possibly also the channel mix), but then how dowe distinguish between the two/three link in order to be able to correctly show the labels in the app (i.e. Mix, Music mix, Channel mix)? Do we just use the index in the List? Maybe we could instead make two/three methods: getMixUrl(), getSecondaryMixUrl() (, getChannelMixUrl())?

@XiangRongLin
Copy link
Collaborator Author

  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
Copy link
Member

Stypox commented Jul 8, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app youtube Service, https://www.youtube.com/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants