2011-02-22, 18:16
diliban Wrote:Thanks for the reply HenrikDK. All I am trying to do is parse a website and get all the YouTube videos and pass it to Youtube addon to play the video(s).
I think I am calling the plugin using the correct URL and the method as I can see the from the logs that the plugin is retrieving the information about the videoid. But when the URL generated for the videoplayback/download is generated it errors out as shown in the log.
The URL I use for the Plugin Call
Code:url = "plugin://plugin.video.youtube/?action=play_video&videoid=%s" % videoid
Also the code to execute the url is
Code:xbmc.PlayMedia(url)
As seen in the log, the plugin seems to kick in fine to get the details of the video but then ends with an error when trying to play the video
Code:23:21:31 T:8820 M:1321521152 NOTICE: Name: Airtel Super S..
23:21:31 T:8820 M:1321521152 NOTICE: http://tamilkacheri.com/?page=view&id=2403
23:21:43 T:3100 M:1323032576 NOTICE: -->Python Interpreter Initialized<--
23:21:43 T:3100 M:1323016192 NOTICE: YouTube-2.0.0 ARGV: ['plugin://plugin.video.youtube/', '-1', '?action=play_video&videoid=XecLsVXi6oM']
23:21:43 T:3100 M:1321312256 NOTICE: YouTube-2.0.0 construct_video_url : 'XecLsVXi6oM'
23:21:43 T:3100 M:1321312256 NOTICE: YouTube-2.0.0 _get_details: 'XecLsVXi6oM'
23:21:43 T:3100 M:1321312256 NOTICE: YouTube-2.0.0 fetching page : http://gdata.youtube.com/feeds/api/videos/XecLsVXi6oM
23:21:43 T:3100 M:1321283584 NOTICE: YouTube-2.0.0 _getvideoinfo: 4022
23:21:43 T:3100 M:1321074688 NOTICE: plot updated
23:21:43 T:3100 M:1321074688 NOTICE: YouTube-2.0.0 _getvideoinfo done : 1
23:21:43 T:3100 M:1321074688 NOTICE: YouTube-2.0.0 _get_details done
23:21:43 T:3100 M:1321074688 NOTICE: YouTube-2.0.0 extractVariables : 'XecLsVXi6oM'
23:21:43 T:3100 M:1321074688 NOTICE: YouTube-2.0.0 fetching page : http://www.youtube.com/watch?v=XecLsVXi6oM&safeSearch=none&hl=en_us
23:21:44 T:3100 M:1322086400 NOTICE: YouTube-2.0.0 extractVariables done
23:21:44 T:3100 M:1322082304 NOTICE: YouTube-2.0.0 construct_video_url: stream_map : False
23:21:44 T:3100 M:1322082304 NOTICE: YouTube-2.0.0 construct_video_url: non stream map
23:21:44 T:3100 M:1322082304 NOTICE: YouTube-2.0.0 construct_video_url done
23:21:44 T:3100 M:1322082304 NOTICE: YouTube-2.0.0 - Playing video: ATSS 3 - XecLsVXi6oM - http://v8.lscache8.c.youtube.com/videoplayback?sparams=id,expire,ip,ipbits,itag,algorithm,burst,factor&fexp=906338,900203,910205&algorithm=throttle-factor&itag=35&ipbits=8&burst=40&sver=3&signature=C3740DBE63ADFC97CFF0967D3DCF38C12B6C4BD3.2B152490FB6FF657A1D3B1308841109CCDD887B6&expire=1298372400&key=yt1&ip=71.0.0.0&factor=1.25&id=5de70bb155e2ea83 | Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
23:21:44 T:3100 M:1322082304 ERROR: XFILE::CPluginDirectory::SetResolvedUrl - called with an invalid handle.
23:21:49 T:6824 M:1319911424 NOTICE: Storing total System Uptime
23:21:49 T:6824 M:1319911424 NOTICE: Saving settings
23:21:49 T:6824 M:1319866368 NOTICE: stop all
Where am I going wrong?
When I enter the VideoID in the youtube Addon under Playbyid the video play's fine. So I do know the video works. But I want it to work from my addon.
As far as i can see the xbmc python module doesn't have a PlayMedia function, so I'm kinda puzzeled as to how you're executing the plugin . Anyway I just tried copying this line of code into a random function on my dev machine and it worked:
Code:
xbmc.executebuiltin("XBMC.PlayMedia(plugin://plugin.video.youtube/?action=play_video&videoid=XecLsVXi6oM)")