Kodi Community Forum

Full Version: YouTube
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Works like a charm after changing out that file. Thanks for the help!

Jomjom79
@arsMOBILIS

Many thanks for the info.
Now working as expected.
Tried the file for Leia and it work like a charm, even with MPEG-DASH enabled.

I'm glad to see that I'm not the only one still on Leia (using it because the skit I use, Transparency, is abandoned and doesn't work with Matrix & up).  I think many people still use Leia too.  I hope the fix (and future fixes) will be ported to it, even if it's just support (no added features, but just keep it maintained).

Thanks
(2023-04-27, 22:30)StrangeAlien Wrote: [ -> ]That's video_info.py for Kodi Leia (checked on 18.9). Download it and replace existing file in addons/plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper folder. Reboot device (just restart Kodi isn't enough) and You're back in business, including MPEG-DASH with 1080 support

Worked like a charm here on Leia on a Raspberry3 too. And there was no need for a Kodi restart or even reboot. Tried it first by just replacing the original with your file, and voils YT worked again for me.
1000 Thanks, mate!
However i found something else that doesnt work anymore.. 
Search gives you video results but every video fails to play and gives you a "This video is unavailable" error. Not sure if this happened before changing out the file or not. 

Jomjom79
Can't confirm that. No problem with searches.
I'm still getting the issue where the videos are stopping partway through. It does it with both MPEG-DASH and without.
(2023-04-28, 20:20)Kaylakaze Wrote: [ -> ]I'm still getting the issue where the videos are stopping partway through. It does it with both MPEG-DASH and without.

For me it works fine with MPEG-DASH disabled but with it enabled it starts up fine at 1080P or 4K but after 20-30 seconds it stops buffering and the time counter stops incrementing and then about 5-10 seconds later the video closes and goes back to the menu.

UPDATE: Ok... a video just died and jumped back to the menu with MPEG-DASH disabled. Most of the time videos are playing through for me with MPEG-DASH disabled (I typically watch 15m-1h vids) but clearly every so often even those will die part way through.
(2023-04-27, 18:50)arsMOBILIS Wrote: [ -> ]Ok, it looks like a figured out a solution for the "The following content is not available on this app." error which lets you stay on a stable add-on release. You still have to disable MPEG-DASH for now, but I think this is a separate issue since it affects all the alpha versions as well and I can't see the add-on team releasing two alpha versions with this problem if it was was happening to them at release time. About 2 months ago I saw the same MPEG-DASH problem pop up for a couple of days but then it just went away by itself. I suspect if we are patient it will resolve itself this time too but in the meantime we just have to be patient for a while.

A little while back some people were saying to edit video_info.py to change the Android client info to send to YouTube, but nobody seemed sure what to change it to. When I tested the 6.8.26.Alpha1 version (and Alpha2) the "not available" error was gone and it occurred to me that it might be possible to retro-fit the Android client version fix in 6.8.26.Alpha1 or Alpha2 into the last stable add version (I'm using 6.8.25 Unofficial). I found the new code and pasted it over the old code and it seems to work perfectly (except for the MPEG-DASH issue). These instructions are for 6.8.2.25 but they should work for the latest stable 7.x release too.

First with a stable version of the add-on installed open video_input.py and find the block of code which looks like this (somewhere around line 742)...

        payload = {'videoId': video_id,
            'context': {'client': {'clientVersion': '16.49', 'gl': self.region,
            'clientName': 'ANDROID', 'hl': self.language}},
            'thirdParty': {'embedUrl': 'https://google.com'}
        }


...and completely replace it with this code from the alpha versions...

        ANDROID_APP_VERSION = '18.14.41'
        headers['User-Agent'] = 'com.google.android.youtube/%s ' \
                                '(Linux; U; Android 12; US) gzip' % ANDROID_APP_VERSION
        payload = {'videoId': video_id,
                   'contentCheckOk': True,
                   'racyCheckOk': True,
                   'context': {'client': {'clientVersion': ANDROID_APP_VERSION,
                                          'clientName': 'ANDROID',
                                          'gl': self.region,
                                          'hl': self.language,
                                          'androidSdkVersion': 31,
                                          'osName': 'Android',
                                          'osVersion': '12',
                                          'platform': 'MOBILE'}},
                   }


I restarted Kodi for good measure but you probably don't need to. I've tested this on my FireTV and Windows 10 installations and it works on both. Now I just have to wait for MPEG-DASH to start working properly again.

Thank you! It worked even for kodi 17.3 krypton with youtube plugin 6.8.25.
I downloaded the new "video_info.py" and installed it on my X86-based unit  (LibreElec 10.0.4   Kodi 19.5 Matrix  Youtube 6.8.25+matrix.1) and rebooted.

The "Video not available on this app" issue was resolved,  BUT,  certain videos are erroring with the text "This Video is unavailable".

Though, you can view the videos that return that error via a web browser..  (  https://www.youtube.com/watch?v=guXMb7zLblM  )

https://paste.kodi.tv/ugekucupar.kodi
(2023-04-29, 01:58)Yubby Wrote: [ -> ]Though, you can view the videos that return that error via a web browser..  (  https://www.youtube.com/watch?v=guXMb7zLblM  )

It might surprise you to hear this, but you can view almost the whole internet via a web browser.
(2023-04-27, 18:50)arsMOBILIS Wrote: [ -> ][...]
First with a stable version of the add-on installed open video_input.py and find the block of code which looks like this (somewhere around line 742)...

        payload = {'videoId': video_id,
            'context': {'client': {'clientVersion': '16.49', 'gl': self.region,
            'clientName': 'ANDROID', 'hl': self.language}},
            'thirdParty': {'embedUrl': 'https://google.com'}
        }


...and completely replace it with this code from the alpha versions...

        ANDROID_APP_VERSION = '18.14.41'
        headers['User-Agent'] = 'com.google.android.youtube/%s ' \
                                '(Linux; U; Android 12; US) gzip' % ANDROID_APP_VERSION
        payload = {'videoId': video_id,
                   'contentCheckOk': True,
                   'racyCheckOk': True,
                   'context': {'client': {'clientVersion': ANDROID_APP_VERSION,
                                          'clientName': 'ANDROID',
                                          'gl': self.region,
                                          'hl': self.language,
                                          'androidSdkVersion': 31,
                                          'osName': 'Android',
                                          'osVersion': '12',
                                          'platform': 'MOBILE'}},
                   }


[...]
im also verifying that this works for my Youtube plugin 6.8.25 in Kodi Krypton 17.6 (DS Player Edition) even with MadVR and SVP 3(ffdshow) on Windows 10
@Oceanic

No need to quote entire posts and add only a single line reply. Try using the @-sign for the forum user you want to 'ping'.

And what's up with the extra small font size..?
7.0.2Alpha 5 Official is working with a couple of glitches blank out where the leading ad is etc.  7.0.2 Alpha 5 Unofficial somehow killed the audio in all of Kodi, I had to install a Kodi backup.
CoreElec  with Nexus.
The fix proposed by @arsMOBILIS is only a partial fix. When using MPEG Dash videos die about 0:40 to 1:00 in. Disabling MPEG Dash is a little better, but not perfect. Most videos die about 3/4 of the way through. Only a few play all the way through to the end.

My current config:
OS: Windows 10
Kodi ver: 20.1.0
YouTube Plugin ver: 7.0.1 (stable)