Kodi Community Forum

Full Version: YouTube Plug-in Thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Since the recent YouTube change, and following the update of the add-on to 6.1.4, I also have been issues playing various YouTube videos (recently uploaded ones and old ones).
The plugin seems to be running into sequences of timeouts and only some times it makes it through after one or two tries. Although it does seem that once it doesn't get through, I can retry but it never works. A debug log of such an failed attempt is here: http://paste.kodi.tv/ularakeram.pl

First, I thought it to be network related, routing and such, but then I found out that friends and family have the same issues on different internet connections and locations.
The common denominator does seem to be using Kodi 17.6 with YouTube add-on 6.1.4.  I use my own API key, but that doesn't seem to matter.

Any pointers or clues on what is going wrong or things I can try or debug?
Hi. I've been getting an error message after every watched video. I think the relevant part of the log is the following:
Quote:Error Contents: HTTPSConnectionPool(host='s.youtube.com', port=443): Max retries exceeded with url: /api/stats/playback?sdetail=p%3A%2Ftv&subscribed=1&plid=*very long URL with api keys and stuff* (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x559a01d0>: Failed to establish a new connection: [Errno 111] Connection refused',))
Any idea what's causing this? I've tried adding personal API keys, logging out and in again with no change.
(2018-09-16, 14:04)anxdpanic Wrote: [ -> ]@"xbmclinuxuser" and @infodroid 
AkariDN has submitted the fix already, it's been reviewed and approved so it's just a matter of time before it's merged and resolved in Kodi.
As for a temporary fix, see post #2 alpha version. Note: once resolved in Kodi the watched marks from the temp fix will be reset.
@anxdpanic 
That's great news. Thank you.
@anxdpanic if you think it's more practical you can also try to all the "Refresh" as a general function.... this addons it's always "surf" lists of videos..........
@xalaros10 
The log appears to show banned addons (wiki), will require a full clean debug log (wiki) for support.

@siliconhippy 
1. Resolution switching only works if the video container contains multiple video streams(youtube doesn't do this with the mp4's), or when using mpeg-dash with stream selection set to manual.
2. It depends on system, and settings really. The lastest add-on alpha improves the speed of videos starting playback a bit.
3. This you'd have to ask in IPTV Simple Client support channel.

@osen Looks like you need to disable add-on Settings - Advanced - Force SSL certificate verification

@Mozillion The same video is working fine here, I would suspect something with youtube's cdn. Will try and spot check to see if I can experience the issue first hand.
Hello

Since yesterday i noticed that the youtube add-on is very slow. I use my own api-keys with Kodi 17.6. A search takes almost 1 minute to respond. If i click on a video to watch it takes a minute to start the video too.
In the logs there is no error. 
If i open youtube in a browser the speed is normal. So nothing is blocking. I use the latest Youtube add-on (6.1.4)

Do you have any ideas whats wrong with my system?
Since yesterday I can't enter my "Subscriptions" folder anymore. Everything else stills seems to be working fine. I can watch and rate videos, "My Subscriptions", "Recommendations", "Liked Videos", "Browse Channels" are all working. The only folder that doesn't work is the only folder I use every day. Tongue I already tried logging out and back in, deleting the settings and even completely deleting the plugin and reinstalling it. I also tried upgrading to the latest alpha (6.2.0~alpha6).

Here's the full debug log: http://paste.kodi.tv/xudiwovehi.sql

Thanks for this great plugin and I hope someone can find out what's wrong.
@anxdpanic: Force SSL certificate verification is already turned off unfortunately. Was the first thing I tried. I get the same error with it on and off.
@anxdpanic Indeed. I have found out it is IPv6 related. If I take the video URL that the logs report timeouts for and feed it to curl -4 -v https:///..., I get a 403, but for curl -v -6 I get a timeout. Great.. So something is wrong with the CDN then. I wonder why it works in the browser though, maybe it detects this issue much quicker and reverts to IPv4?

I am pretty sure it is not my connection as friends and family have other ISps, and I have seen others also report these delay / timeout issues in this thread too.
@infodroid and @"xbmclinuxuser" Mark as watched is fixed in the latest nightlies Sept 21+, use either 6.1.4 or 6.2.0~beta1

@Mozillion Thanks for the information, not sure why v4-v6 would be different via the website.

@LegendarySkar Can you try 6.2.0~beta1

@osen I'm not sure what is causing the issue, but since this isn't a critical connection -adding to watch history- I've silenced the error to logging only in 6.2.0~beta1. Will keep looking into it though.

@DjDiabolik I've added the refresh context menu in 6.2.0~beta1

@_Andy_ The add-on -API- vs the website isn't an equal comparison. Based on the information provided I can't guess at what is happening, providing a debug_log (wiki) may show something.

I've updated post #2 with ~beta1
@anxdpanic As there is no error in the logs i didn't do a log. In my case i guess it's a system issue not a plug in issue. I was right. @Mozillion is right. In my case it's ipv6 related too. I have a DUAL STACK connection from my ISP. Recently i have played with ipv6. I have some heavy firewall rules to protect my LAN. But the rules are for ivp4 only and i haven't
time yet to secure my LAN with ipv6.
So i blocked the delegated prefix from my ISP. In my LAN i have the global ipv6 addresses still bound to the adapter but the PC is not able to connect to the outside with ipv6 because of my recently changed firewall rules. That was causing the slow behavior.
I unbind the ipv6 address from my Kodi system and all is fine again.
It seems a fallback time issue from ipv6 to ipv4
@anxdpanic Yes, it works again. Thanks a lot!
So I take it that something in Youtubes API changed, which required a change in the plugin.
That was a fast fix. If only every customer support worked as fast as you. Big Grin
@_Andy_  Thanks for providing information on the cause.

@LegendarySkar Yea, the api sets the expectation that the items have a title, but at least one item in your subscribers has no title. Now it uses 'Untitled' instead of raising an error.
Hello,

Just a minor contribution as I hate ERROR messages  on logs... 

Scenario, when booting if dont have temp directory it throw and error saying that cannot get the temp Directory so I modified /.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/utils/monitor.py because it had useless code....so, no more startup ERROR´s

    def remove_temp_dir():
        temp_path = 'special://temp/plugin.video.youtube/'
        path = xbmc.translatePath(temp_path)
        if xbmcvfs.exists(path):
            try:
                xbmcvfs.rmdir(path, force=True)
            except:
                try:
                        shutil.rmtree(path)
                except:
                    xbmc.log('Failed to remove directory: {dir}'.format(dir=path), xbmc.LOGDEBUG)
                    return False
        return True


Salud!!!
JakerMx
@anxdpanic @_Andy_ Instead of changing the OS configuration or playing with firewalls, I have just configured Kodi via advancedsettings.xml to not use IPv6 for CURL (HTTP/FTP) requests for now as a work around.
See also this post: https://forum.kodi.tv/showthread.php?tid...pid2748934