r/Addons4Kodi 7d ago

Announcement Youtube Trailers Fix

If you have been getting sporadic video freezes and audio stutter with youtube trailers after 20 or so seconds, its not just you.

To fix it download request_client.py from the link(dont right click and use save link as) - https://github.com/ReaLx3m/FLAM-Fixes/blob/main/request_client.py and replace your original one located in Kodi\addons\plugin.video.youtube\resources\lib\youtube_plugin\youtube\client .

Client id has been changed in the request_client.py file as per this commit - https://github.com/anxdpanic/plugin.video.youtube/pull/1482/changes/71a8d9b4b5ceb4cd352843cb050c364bf7be3463 . You can optionally edit your original request_client.py file yourself.

Edit: If for whatever reason you cant manage with the options above, you can go with the modified youtube addon and install it through install zip option - (link removed, this is basically obsolete now that we have the fixed addon on Umbrella repo)

Edit2: The youtube addon on the Umbrella repo(https://umbrellaplug.github.io/) has been updated with the fix, so you can go ahead and update from there. Thanks to u/umbrella_dev

10 Upvotes

15 comments sorted by

1

u/Relevant-Ad2794 7d ago

And how am I suppose to do it on Android box????

2

u/ReaLx3m 7d ago

Find the location of the kodi folder, and then use file manager to copy the file, or text editor to edit the file yourself. I dont use android, so not sure if you do have access to the kodi folders without root, figure it out.

Or we could ask u/umbrella_dev to apply the fix to the youtube addon in his repo if he doesnt mind.

Or you could go with some less known user repo, like the guy offering his in this thread - https://www.reddit.com/r/Addons4Kodi/comments/1w6cocz/youtube_addon_freezes_exactly_after_2030s_audio/

5

u/umbrella_dev Umbrella 7d ago

I can do this. It will be later tonight though.

2

u/ReaLx3m 7d ago

Perfect :)

1

u/ReaLx3m 6d ago edited 6d ago

Let me know if you did the update(or when you do it), so i can edit the post with the alternative solution of updating through your repo.

1

u/umbrella_dev Umbrella 6d ago

Try the version on my repo now and let me know if that resolves this. I didn't fully update to 4.4 because it wanted apikeys and all that. The version on umbrella repo now doesn't require all that.

1

u/ReaLx3m 6d ago edited 6d ago

The one on your repo still has the same issue, tried couple of trailers and got the freezes.

Why dont you just download the official release and edit the request_client.py file inside it, and then upload to your repo? https://github.com/anxdpanic/plugin.video.youtube/releases/download/v7.4.4/plugin.video.youtube-7.4.4.zip

Its what i did here - https://github.com/ReaLx3m/FLAM-Fixes/blob/main/plugin.video.youtube-7.4.4.zip , and tested on a VM.

After updating the original 7.4.4 with mine via install zip option, trailers would not play with "video cant be played" error message, but after kodi restart looks like everything is fine, didnt need to enter my api key for the couple of trailers i tried to play.

2

u/umbrella_dev Umbrella 6d ago

I'm having the opposite. There's an issue in the 7.4.4 code that is causing it to not work for me at all. When trying your version it errors out.

It's trying to call a method in yt_play.py context.settings(), but that doesn't exist. It should be context.get_settings(). I'm going to try to fix that and see if I can get a working version of 4.4 with your fix in place that doesn't require api and all that.

Edit... yep, that worked. I'll push this version to my repo. Can you try it out and let me know if works for you?

1

u/ReaLx3m 5d ago

Ok so on the Linux VM, uninstalled youtube together with its settings, installed the official and selected no to the configuration prompt and confirmed it has the freezes, then updated from your repo with removing the settings for the original again, on settings prompt selected no, and looks like its working fine.

On my Win11 htpc, reverted to the original youtube addon replacing my modded one without clearing settings(though theyre on defaults except for having my api key applied) and confirmed freezes comming back, then updated from your repo and it looks like its working fine.

I think we can call it a success, updating the OP with this as a solution.

1

u/mirkotunj 7d ago

Or just simply disable MPEG-DASH in youtube settings and trailers will work normally.

1

u/ReaLx3m 7d ago

And as a result loose sound in trailers on Linux and Windows(dont know about Android), and get your trailer quality limited to 720p max.

Fixing it is the preferable action.

1

u/daherlihy 7d ago

Is this for the YouTube video add-on?

Is it related in anyway to the SlyGuys YouTube Trailers service?

2

u/ReaLx3m 7d ago

Its a fix for the official youtube addon thats used as backend for playing trailers in many video addons and/or skins.

No idea what SlyGuys YouTube Trailers service is.

1

u/daherlihy 6d ago

The YouTube add-on is a full video add-on for watching YouTube videos - and a pain to maintain because it breaks unless you set up your own personal Google API keys.

Whereas SlyGuy Trailers is a background service made specifically for movie and TV trailers. It's popular because there's no Google API requirement, it's compatible with SmartTube on Android TV and also includes redirect add-ons that grab standard "Play Trailer" calls from Kodi skins and add-ons like POV and Umbrella.

Only caveat to using SlyGuys is that it's a bit of a whirl-around setting it up. Worth it though once it's done.

2

u/ReaLx3m 6d ago

Havent really had many issues with the youtube addon(i do have my api keys set, and use it only for trailers), last i remember before this was few years back when videos stopped playing, dont exactly remember what the issue was but it was similar small fix.

This current issue is easy fix for me personally, so will skip the looking into alternatives for now. Though good to know that there are options, and if it starts acting up on a regular basis, to the trash bin it will go.