xbmc / Kore

Kore is a simple and easy-to-use Kodi remote.
Apache License 2.0
643 stars 244 forks source link

Support parsing youtube.com/{live,shorts} URLs shared from other apps #1010

Closed peat-psuwit closed 1 day ago

peat-psuwit commented 6 months ago

YouTube now use the new format for live streams and shorts. The pattern is https://www.youtube.com/{live,shorts}/<video id>. But other than pattern change, the video ID is otherwise completely compatible with the old format.

Since this pattern is similar to https://youtu.be/ format, re-use that code by re-shuffle the conditions a bit. The change is applied to both default and Invidious plugins.

Fixes: https://github.com/xbmc/Kore/issues/966

MoojMidge commented 5 months ago

@peat-psuwit - plugin.video.youtube supports loading a variety of different YouTube urls using the following plugin url format plugin://plugin.video.youtube/uri2addon/?uri=PERCENT_ENCODED_ORIGINAL_YOUTUBE_URL

All you would need to do is check whether the host ends with youtube.com or youtu.be (there are other hosts that are used and supported, but those two would cover the majority of shared urls), and then send the original url as a percent encoded value using the uri2addon plugin endpoint.

This allows a number of additional urls (channels/users, clips, embeds, etc.) to be supported, including shorts and live streams, without needing to parse the url in Kore.

peat-psuwit commented 1 day ago

@MoojMidge's idea is now implemented in #1019. Closing this PR in favor of that one. Thank you.