How to play video from source like 'src=blob:http://....'
#1
Hi,

I am developing a video addon and scraped the URL (http://www.espncricinfo.com/ci/content/v...66439.html) and found the video URL as below -

<video preload="none" class="vjs-tech" data-setup="{ &quot;language&quot;: &quot;en&quot; }" id="vjs_video_3_html5_api" autoplay="" src="blob:http://www.espncricinfo.com/da8f20c1-b810-493d-ae89-427cc7af2d5e"></video>

The video source is "blob:http://www.espncricinfo.com/da8f20c1-b810-493d-ae89-427cc7af2d5e". Any pointer on how to play this type of video will be really helpful.

Thanks in advance.
Reply
#2
This is just a guess but it sounds like a Javascript blob object. This has some pointers on downloading the file using python. Maybe you can work with this to get to the url.

http://stackoverflow.com/questions/39517...ith-python
I'd assume you would somehow have to play the stream instead of a url if you don't want to download it
Reply
#3
(2016-11-16, 19:03)Protocol-X Wrote: This is just a guess but it sounds like a Javascript blob object. This has some pointers on downloading the file using python. Maybe you can work with this to get to the url.

http://stackoverflow.com/questions/39517...ith-python
I'd assume you would somehow have to play the stream instead of a url if you don't want to download it


Thanks for your response. Let me explore this, will update.


Sent from my iPhone
Reply
#4
hi
did you found a solution?
can you help me too?
this is the link :
src="blob:http://reshet.tv/627ba646-5f02-49ac-ab84-f41ab124ebe0
how can i use it in my kodi app.
all the links it the site are like that.
thanks for all your help.
Reply
#5
I was able to play links from reshet.tv using ruuk's youtube-dl addon.

Might be easier to go that route.
Reply
#6
hi.
did you build an addon for reshet?
if so can you please share it?
thanks.
Reply
#7
I didn't make an addon for reshet.tv.

I checked to see if reddit posts with links to reshet.tv are playable using youtube-dl.
And they are.

Since youtube-dl can resolve reshet.tv links, there is no need for you to parse the "blob" src.
just parse for those links and send it to youtube-dl.
Reply
#8
hi
i tried that but it didnt work here is the code:

import os
import xbmc

def playIt():
import YDStreamExtractor
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

url = "http://reshet.tv/3fa42c53-bca7-47b6-8a6d-00e148a18aa6" #a youtube ID will work as well and of course you could pass the url of another site
vid = YDStreamExtractor.getVideoInfo(url,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

try:
playIt()

except Exception, e:
playIt()
exit(1)

and this is the error:
ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.AttributeError'>
Error Contents: 'NoneType' object has no attribute 'streamURL'
Traceback (most recent call last):
File "C:\Users\SuperAlpha\AppData\Roaming\Kodi\addons\plugin.video.Kids.Channel.EBS.Israel\addon.py", line 15, in <module>
playIt()
File "C:\Users\SuperAlpha\AppData\Roaming\Kodi\addons\plugin.video.Kids.Channel.EBS.Israel\addon.py", line 10, in playIt
stream_url = vid.streamURL() #This is what Kodi (XBMC) will play
AttributeError: 'NoneType' object has no attribute 'streamURL'
-->End of Python script error report<--

thanks for your help.
Reply
#9
link should be like this:
http://reshet.tv/item/entertainment/the-...er-199171/

not this:
http://reshet.tv/3fa42c53-bca7-47b6-8a6d-00e148a18aa6
(leads to 404 on my browser)
Reply
#10
hi
just changed that to :
import os
import xbmc

def playIt():
import YDStreamExtractor
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

url = "http://reshet.tv/item/entertainment/the-voice/season-04/episodes/s4-e26-199242/" #a youtube ID will work as well and of course you could pass the url of another site
vid = YDStreamExtractor.getVideoInfo(url,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

try:
playIt()

except Exception, e:
playIt()
exit(1)

but same error:
ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.AttributeError'>
Error Contents: 'NoneType' object has no attribute 'streamURL'
Traceback (most recent call last):
File "C:\Users\SuperAlpha\AppData\Roaming\Kodi\addons\plugin.video.Kids.Channel.EBS.Israel\addon.py", line 15, in <module>
playIt()
File "C:\Users\SuperAlpha\AppData\Roaming\Kodi\addons\plugin.video.Kids.Channel.EBS.Israel\addon.py", line 10, in playIt
stream_url = vid.streamURL() #This is what Kodi (XBMC) will play
AttributeError: 'NoneType' object has no attribute 'streamURL'
-->End of Python script error report<--
18:11:29.908 T:12124 ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.Kids.Channel.EBS.Israel/
18:11:29.914 T:12124 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.Kids.Channel.EBS.Israel/) failed

thanks for your help,.
Reply
#11
I am terribly sorry sorry ebs111, I gave you the wrong advice.

The code example that you used for works with other video link but not those from reshet.tv (I do not know why)

I will have to refer you parts of my own addon that calls youtube-dl differently

You need to have this file as part of your addon. I place this on resources/lib.
This file is part of ruuk's youtube-dl addon and modified to fit my use.

and call it like so (playYTDLVideo)

pardon the mess.
Reply
#12
hi
thank you so much for your help i finally got it working.
but now when i try to get the names from the site i get ""title":"\u05e0\u05d1\u05e1\u05d5""
how do i convert it and display it in my menus?
Reply
#13
those are unicode characters. I don't have a good grasp on that subject.
i just put .encode('utf-8') on every string that I get from a json object before assigning it to my variables like so:
Code:
title = entry['data']['title'].encode('utf-8')
I also run it through a function that strips out the html encoding for good measure.

usually, kodi can display them fine.

Changing the font to something like "Arial based" instead of "Skin default" helps too.
it is found in the setting where you pick the skin. (interface setting in kodi 17)
Reply
#14
hi.
thanks for your help.Blush
this is the code i am using:

r = requests.get('http://reshet.tv/general/programs/')
match = re.compile('"post_name":"(.+?)","ID"Sad.+?),"title":"(.+?)","link":"(.+?)","target":null,"images":{"app_feed":"(.+?)"').findall(r.content)
for name,id,title,link,image in match:
addDir3(name,link.replace('\\/', '/'),3,image.replace('\\/', '/'),"","",)

def addDir3(name,url,mode,iconimage,fanart,description):
u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)+"&iconimage="+urllib.quote_plus(iconimage)+"&fanart="+urllib.quote_plus(fanart)+"&description="+urllib.quote_plus(description)
ok=True
liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
liz.setInfo( type="Video", infoLabels={ "Title": name, "Plot": description } )
liz.setProperty( "Fanart_Image", fanart )
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
return ok

but i want to get the title name instead of the post name.
but the title name is like that "\u05e0\u05d1\u05e1\u05d5""

the sorce code for the web page is here:
view-source:http://reshet.tv/general/programs/
how do i do that??
thanks again,
Reply
#15
Quote:but i want to get the title name instead of the post name.
but the title name is like that "\u05e0\u05d1\u05e1\u05d5""
use
Code:
title=title.decode('unicode-escape')

also, that entire bracketed line in view-source:http://reshet.tv/general/programs/
{"PageMeta":{"time":1490110288,"parent_uri":"http:\/\/reshet.tv\/wp-content\/themes\/reshet_tv","hp":"http:\/\/reshet.......
looks like json.
try decoding it as a json object via json.loads().
Reply

Logout Mark Read Team Forum Stats Members Help
How to play video from source like 'src=blob:http://....'0