Kodi Community Forum

Full Version: YouTube
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2023-02-14, 21:15)pauls156 Wrote: [ -> ]Sometimes it works without the API keys, sometimes it doesn’t. Hopefully without the API keys, it’ll work for awhile. How long do API keys usually work before becoming expired?
i dont have an answer for this, hopefully someone can chime in that has maybe documented it or found documentation somewhere else
I assume the migration to InfoTagVideo in 6.8.25.alpha3 is the reason video durations aren't showing up in the bottom right for me in Estuary anymore?  Seems like something of a regression.  They only show if I've either watched the video before or it's cached from before I upgraded to the alpha, the latter of which only lasts until I select "refresh".  6.8.24 doesn't seem to have this issue, nor do VODs on the Twitch add-on.  Using Nexus via the LibreELEC beta.
Video lengths aren't showing up with other skins with 6.8.25.alpha3 either.
Dev question:  I have an addon that calls youtube to play a video using runplugin like this:
Code:
RunPlugin(plugin://plugin.video.youtube/play/?video_id=" +
                            youtube_id + "&screensaver=true&incognito=true)

then my addon sleeps until it gets onPlaybackEnded from Kodi Monitor, then it goes back to work.  The problem is if the video never starts (typically it's due to "no streams found").  Is there some way for an addon to determine that playback failed or youtube plugin is waiting for something (like user selecting resolution)?  Right now I'm just using a timeout counter that assumes playback failed if it times out.

scott s.
.
@scott967 
have you checked for an onplaybackfailed event?

i found one used here https://github.com/plexinc/plex-for-kodi.../player.py (line 53) but i cant find official documentation for the function on the kodi wiki

if that doesnt exist it should be requested, it would have use in this situation

otherwise i could suggest a wait for maybe 1 second then check player.isPlaying() after starting playback then if its not then playback failed
1. Format issue, please help !

How would I translate a youtube live stream, e.g., https://www.youtube.com/c/TravelChannel/live 
into the youtube plugin format for PVR Simple?
plugin://plugin.video.youtube/play/?video_id=$VIDEOID

(I can always go to the nominal videoid link, but the /live ensures that you always get the first live stream from the channel. In my experience the videoid's keep changing.)

2. Can the STRM URL youtube plugin work in another PVR?

3. Can we use yt_dl to *stream* website channels in PVR Simple? How?
Any other Kodi addon for website generic channels streaming besides Youtube addon (or yt_dl)?
I don't mean specific plugins like Crackle or Pluto.
@atharmian
open to suggestions?

in which way are you wanting to implement this?

if adding functionality to the youtube addon it might be advantageous to add a youtube channel handler which can be called as channel_id instead of video_id
the target function could be called like plugin://plugin.video.youtube/play/?channel_id=TravelChannel/live then it could load https://www.youtube.com/c/$channel_id with a simple url request
parse the output looking for:

html:
link rel="canonical" href="https://www.youtube.com/watch?v=7Okfl1oor_c"

and then proceed functionality on that link as if it had initially been called as plugin://plugin.video.youtube/play/?video_id=7Okfl1oor_c


outside of direct implementation, any simple processing as stated above on the channel link could exract the url for the video (each time the stream is requested)
(2023-02-19, 01:43)jepsizofye Wrote: [ -> ]@atharmian
open to suggestions?

in which way are you wanting to implement this?

if adding functionality to the youtube addon it might be advantageous to add a youtube channel handler which can be called as channel_id instead of video_id
the target function could be called like plugin://plugin.video.youtube/play/?channel_id=TravelChannel/live then it could load https://www.youtube.com/c/$channel_id with a simple url request
parse the output looking for:

html:
link rel="canonical" href="https://www.youtube.com/watch?v=7Okfl1oor_c"

and then proceed functionality on that link as if it had initially been called as plugin://plugin.video.youtube/play/?video_id=7Okfl1oor_c


outside of direct implementation, any simple processing as stated above on the channel link could exract the url for the video (each time the stream is requested)

Thanks but I was looking for something already built in, which it should be !

Unluckily I am not a dev so cannot write own code.
(2023-02-19, 04:40)atharmian Wrote: [ -> ]Thanks but I was looking for something already built in, which it should be !

Unluckily I am not a dev so cannot write own code.

oh. the mistake is mine i keep assuming everyone codes. sorry about that. maybe the dev will look into adding my suggestion for your and everyone elses benefit.
It happened again, using YouTube plugin v. 6.8.24+matrix.1 on Kodi v 19.4 for Linux Ubuntu 22.04.

after more than one week of  "YouTubeException: the following content is not available on your app" the plugin started working nicely again for two days, now I am getting once more the "not available" issue. The same videos are displayed without problems from a browser.

All this is happening without any changes: I am using the same network connection (with no VPN), I did not install or upgrade anything, I did not change my dev keys (I did previously, but that did not change anything), I shutdown and reboot the Linux box every time.

Does anyone have any suggestion on how to try to debug this ?
Question, and I would like a dev's answer for it.

I know that the api keys can also be used outside kodi. For instance, I use mine with youtube-viewer (a perl script that does what it says on the label).
But someone told me that the api keys are ONLY for people who develop apps based on the api, so any other usage for the... end user is practically illegal. Is this true? Does google have any restrictions for where the keys can be used?
It's someone can suggest because on a Kodi 20 (running from Ubuntu 22.04.2) i can't add the video lenght showed ? It's a addons issue or a skin setting ?
(2023-02-22, 21:26)DjDiabolik Wrote: [ -> ]It's someone can suggest because on a Kodi 20 (running from Ubuntu 22.04.2) i can't add the video lenght showed ? It's a addons issue or a skin setting ?
TL;DR - roll back to the v6.8.24 plugin version, before any of the InfoTagVideo related merges, if you can't do without the video length info and/or wait for things in active development to settle down.

Bit of both - it has been a warning in debug logs for a long while, (merged into Matrix codebase in May 2021) that the old method of obtaining video item details was deprecated and "might be removed in future Kodi versions."
The new method was a by-product of other work to increase performance, especially on pulling info from large data sets, and to streamline some Python headaches.

As far as I can tell (with my limited ability to follow in-depth development discussions) the old method hasn't been removed from Kodi Nexus codebase *yet*, but might be imminent because @anxdpanic has done/is doing some work to comply fully with the new method, which is not a trivial change.
It looks to me like there's some ongoing transitional work happening in the GitHub repo so this might not be the fully finalized code for the addon change in Matrix, so to speak.

N.B.: Judging by the most recent commit it could be that nailing down this issue is the final feature-add for Matrix, and that any subsequent adds will target Nexus+ only.
can't access my subscriptions or watch later.
Update

I have figured out the problem. I don't know what changed but after looking at my log I discovered where the problem was. It seems that all of a sudden the add-on does not like that I had the settings in YouTube set to 50 items per page. After some trial and error it seems like now everything works perfectly if you do not go any higher than 20 items page. It's also worth mentioning that I tried this using the latest version of the add-on available on Github which is 7.00 and the problem is still there. I do not have an account on that site so if anyone would like to take this information and report it, that would be great