JTV change to pay Service
This mean you can only watch the streams without interupt when you pay money
So i have no interess to finish This Post
What is AVGN AVGN is a Channel on Jtv what holding different streams.
So it's a example to create your own JTV channel addons without the dependencies from jtv-archive addon.
We access the channels over the twitchtv api and the streams over the mobile (iphone ) api (HLS)
with the last nightly BuzZ have on my request add the HLS CODE to the smaller ffmpeg codecs so that the streaming from HLS streams can work on standart 64 MB RAM xboxes to .
So i think the
Build : https://www.dropbox.com/sh/8mcip8xsfe1z ... -32683.zip is the best for it on 64MB RAM XBOX's
Thanks again BuZZ
First a little code examples from me :
so we want to stream as example arconai_323
the webadress is : http://www.justin.tv/arconai_323
so to access the streaming content we write a little python code:
Code: Select all
import urllib2,sys
if sys.version_info >= (2, 7):
import json
else:
import simplejson as json
channel='arconai_323'
url='http://api.twitch.tv/api/channels/%s/access_token' % channel
stream = json.loads(urllib2.urlopen(url).read())
token= stream['token']
sig= stream['sig']
m3u8url='http://usher.twitch.tv/api/channel/hls/%s.m3u8?token=%s&sig=%s' % (channel,token,sig)
# this is the m3u8 playable m3u8 Playlist url you can this url paste to vlc and you can watch the stream
print m3u8url
What will this do :
import urllib2,sys importiert the module urllib2 and sys from python
if sys.version_info >= (2, 7): when python version is = or > as python 2.7 import the json module from python
import json
else: when not = or > as python 2.7 import the scriptmodule.simplejson as json
import simplejson as json
we want this to holding the script compatible to the different python version as example python 2.4 on the stable xbmc4xbox build and python 2.7 on the xbmc4xbox 3.5 beta build (python 2.7)
channe='arconai_323" create a variable channel what holding the channel what you want on this example
arconai_323
stream = json.loads(urllib2.urlopen(url).read()) we create a new variable stream what open and read the twitchtv api url with the channel what we want to access over the urllib2 module and load this with the json module json
token= stream['token'] we create a variable token what parse the stream url with json and access the token
sig= stream['sig'] we create a variable sig what parse the stream variable with json and access the sig
m3u8url='http://usher.twitch.tv/api/channel/hls/ ... =%s&sig=%s' % (channel,token,sig)
the url what we want is on a clean write 'http://usher.twitch.tv/api/channel/hls/ ... en='result from the token variable'&sig='result from the sig Variable'
But we want a unversal solution so we access format Strings with the comand %s on the position on the url what we want and given add last to it % ((channel,token,sig) so that format understand on what for a position and what for a string we want on this url
print m3u8url do ouput the result from the variable m3u8 on the screen
so we want to test the script on xbmc we add to the script one import xbmc and the access to the streaming url over xbmc
Code: Select all
import urllib2,sys,xbmc
if sys.version_info >= (2, 7):
import json
else:
import simplejson as json
channel='arconai_323'
url='http://api.twitch.tv/api/channels/%s/access_token' % channel
stream = json.loads(urllib2.urlopen(url).read())
token= stream['token']
sig= stream['sig']
m3u8url='http://usher.twitch.tv/api/channel/hls/%s.m3u8?token=%s&sig=%s' % (channel,token,sig)
# this is the m3u8 playable m3u8 Playlist url you can this url paste to vlc and you can watch the stream
print m3u8url
xbmc.Player().play(m3u8url)
You can this easy install over the addon4xboxinstaller / get ASddons/xbmc4xbox addon / Scriptmodules Addons (libarys)/simplejson
when you this will test on xbmc4xbox go with ftp xbmc plugins /video and create a new folder test and put the script on this as default.py
When you than go back to your xbmc4xbox on the xbox self you see on video plugins a new folder test selected click on it and your watch your stream.
more a little Later