XBMC Community Forum
[RELEASE] YouTube (Video) Plugin - De facto default standard YouTube Addon for XBMC - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Add-ons Help and Support (/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (/forumdisplay.php?fid=154)
+---- Thread: [RELEASE] YouTube (Video) Plugin - De facto default standard YouTube Addon for XBMC (/showthread.php?tid=79487)



- jhonnieblack - 2012-01-19 12:41

hi mr ussing! im facing some troubles with the plugin, something with the showMessage attribute, the log says:

09:58:55 M: 26062848 ERROR: -->Python Initialized<--
09:58:57 M: 23855104 NOTICE: YouTube-2.1.2 ARGV: ['plugin://video/YouTube/', '0', '?path=/root/search&action=play_video&videoid=P_Qm-yIM38U']
09:58:58 M: 23666688 NOTICE: YouTube-2.1.2 fetching page : http://gdata.youtube.com/feeds/api/videos/P_Qm-yIM38U
09:58:58 M: 23646208 NOTICE: YouTube-2.1.2 _getvideoinfo: 5570
09:58:58 M: 23502848 NOTICE: YouTube-2.1.2 _getvideoinfo done : 1
09:58:58 M: 23494656 NOTICE: YouTube-2.1.2 _getVideoLinks trying website
09:58:58 M: 23494656 NOTICE: YouTube-2.1.2 fetching page : http://www.youtube.com/watch?v=P_Qm-yIM38U&safeSearch=none
09:59:00 M: 23490560 NOTICE: YouTube-2.1.2 construct video url failed contents of video item {'count': 13804, 'Plot': 'Date Uploaded: 2010-03-06, View count: 13804\nRipped from Armin van Buuren - A State of Trance 446\n\nBlue Soho Recordings : http://www.bluesohorecordings.com', 'Title': 'SoundLift - Nakhti (Original Mix)', 'apierror': u"Couldn't extract video url", 'Rating': 4.8630136999999998, 'videoid': u'P_Qm-yIM38U', 'next': 'false', 'Duration': '06:35', 'Genre': 'Music', 'Studio': 'TranceAtmosphereTV', 'user': 'TranceAtmosphereTV', 'Date': '2010-03-06T09:36:40.000Z', 'thumbnail': u'http://i.ytimg.com/vi/P_Qm-yIM38U/0.jpg'}
09:59:00 M: 23490560 ERROR: Error Type: exceptions.AttributeError
09:59:00 M: 23490560 ERROR: Error Contents: YouTubePlayer instance has no attribute 'showMessage'
09:59:00 M: 23486464 ERROR: Traceback (most recent call last):
File "Q:\plugins\video\YouTube\default.py", line 52, in ?
navigator.executeAction(params)
File "Q:\plugins\video\YouTube\YouTubeNavigation.py", line 205, in executeAction
player.playVideo(params)
File "Q:\plugins\video\YouTube\YouTubePlayer.py", line 57, in playVideo
self.showErrorMessage(self.__language__(30603), video["apierror"], status)
File "Q:\plugins\video\YouTube\YouTubePlayer.py", line 365, in showErrorMessage
self.showMessage(title, result)
AttributeError: YouTubePlayer instance has no attribute 'showMessage'
09:59:00 M: 28942336 ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://video/YouTube/?path=/root/search&action=play_video&videoid=P_Qm-yIM38U]

im running it in an XBMC4Xbox. Built on May 16 2011 (SVN:30850, compiler 1310) and it just ran flawlessly until yesterday. can you help me? thank you very much!


Youtube addon suddenly stops working - orangebox - 2012-01-19 13:11

Hi,

I've been using the Youtube addon for a couple of weeks and it was working fine, but it has suddenly stopped working. Specifically, when I select a video and press play, it reports a script error and fails to play the video. I don't recall changing anything on the box recently that could have caused this change of behaviour.

The debug log is at:
http://http://pastebin.com/TjBKuSu2

The relevant part of the log appears to be:
Code:
21:42:14 T:2997861232 M:1939259392  NOTICE: YouTube-2.1.3
21:42:16 T:2997861232 M:1938501632    INFO: -->Python script returned the following error<--
21:42:16 T:2997861232 M:1938501632   ERROR: Error Type: exceptions.AttributeError
21:42:16 T:2997861232 M:1938501632   ERROR: Error Contents: YouTubePlayer instance has no attribute 'showMessage'
21:42:16 T:2997861232 M:1938501632   ERROR: Traceback (most recent call last):
                                              File "/home/c-media/.xbmc/addons/plugin.video.youtube/default.py", line 52, in ?
                                                navigator.executeAction(params)
                                              File "/home/c-media/.xbmc/addons/plugin.video.youtube/YouTubeNavigation.py", line 205, in executeAction
                                                player.playVideo(params)
                                              File "/home/c-media/.xbmc/addons/plugin.video.youtube/YouTubePlayer.py", line 57, in playVideo
                                                self.showErrorMessage(self.__language__(30603), video["apierror"], status)
                                              File "/home/c-media/.xbmc/addons/plugin.video.youtube/YouTubePlayer.py", line 365, in showErrorMessage
                                                self.showMessage(title, result)
                                            AttributeError: YouTubePlayer instance has no attribute 'showMessage'
21:42:16 T:2997861232 M:1938501632    INFO: -->End of Python script error report<--

I'm using XBMCLive Dharma, 2.6.32-29-generic i686, built on Mar 9 2011. Youtube addon version is 2.1.3.

I searched this thread for similar issues - I found something similar but I'm not sure whether it's related. I've tried rebooting as well as uninstalling the Youtube addon and then re-installing.

Grateful for any suggestions. I desperately need to fix this to stop my kids from screaming!!

Thanks,
CL

PS: big thanks to XBMC devs for developing such an awesome media player!


- bOO9000 - 2012-01-19 17:28

Hi I just installed OpenELEC and the same issue here orangebox.

Thanks


- Robotica - 2012-01-19 17:36

A Youtube-upload script. http://code.google.com/p/youtube-upload/wiki/Readme

Maybe this is something for this great plugin.


- salvi - 2012-01-20 03:13

I have the same Issue as Orange, where trying to play any video, gives out a message alert, but no videos are actually being played.

I just noticed this now, and I haven't made any chances to the box recently either.

Maybe youtube changing something yet again?


- anthony.selby - 2012-01-20 03:23

YouTube has changed ... if you go to the website and look at the player you now see a gear with the different resolutions available

I hope someone smarter then me is looking at this ...

Thanks


- evanroheff21 - 2012-01-20 09:17

I just wanted to state that I am also having problems with the plugin, same as those listed by jhonnieblack, orangebox, etc. Seems to be a change in the API as some have already noted. I can provide additional logs if needed, but hopefully someone can fix this up and get a new version into the repo. Thanks for everyone's hard work!


- enigma83 - 2012-01-20 09:41

If you don't understand this, and something breaks, it's not my fault.

On line 303 in YouTubePlayer.py, changing ttsurl to fexp fixes things for me. ttsurl is referred to later on as well, lines 334/335 but I did not have to change those.


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

Edit: Should point out, I've been mucking about with this a bit, so it might be on a line "around" 303, but not on 303 exactly.

Edit: Doesn't work on all clips. For the people who can follow programming logic, don't search for "ttsurl", search for
Code:
flashvars="(.*?)"
on line 303 (or thereabouts)


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


- evanroheff21 - 2012-01-20 18:47

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])



- jonnysarmbrace - 2012-01-20 19:10

Worked perfectly, thanks guys!