I have not intress to developing a full Filmon uk addon for xbmc4xbox but i think one or more user want a solution to acess one or more
Filmon.uk Tv streams on your own little addon :
this have the dependencies from scriptmodule.requests(python 2.7)
why :
the code is cleaner, i can a session request (get or post ) easy do ,and i want not to imports more as i want then requests can handle json intern.
ok here is :
Code: Select all
import requests,re,os,xbmc,xbmcgui
from urlparse import urlparse
url=None
header = {"Referer": url,"X-Requested-With": "XMLHttpRequest","User-Agent": "Mozilla/5.0","Accept":"application/json, text/javascript, */*; q=0.01",'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'}
swfUrl = "http://www.filmon.com/tv/modules/FilmOnTV/files/flashapp/filmon/FilmonPlayer.swf"
infoUrl='http://www.filmon.com/ajax/getChannelInfo'
s = requests.Session()
url='http://www.filmon.com/tv/bbc-one'
name=url.split('tv/')[1]
def filmonparse(url):
pageUrl=url
html=s.get(url).content
channel_id = re.findall("/channels/(\d+)/extra_big_logo.png", html,re.S)[0]
quality='low'
data={'channel_id':channel_id,'quality':quality}
entry = s.post(infoUrl, data, headers=header).json()[0]
rtmp = entry.get("serverURL")
playpath = entry.get("streamName")
parsed = urlparse(rtmp)
if parsed.query:
app = "{0}?{1}".format(parsed.path[1:], parsed.query)
else:
app = parsed.path[1:]
streamurl='%s playpath=%s app=%s swfUrl=%s pageurl=%s live=true' % (rtmp,playpath,app,swfUrl,pageUrl)
li = xbmcgui.ListItem(name)
xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(streamurl,li)
filmonparse(url)
go with ftp to your xbox Q/video/plugins and create a Folder with the name of your wanted channel.
On this channel create a File default.py with the code what i have posted on it.
Change the url on the default.py to the tv streamurl what you want.
Create a 250*250 channel Picture (jpg) name this default.tbn and put this to the created directory.
When you then go to video plugins on your xbmc4xbox on the xbox self you can see your lttle addon ,click it and watch your stream.
Regards Jan