plugin.video.youtube icon indicating copy to clipboard operation
plugin.video.youtube copied to clipboard

Automatically show "related videos"

Open zwarmapapa opened this issue 6 years ago • 3 comments

Hi, is there a way to automatically show "related videos" after a video has ended, similar to what youtube does?

zwarmapapa avatar Oct 07 '18 19:10 zwarmapapa

I've been looking for such a feature too, would really like to see one.

For the time being, if autoplay related is enabled, you can use the "next video" button to essentially do a repeated "I'm feeling lucky" thing, but this seems very hit-and-miss.

TLATER avatar Nov 30 '18 02:11 TLATER

6.4.0 has a rework of Settings - General - Autoplay suggested videos https://github.com/jdf76/plugin.video.youtube/wiki/Installation Also available from the the official repository now.

[chg] Settings - General - Autoplay suggested videos - limit playlist size to 1000 videos - request less relevant videos at one time - old behavior: add 50 most relevant videos for each video played, repeats allowed - result: a lot of barely relevant videos in groups of 50 - new behavior: add single most relevant video, no repeats - result: next video is always the most relevant video to the last video played

anxdpanic avatar Feb 11 '19 23:02 anxdpanic

The feature indeed works great. But only if the video was opened from the YouTube Addon's "Watch Later" folder. If using a home screen widget, which displays the content of the "Watch Later" folder, starting videos fails with this exception:

14:59:56.372 T:140363137410816  NOTICE: [plugin.video.youtube] Running: YouTube (6.4.1) on Leia (Kodi-18.0) with Python 2.7.15
                                            	Path: /play/
                                            	Params: {'video_id': 'RG7bqsHGtEk'}
14:59:57.834 T:140363137410816   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.KeyError'>
                                            Error Contents: 'error'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/default.py", line 15, in <module>
                                                runner.run(__provider__)
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/runner.py", line 60, in run
                                                __RUNNER__.run(provider, context)
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/impl/xbmc/xbmc_runner.py", line 31, in run
                                                results = provider.navigate(context)
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/abstract_provider.py", line 97, in navigate
                                                result = method(context, re_match)
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/register_provider_path.py", line 19, in wrapper
                                                return func(*args, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/provider.py", line 698, in on_play
                                                return yt_play.play_video(self, context)
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/yt_play.py", line 73, in play_video
                                                utils.add_related_video_to_playlist(provider, context, client, v3, video_id)
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/utils.py", line 584, in add_related_video_to_playlist
                                                playlist_items = playlist.get_items()
                                              File "/storage/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/impl/xbmc/xbmc_playlist.py", line 62, in get_items
                                                message = response['error']['message']
                                            KeyError: 'error'
                                            -->End of Python script error report<--

It is repeatable using version 6.4.0 with enabled "Autoplay suggested videos" and starting videos from home screen widget (in my case it's the embuary skin). It always fails with this error.

It works if I disable the feature OR start the video by browsing to the "Watch Later" folder using the YouTube Addon.

Can you guys try this with your setups and see if you can reproduce this as well?

gersilex avatar May 16 '19 13:05 gersilex