Kodi Community Forum

Full Version: [depricated] old YouTube Plugin - XBMC 13.0 Frodo/Gotham only
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
vijayk416 Wrote:Thanks a lot Henrik. Can you please confirm if the repo update will work for those still on dharma?

Yes it will.

Generally when we talk about plugin versions:

2.1.x series = dharma
2.5 and above = eden
Hi,

Intermittently the youtube plugin refuses to play a video. The log shows the message below when it occurs. The video attempted in this case (http://www.youtube.com/watch?v=IgButvrG_...earch=none) works fine on same machine via firefox. Any ideas pls? I know on previous pages, people gave a fix for a similar issue. This problem for me only doesn't effect ALL videos, just most. Is that fix still worth attempting? Thanks

Code:
10:35:01 T:2850184048 M:1460060160  NOTICE: -->Python Interpreter Initialized<--
10:35:02 T:2850184048 M:1459412992  NOTICE: {'limit': '4'}
10:35:05 T:3027229552 M:1448632320 WARNING: Create - Unsupported protocol(script) in script://
10:35:07 T:2850184048 M:1456984064 WARNING: Previous line repeats 1 times.
10:35:07 T:2850184048 M:1456984064  NOTICE: -->Python Interpreter Initialized<--
10:35:09 T:2850184048 M:1460932608  NOTICE: YouTube-2.1.3 ARGV: ['plugin://plugin.video.youtube/', '1', '']
10:35:10 T:2850184048 M:1460944896  NOTICE: YouTube-2.1.3 view mode: 0
10:35:11 T:2850184048 M:1461137408  NOTICE: -->Python Interpreter Initialized<--
10:35:14 T:2850184048 M:1461141504  NOTICE: YouTube-2.1.3 ARGV: ['plugin://plugin.video.youtube/', '1', '?path=/root/search&login=false&store=searches&']
10:35:14 T:2850184048 M:1461141504  NOTICE: YouTube-2.1.3 view mode: 0
10:35:17 T:2850184048 M:1461149696  NOTICE: -->Python Interpreter Initialized<--
10:35:19 T:2850184048 M:1461067776  NOTICE: YouTube-2.1.3 ARGV: ['plugin://plugin.video.youtube/', '1', '?path=/root/search&action=search&search=peppa+pig&']
10:35:20 T:2850184048 M:1461080064  NOTICE: YouTube-2.1.3 search: 'peppa pig' - page: '0'
10:35:20 T:2850184048 M:1461080064  NOTICE: YouTube-2.1.3 fetching page : http://gdata.youtube.com/feeds/api/videos?q=peppa+pig&safeSearch=moderate&start-index=1&max-results=40
10:35:20 T:2850184048 M:1461080064  NOTICE: YouTube-2.1.3 _getvideoinfo: 205165
10:35:22 T:2850184048 M:1461161984  NOTICE: YouTube-2.1.3 _getvideoinfo done : 40
10:35:22 T:2850184048 M:1461161984  NOTICE: YouTube-2.1.3 search done :40
10:35:22 T:2850184048 M:1461161984  NOTICE: YouTube-2.1.3 view mode set to: 0
10:35:22 T:2850184048 M:1461161984  NOTICE: YouTube-2.1.3 setting view mode
10:35:24 T:2850184048 M:1454039040  NOTICE: -->Python Interpreter Initialized<--
10:35:26 T:2850184048 M:1453649920  NOTICE: YouTube-2.1.3 ARGV: ['plugin://plugin.video.youtube/', '1', '?path=/root/search&action=play_video&videoid=IgButvrG_Pg']
10:35:26 T:2850184048 M:1453649920  NOTICE: YouTube-2.1.3 fetching page : http://gdata.youtube.com/feeds/api/videos/IgButvrG_Pg
10:35:27 T:2850184048 M:1453682688  NOTICE: YouTube-2.1.3 _getvideoinfo: 5212
10:35:27 T:2850184048 M:1453428736  NOTICE: YouTube-2.1.3 _getvideoinfo done : 1
10:35:27 T:2850184048 M:1453428736  NOTICE: YouTube-2.1.3 _getVideoLinks trying website
10:35:27 T:2850184048 M:1453428736  NOTICE: YouTube-2.1.3 fetching page : http://www.youtube.com/watch?v=IgButvrG_Pg&safeSearch=none
10:35:27 T:2850184048 M:1453428736  NOTICE: YouTube-2.1.3 construct video url failed contents of video item {'count': 7237609, 'Plot': 'Date Uploaded: 2011-05-26, View count: 7237609\nThe family car is very muddy. Peppa and George have lots of fun helping Mummy and Daddy clean it.', 'Title': 'Peppa Pig - Cleaning the Car', 'apierror': u"Couldn't extract video url", 'Rating': 3.9281961999999999, 'videoid': u'IgButvrG_Pg', 'next': 'false', 'Duration': '05:12', 'Genre': 'Film & Animation', 'Studio': 'eonefamily', 'user': 'eonefamily', 'Date': '2011-05-26T09:44:15.000Z', 'thumbnail': u'http://i.ytimg.com/vi/IgButvrG_Pg/0.jpg'}
10:35:27 T:2850184048 M:1453428736   ERROR: Error Type: exceptions.AttributeError
10:35:27 T:2850184048 M:1453428736   ERROR: Error Contents: YouTubePlayer instance has no attribute 'showMessage'
10:35:27 T:2850184048 M:1453428736   ERROR: Traceback (most recent call last):
                                              File "/home/keeley/.xbmc/addons/plugin.video.youtube/default.py", line 52, in ?
                                                navigator.executeAction(params)
                                              File "/home/keeley/.xbmc/addons/plugin.video.youtube/YouTubeNavigation.py", line 205, in executeAction
                                                player.playVideo(params)
                                              File "/home/keeley/.xbmc/addons/plugin.video.youtube/YouTubePlayer.py", line 57, in playVideo
                                                self.showErrorMessage(self.__language__(30603), video["apierror"], status)
                                              File "/home/keeley/.xbmc/addons/plugin.video.youtube/YouTubePlayer.py", line 365, in showErrorMessage
                                                self.showMessage(title, result)
                                            AttributeError: YouTubePlayer instance has no attribute 'showMessage'
10:35:27 T:3078346624 M:1453428736   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.youtube/?path=/root/search&action=play_video&videoid=IgButvrG_Pg]
vijayk416 Wrote:Can these changes please be pushed out via a repo update? Anyone on OpenElec cannot make changes to the system. This is a core plugin for XBMC so having this as a manual fix does not seem intuitive to me. Can someone with access to updating the repo please look into this?

You can fix this manually to OpenElec.
Code:
Just ssh to your box (login: openelec/openelec) and do:
su root (default pwd: openelec)
cd ~/.xbmc/addons/plugin.video.youtube
vi YouTubePlayer.py

Edit the line mentioned on fix
If you dont know how to use vi -editor.. check this vi cheatcheet: http://www.lagmonster.org/docs/vi.html
reboot and finish.. All my issues with youtube are now gone and send to xbmc browser plugin is also working as it should now.

Thanks enigma83 for the fix.
I'm having trouble with the youtube app not saving my search results.

The youtube plugin used to save previous searches, now it does not.

I deleted the settings.xml file and reconfigured everything...same problem.

I deleted /User/Library/Preferences/XBMC/userdata/Database/commoncache.db and that got rid of some old searches, but it still does not keep any new ones.

I have attached a log.

http://pastebin.com/1HU4Mia1

Anyone else experience this or have any idea how to fix it?
Hi guys,

I'm getting the Script Failed: Plugin.video.youtube error, when trying to play movie trailers
I've tried the data = re.findall('flashvars="(.*?)"', data) fix but the some trailers still will not play
I'm running Dharma 10.1 Git: e9e9099 with YouTube plugin version: 2.1.3. Here are the errors that I am seeing:

Code:
6:50:38 T:10472 M:633970688  NOTICE: YouTube-2.1.3
16:50:40 T:10472 M:550137856   ERROR: Error Type: exceptions.NameError
16:50:40 T:10472 M:550080512   ERROR: Error Contents: global name 'content' is not defined
16:50:40 T:10472 M:530546688   ERROR: Traceback (most recent call last):
                                              File "C:\Users\~\AppData\Roaming\XBMC\addons\plugin.video.youtube\default.py", line 52, in ?
                                                navigator.executeAction(params)
                                              File "C:\Users\~\AppData\Roaming\XBMC\addons\plugin.video.youtube\YouTubeNavigation.py", line 205, in executeAction
                                                player.playVideo(params)
                                              File "C:\Users\~\AppData\Roaming\XBMC\addons\plugin.video.youtube\YouTubePlayer.py", line 52, in playVideo
                                                (video, status) = self.getVideoObject(params);
                                              File "C:\Users\~\AppData\Roaming\XBMC\addons\plugin.video.youtube\YouTubePlayer.py", line 254, in getVideoObject
                                                (links, video) = self._getVideoLinks(video, params)
                                              File "C:\Users\~\AppData\Roaming\XBMC\addons\plugin.video.youtube\YouTubePlayer.py", line 322, in _getVideoLinks
                                                video["apierror"] = re.compile('reason=(.*)%3Cbr').findall(content)[0]
                                            NameError: global name 'content' is not defined
16:50:40 T:9700 M:521093120   ERROR: XBMC.PlayMedia could not play media: plugin://plugin.video.youtube/?action=play_video&videoid=ZuMNJVImHe4


Does anyone know how to fix this?
evanroheff21 Wrote:Thanks Enigma83! I tried out your fix on v2.1.3 of the plugin running on Ubuntu 10.04. For me, it was actually line 302. I'll post some more context of the code so others may try this out, until an official fix is released.


Code before changes (YouTubePlayer.py)
Code:
else:
        data = result
        data = data[data.find('flashvars'):].replace("\n", "").replace("&amp;", "&")
this line -->    data = re.findall('="(ttsurl=.*?)"', data)
        if len(data) > 0:
            player_object = self._convertFlashVars(data[0])
Code after changes (YouTubePlayer.py)
Code:
else:
        data = result
        data = data[data.find('flashvars'):].replace("\n", "").replace("&amp;", "&")
this line -->    data = re.findall('flashvars="(.*?)"', data)
        if len(data) > 0:
            player_object = self._convertFlashVars(data[0])

FUCK YEAH..... Happy Wife and Happy me....

-=Jason=-
Thanks for the fix! I noticed it when showing it off to my friends, who laughed at me for getting this foolish Linux thingy.

After fixing it with SSH'ing into my machine they all think I'm a hacker. Smile
Is anyone else able to get to page 2 of their subscriptions list?

I get a script error when I click next page
I've been pulling my hair out trying to fix this all day. Added to my plugin and I'm good to go! The new YouTube has been going for about a week as far as I can tell and I was determined to get this repaired today. Again, many thanks.
For some reason the fix didn't work for me, so if it's useful for anybody, here's my fix:

Open YouTubePlayer.py and look for this code (like the original fix):

Code:
                data = result
                data = data[data.find('flashvars'):].replace("\n", "").replace("&amp;", "&")
                data = re.findall('="(ttsurl=.*?)"', data)
                if len(data) > 0:
                    player_object = self._convertFlashVars(data[0])

Replace the line
Code:
data = re.findall('="(ttsurl=.*?)"', data)
with
Code:
data = data[11:data.find('"', 12)]

And the line
Code:
player_object = self._convertFlashVars(data[0])
with
Code:
player_object = self._convertFlashVars(data)
(just remove the "[0]" at the end).

Take care with the indentation!
jammu Wrote:You can fix this manually to OpenElec.
Code:
Just ssh to your box (login: openelec/openelec) and do:
su root (default pwd: openelec)
cd ~/.xbmc/addons/plugin.video.youtube
vi YouTubePlayer.py
Thank you Jammu, that did it. For the record, I had to do the second half of the fix i.e.

< data = re.findall('="(ttsurl=.*?)"', data)
---
> data = re.findall('flashvars="(.*?)"', data)
vijayk416 Wrote:Thank you Jammu, that did it. For the record, I had to do the second half of the fix i.e.

< data = re.findall('="(ttsurl=.*?)"', data)
---
> data = re.findall('flashvars="(.*?)"', data)

This fix seems wrong.

The ttsurl is the "Transcripts" url. I mean sure, it may work for you. But it really isn't doing what it is supposed to do.
Hello,

Win7-64bit, Dharma 10.1 as well as Eden Beta2
Youtube plays fine in browser both IE and Chrome.

Fresh install of XBMC, then Add add-on Youtube (2.1.3), but nothing plays via the addon Sad

Quote:18:54:04 T:3256 NOTICE: -->Python Interpreter Initialized<--
18:54:04 T:3256 NOTICE: YouTube-2.1.3
18:54:06 T:2500 NOTICE: -->Python Interpreter Initialized<--
18:54:06 T:2500 NOTICE: YouTube-2.1.3
18:54:08 T:4932 NOTICE: -->Python Interpreter Initialized<--
18:54:08 T:4932 NOTICE: YouTube-2.1.3
18:54:11 T:4372 NOTICE: -->Python Interpreter Initialized<--
18:54:12 T:4372 NOTICE: YouTube-2.1.3
18:54:13 T:4372 ERROR: Error Type: <type 'exceptions.AttributeError'>
18:54:13 T:4372 ERROR: Error Contents: YouTubePlayer instance has no attribute 'showMessage'
18:54:13 T:4372 ERROR: Traceback (most recent call last):
File "C:\Users\MC\AppData\Roaming\XBMC\addons\plugin.video.youtube\default.py", line 52, in <module>
navigator.executeAction(params)
File "C:\Users\MC\AppData\Roaming\XBMC\addons\plugin.video.youtube\YouTubeNavigation.py", line 205, in executeAction
player.playVideo(params)
File "C:\Users\MC\AppData\Roaming\XBMC\addons\plugin.video.youtube\YouTubePlayer.py", line 57, in playVideo
self.showErrorMessage(self.__language__(30603), video["apierror"], status)
File "C:\Users\MC\AppData\Roaming\XBMC\addons\plugin.video.youtube\YouTubePlayer.py", line 365, in showErrorMessage
self.showMessage(title, result)
AttributeError: YouTubePlayer instance has no attribute 'showMessage'
18:54:13 T:4288 ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.youtube/?path=/root/search&action=play_video&videoid=OKRJfIPiJGY]
fix confirmed working! You can use nano instead of vi, makes it a little easier for non-pinguins out there
still not loading subscriptions, playlists etc, trailers not working for me.

i guess i just need to wait till Eden comes out