2017-09-10, 05:26
I was trying the new version 0.9.9 on some music videos and they wouldn't play example strm file: , throwing python exception (play using youtube library). I did some investigation, first thing I see is in addon.py, when it is called to play music video I don't think it handles unicode correctly, as I think it has to be decoded from utf-8, like this:
probably needed other places.
So that got me further along, but still didn't play. So I looked at play.py and see there were some tabs in the file where I think it should have been converted to 4 space:
which I did, and now at least the music videos I tested do play.
scott s.
.
Code:
plugin://plugin.video.youtubelibrary/?mode=playmusicvideo&id=Fi4wxroGVkc&artist=트로트뽕짝아줌마&song=밤열차(최은희)&album=Unknown&year=2017&filename=듣기좋은 트로트 가요-밤열차(최은희)
Code:
## PLAY MUSICVIDEO
elif mode[0] == "playmusicvideo":
dev.log('Mode is PlayMusicVideo')
id = vars.args['id'][0] #Grab the vid id which we should be playing
artist = vars.args['artist'][0].decode('utf-8') #Grab the artist
song = vars.args['song'][0].decode('utf-8') #Grab the song
filename = vars.args['filename'][0].decode('utf-8') #Grab the filename
play.playMusicVid(id, filename, artist, song) #Play the video
probably needed other places.
So that got me further along, but still didn't play. So I looked at play.py and see there were some tabs in the file where I think it should have been converted to 4 space:
Code:
#YDStreamExtractor.disableDASHVideo(True) #Kodi (XBMC) only plays the video for DASH streams, so you don't want these normally. Of course these are the only 1080p streams on YouTube
try:
#url = id #a youtube ID will work as well and of course you could pass the url of another site
vid = YDStreamExtractor.getVideoInfo(id,quality=1) #quality is 0=SD, 1=720p, 2=1080p and is a maximum
stream_url = vid.streamURL() #This is what Kodi (XBMC) will play
except:
dev.log('Failed to get a valid stream_url!')
return False #Failed to grab a video title
if 'title' not in meta:
meta['title'] = vid.title #Store the youtube title in the meta
#xbmc.Player().play(v.getbest().url) #Play this video
liz = xbmcgui.ListItem(meta['title'].encode('utf-8'), iconImage=poster, thumbnailImage=poster)
liz.setInfo( type="Video", infoLabels=meta)
liz.setPath(stream_url)
return xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
which I did, and now at least the music videos I tested do play.
scott s.
.