Kodi Community Forum

Full Version: Play video by passing it to another addon
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm writing a video addon that offers free videos from other websites. Playing these video files directly through the xbmc.player poses no problems but I don't know what to do when these videos are hosted on sites like Vimeo or YouTube.

I have the player links or IDs of the videos but is there a way to launch an other addon (like the Vimeo or YouTube addons) as player? I'm using Kodi on LibreElec/RPi4.

I could only find out how to configure an external player through playercorefactory.xml but not how to pass an url or ID to another addon.
(2020-09-16, 14:19)pa79 Wrote: [ -> ]I'm writing a video addon that offers free videos from other websites. Playing these video files directly through the xbmc.player poses no problems but I don't know what to do when these videos are hosted on sites like Vimeo or YouTube.

I have the player links or IDs of the videos but is there a way to launch an other addon (like the Vimeo or YouTube addons) as player? I'm using Kodi on LibreElec/RPi4.

I could only find out how to configure an external player through playercorefactory.xml but not how to pass an url or ID to another addon.

For youtube you only need to call the addon with its url and replace the [ID]
Code:
xbmc.executebuiltin(RunPlugin("plugin://plugin.video.youtube/?action=play_video&videoid=[ID]")
@Space2Walker 
I used the command to play the video but Kodi crashes as soon as I call it.
Below is the log

utojoyofos (paste)
(2022-05-12, 04:20)ltai0001 Wrote: [ -> ]@Space2Walker 
I used the command to play the video but Kodi crashes as soon as I call it.
Below is the log

utojoyofos (paste)

In the log it's says " the api key is invalid for youtube "
That’s a weird one I am pretty sure it is valid because the YouTube addon works and I can see videos s without getting any warnings
I think it’s these lines that cause the crash but not sure how to interpret

Code:
2022-05-11 19:17:38.896 T:779 ERROR <general>: CCurlFile::FillBuffer - Failed: Failure when receiving data from the peer(56)
2022-05-11 19:17:38.896 T:779 WARNING <general>: CCurlFile::FillBuffer - Reconnect, (re)try 1
2022-05-11 19:17:39.164 T:779 ERROR <general>: CCurlFile::FillBuffer - Failed: Failure when receiving data from the peer(56)
2022-05-11 19:17:39.164 T:779 WARNING <general>: CCurlFile::FillBuffer - Reconnect, (re)try 2
2022-05-11 19:17:39.310 T:744 ERROR <general>: Could not find suitable input format: x-directory/normal
2022-05-11 19:17:39.470 T:779 ERROR <general>: CCurlFile::FillBuffer - Failed: Failure when receiving data from the peer(56)
2022-05-11 19:17:39.470 T:779 ERROR <general>: CFileCache:Tonguerocess - <https://rr1---sn-n4v7snl7.googlevideo.com/videoplayback?expire=1652343458&ei
Without seeing any code, we can only guess.

This being said, executing a plugin from a plugin like in the post above is not supported. Pass the plugin:// URI like a normal playable item.
Hi
Thank you for your feedback,
How do I do it this? These are YouTube videos with YouTube IDs that I am dealing with

Quote: Pass the plugin:// URI like a normal playable item.
ok I recreated the youtube API and keys and I dont get the invalid key error anymore but now I am into a new issue 
2022-05-14 11:31:40.356 T:139 ERROR <general>: Open - error probing input format, https://www.youtube.com/watch?v=DSqDfW203Rc
2022-05-14 11:31:40.356 T:139 ERROR <general>: OpenDemuxStream - Error creating demuxer
Full Log Here
I am good on this
I actually used the below command to pass the video URL for Kodi to play
Code:
xbmcplugin.setResolvedUrl(_HANDLE, True, listitem=play_item)
The URL for the youtube video should look like this (replace YoutubeID with the ID of the video from youtube)
Code:
plugin://plugin.video.youtube/play/?video_id='+YoutubeID
no crashes of Kodi anymore and it plays the video with no issue on my Pi 3 osmc
That's the way to do it.

Alternatively, you could pass the plugin URI directly via the listitem when setting up the directory, if you know the ID's at this time.