Kodi Community Forum

Full Version: [Dev] ustream
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Having trouble with this dev addon

manage to scrape the site thumbs and it works so,so
default.py at http://pastebin.com/j4vfshYs



One bug is that the stream starts again when you click on stop
so ill keep on searching for solution.


Feel free to add here for advice and code snippets.

some bugs:
( there are 2 backup streams not yet written)
( the top 9 channels dont load )
( asian font )


.
Looks like def VIDEOLINKS only expects the url parameter. You need to tell it to expect (url,name) then tell it what to do with name inside the function
thanks for the info Bstrdsmkr.

rev.3 dev
default.py http://pastebin.com/zzsT2uAL
addon.xml http://pastebin.com/xKpkvZgX


i have # url1 streams for now because most of the streams that plays in url2


what is the best way to do(if else)? sure its after loading the amf but how?

still get log errors when playing:
Contents: global name 'param' is not defined
WARNING: No application or playpath in URL!



some bugs:
( some live channels dont work,yet)
( the top 9 channels dont load )
( asian font )
I had played around with this some a while back and never got back to it Confused

I set up github here -> https://github.com/divingmule/plugin.video.ustream

It's basically the same as what you have already started. Feel free to fork, send pull request, do with what you want.
Well ,Divingmule didnt see that coming ...8.9.10 lights out> K.O


that script is so much betterNod,adding more links and a icon or 2 will do that addon only good.

did take a look at out how your script handles the amf and look at the log for those
streams that wont play

streams that dont play looks like this:

rtmp://flash00.ustream.tv/ustreamVideo/0000000 playpath=streams/live

but i tested it and most of the streams play if done:

rtmp://flash00.ustream.tv app=ustreamVideo/0000000 playpath=streams/live_1

checking out how to change it,ill be back....
Hi rogerzees, I updated github, added a category scraper and page-nation. Haven't tried messing with the playback issues yet Confused
Hello Divingmule.

What difference a day makes...adding the next page a big improvment.

Both the big company chls and the small user chls play fine,if the other ch is #
those small channels that dont play has the handle fmsUrl in the amf and big chls has cdnurl***rtmp in amf

Code:
if fmsUrl>2

match = re.compile('.*(rtmp://.+?)\x00.*').findall(amf_data)
rtmp = match[0]
playpath = ' playpath='+re.compile('.*streamName\W\W\W(.+?)[/]*\x00.*').findall(amf_data)[0]
swf = ' swfUrl='+getSwf()
pageUrl = ' pageUrl='+data['results'][0]['url']
url = rtmp + playpath + swf + pageUrl + ' swfVfy=1 live=true'

else

smal[0]) = re.compile('fmsUrl\W\W\S(.+?)\x00', re.DOTALL).findall(amf_data)
smal[0]) =re.sub('.tv/','.tv app=',small[0]) + ' playpath=streams/live_1'
smal[0] = smal[0] + swf + pageUrl + ' swfVfy=1 live=true'

maybe?? if else
I have found that we can decode the amf data with pyamf - http://www.pyamf.org/index.html

It may take me a bit to get this sorted, but it's looking good.

It seems some channels only offer a m3u8 url :S
great,divingmule thats good news.

Name the channels that is so,i will take a look
you can use ffplay to play those m3m8 urls using a .bat


i manage to to play those small user channels by doing this i changed some of your code.
using # at the higher rtmp= (twittv,creative..) you can play via the lower rtmp= user channels

Code:
amf_data = make_request(amf_url)
match = re.compile('.*(rtmp://.+?)\x00.*').findall(amf_data)
stre = re.compile('.*streamName\W\W\W(.+?)[/]*\x00.*').findall(amf_data)
#rtmp = match[0] + stre[0]
match1 = re.compile('fmsUrl\W\W\S(.+?)\x00.*').findall(amf_data)
rtmp = match1[0] + '/streams/live_1'
url = rtmp + ' swfurl=http://www.ustream.tv/flash/viewer.swf pageUrl=http://www.ustream.tv live=true'        
item = xbmcgui.ListItem(path=url)
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)

i notice there are a lot of channels that dont start,because the info from json the user/name is not right
by viewing the error log and compare it with html page source.

error log: NOTICE: URL: GTBecker
NOTICE: Name: Bowcam
html:
<a href="/user/GTBecker" class="username">
<a href="/channel/bowcam" class="shadowbox">

htop://www.ustream.tv/channel/bowcam

error log: NOTICE: URL: creativetechs
NOTICE: Name: creativeLIVE
html:
<a href="/user/creativetechs" class="username">
<a href="/creativelive" class="shadowbox">

htop://www.ustream.tv/creativelive

error log: NOTICE: URL: mococableoffice
NOTICE: Name: BoldHappenings
html:
<a href="/user/mococableoffice" class="username">
<a href="/channel/boldhappenings" class="shadowbox">

htop://www.ustream.tv/channel/boldhappenings

the bad info came from json?,can the right channel info be taken from html instead?

cidname = re.compile('<a href="/(.+?)" class="shadowbox">


-
I updated github with a rough first attempt at using PyAMF. You'll need to download and extract the "pyamf" directory to the add-on's directory.
http://pypi.python.org/packages/source/P...6.1.tar.gz

It may be a few days before I can get back to this, let me know how it works out for you.
First attempt and a home run,Nicely done Divingmule Nod

man,this dev addon is playing allmost every thing!
(couple UnicodeDecode Errors)


Testing this more over the weekend


(to other non devs who wants test copy the pyamf folder to ~plugin.video.ustream folder)
hello divingmule,did notice that you updated today

i see you are working on search and icons (not showing)


couple channels from /user/tenkoRcJPg dont play
before the update there was a UnicodeDecodeError,now error opening []

+nasa,twit and other channells plays fine!
+settings


ustream is bit of a mess with radio channels all over the place...
the site should have a category for radio channels only
but how would it look with 200 video streams against 1000 radio.
Hey rogerzees, I'm working on using the api for listing the channels instead of scraping the website. Not sure if I'll be able to do the categories the same but it should eliminate the errors. They also provide the m3u8 url's without having to get the amf, will be nice when it's fully supported.
I think HLS (m3u8) is semi-supported now, at least with non-secure URLs.

http://forum.xbmc.org/showthread.php?tid=128609
(2012-06-07, 18:53)divingmule Wrote: [ -> ]I updated github with a rough first attempt at using PyAMF. You'll need to download and extract the "pyamf" directory to the add-on's directory.
http://pypi.python.org/packages/source/P...6.1.tar.gz

It may be a few days before I can get back to this, let me know how it works out for you.


DM, I extracted the content of PyAMF-0.6.1.tar.gz onto the ustream addon dir, but I still cannot play CBC +2 (under News, 3rd page down).
CBC +2 url starts with rtmp://flash65.ustream.tv...... (as mentioned above by rogerzees). Is there a setting or anything else I need to do to make it work? THX
Pages: 1 2 3