XBMC.Player() not reading concatenated string.. very confusing
#1
Question 
Hello. I'm working on a vimeo script and in the testing stage I'm running into some problems with the xbmc player reading the URL to the FLV. Here's the code

Code:
import xbmc, xbmcgui, urllib
from xml.dom import minidom

clipID = str(3281558)

#get the XML data for the particular video and then parse it
requestURL = 'http://vimeo.com/moogaloop/load/clip:'+clipID+'/'
usock = urllib.urlopen(requestURL)
xmldoc = minidom.parse(usock)
usock.close()

#save the relevant info
request_signature = xmldoc.getElementsByTagName('request_signature')[0].firstChild.data
request_signature_expires = xmldoc.getElementsByTagName('request_signature_expires')[0].firstChild.data

#concat FLV location
flvURL = 'http://vimeo.com/moogaloop/play/clip:' + clipID + '/' + request_signature + '/' + request_signature_expires + '/?q=sd'

print 'clip id: ' + clipID
print 'sig: ' + request_signature
print 'sigex: ' + request_signature_expires

print flvURL[0:36]
print flvURL[36:]

xbmc.Player().play('http://vimeo.com/moogaloop/play/clip:3281558/b7f839c7601acda3a135c8a562efba64/1236013200/?q=sd')
#xbmc.Player().play(flvURL)

Regarding the last two lines: the top method works, the bottom doesn't. What gives? The flvURL string and the string copied directly into the function appear to be exactly the same, but one just won't work.
Reply
#2
I am not too much familiar with minidom, but it is possible value returned by minidom.parse is unicode and not string (like beautifulsoup). When you make a print, it will show you repr, but when you try to concatenate, it woudn't work.
Do you have the log of the error?

Try something like that:
Code:
#save the relevant info
request_signature = xmldoc.getElementsByTagName('request_signature')[0].firstChild.data.encode("utf-8")
request_signature_expires = xmldoc.getElementsByTagName('request_signature_expires')[0].firstChild.data.encode("utf-8")

#concat FLV location
flvURL = 'http://vimeo.com/moogaloop/play/clip:' + clipID + '/' + request_signature + '/' + request_signature_expires + '/?q=sd'

xbmc.Player().play(flvURL)

Hopefully it should solve your issue
Image
_____________________________

Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV
Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only)

Image
Reply
#3
Great. Your solution indeed fixes this issue. Now, on to the GUI Smile

I appreciate the help
Reply
#4
I will be watching this thread. Vimeo is the new youtube.
ﻪﻥﻋﺸﻷﻜﻈﭚ
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC.Player() not reading concatenated string.. very confusing0