Subversion Repositories sd-xbmc

Compare Revisions

Ignore whitespace Rev 214 → Rev 268

/trunk/xbmc-addons/src/addons.xml
19,6 → 19,21
</extension>
</addon>
 
<addon id="plugin.bino3D.openelec" name="Bino 3D player"
version="0.0.1" provider-name="SYSTEMS DESIGN - Plesken">
<requires>
<import addon="xbmc.python" version="1.0" />
</requires>
<extension point="xbmc.python.pluginsource" library="default.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
<summary>Bino 3D player</summary>
<description>Bino 3D player integrated with openelec</description>
<platform>OpenELEC - Linux</platform>
</extension>
</addon>
 
<addon id="plugin.multimedia.players" name="External Multimedia Players"
version="1.0.6" provider-name="SYSTEMS DESIGN - Plesken">
<requires>
36,8 → 51,8
 
<addon id="plugin.video.polishtv.live"
name="Telewizja Polska (kanały, VOD, filmy, seriale)"
version="0.0.4"
provider-name="Plesken">
version="0.1.0"
provider-name="SD teams">
<requires>
<import addon="xbmc.python" version="1.0"/>
<import addon="script.module.elementtree" version="1.2.7" />
56,6 → 71,20
</extension>
</addon>
 
<addon id="script.module.skingui"
name="skingui"
version="0.0.1"
provider-name="code.google.com/sd-xbmc">
<requires>
<import addon="xbmc.python" version="1.0"/>
</requires>
<extension point="xbmc.python.module"
library="lib" />
<extension point="xbmc.addon.metadata">
<platform>all</platform>
</extension>
</addon>
 
<addon id="repository.systems-design.eu"
name="systems-design.eu Add-ons"
version="1.0.0"
/trunk/xbmc-addons/src/plugin.video.polishtv.live/hosts/tvp.py
111,6 → 111,10
if not epgItems:
epgItems = elems.findall("directory_video/video")
 
pub = elems.findall("publication_status")
if pub[0].attrib['publication_status_id']=='4':
d = xbmcgui.Dialog()
d.ok('Brak video', pub[0].attrib['name'].encode('utf-8'))
 
#print "test[6]: " + str(len(epgItems))
 
185,8 → 189,8
videoUrl = videoNode.attrib['temp_sdt_url']
 
if videoUrl != '':
if self.watched(videoUrl):
prop['overlay'] = 7
#if self.watched(videoUrl):
# prop['overlay'] = 7
 
self.addVideoLink(prop,videoUrl,iconUrl,listsize)
#print "test[4]: " + prop['title'] + ", " + iconUrl + ", " + videoUrl
265,16 → 269,16
if findVideo:
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
def watched(self, videoUrl):
videoFile = videoUrl.split('/')[-1]
shortVideoFile = videoFile[videoFile.find('.')+1:]
sql_data = "select count(*) from files WHERE (strFilename ='%s' OR strFilename ='%s') AND playCount > 0" % (videoFile,shortVideoFile)
xml_data = xbmc.executehttpapi( "QueryVideoDatabase(%s)" % urllib.quote_plus( sql_data ), )
wasWatched = re.findall( "<field>(.*?)</field>", xml_data)[0]
if wasWatched == "1":
return True
else :
return False
#def watched(self, videoUrl):
# videoFile = videoUrl.split('/')[-1]
# shortVideoFile = videoFile[videoFile.find('.')+1:]
# sql_data = "select count(*) from files WHERE (strFilename ='%s' OR strFilename ='%s') AND playCount > 0" % (videoFile,shortVideoFile)
# xml_data = xbmc.executehttpapi( "QueryVideoDatabase(%s)" % urllib.quote_plus( sql_data ), )
# wasWatched = re.findall( "<field>(.*?)</field>", xml_data)[0]
# if wasWatched == "1":
# return True
# else :
# return False
 
 
 
/trunk/xbmc-addons/src/plugin.video.polishtv.live/hosts/bestplayer.py
New file
0,0 → 1,204
# -*- coding: utf-8 -*-
import cookielib, os, string, StringIO
import os, time, base64, logging, calendar
import urllib, urllib2, re, sys, math
import xbmcgui, xbmc, xbmcaddon, xbmcplugin
 
scriptID = 'plugin.video.polishtv.live'
scriptname = "Polish Live TV"
ptv = xbmcaddon.Addon(scriptID)
 
BASE_RESOURCE_PATH = os.path.join( ptv.getAddonInfo('path'), "../resources" )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ) )
 
import pLog, settings, Parser, urlparser, pCommon
 
log = pLog.pLog()
 
mainUrl = 'http://bestplayer.tv/'
mainUrl2 = 'http://bestplayer.tv/filmy/'
mainUrl3 = 'http://bestplayer.tv/top100/'
logoUrl = mainUrl + 'images/logo.png'
first = '-strona-1.html'
 
HOST = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110621 Mandriva Linux/1.9.2.18-0.1mdv2010.2 (2010.2) Firefox/3.6.18'
 
MENU_TAB = {1: "Lektor",
2: "Napisy",
3: "Premiery",
4: "TOP",
5: "Data wydania",
6: "Szukaj" }
 
class BestPlayer:
def __init__(self):
log.info('Loading BestPlayer')
self.settings = settings.TVSettings()
self.parser = Parser.Parser()
self.up = urlparser.urlparser()
self.cm = pCommon.common()
 
def listsMainMenu(self, table):
for num, val in table.items():
self.addDir('bestplayer', 'main-menu', val, '', '', '', logoUrl, True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
def listsCategoriesMenu2(self):
link = self.cm.requestData(mainUrl2)
match = re.compile('<a href="(.+?)z-lektorem.html" title="Filmy(.+?)"><span class="float-left">(.+?)</span><span class="float-right"></span></a></li>').findall(link)
if len(match) > 0:
for i in range(len(match)):
self.addDir('bestplayer', 'submenu', '', match[i][2], '', mainUrl + match[i][0] + 'z-lektorem-strona-1.html', logoUrl, True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
def listsCategoriesMenu3(self):
link = self.cm.requestData(mainUrl2)
match = re.compile('<a href="(.+?)z-napisami.html" title="Filmy.+?"><span class="float-left">(.+?)</span><span').findall(link)
if len(match) > 0:
for i in range(len(match)):
self.addDir('bestplayer', 'submenu', '', match[i][1], '', mainUrl + match[i][0] + 'z-napisami-strona-1.html', logoUrl, True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
def listsCategoriesMenu4(self):
link = self.cm.requestData(mainUrl2)
match = re.compile('<a href="(.+?)premiery.html" title="Filmy(.+?)"><span class="float-left">(.+?)</span><span class="float-right"></span></a></li>').findall(link)
if len(match) > 0:
for i in range(len(match)):
self.addDir('bestplayer', 'submenu', '', match[i][2], '', mainUrl + match[i][0] + 'premiery-strona-1.html', logoUrl, True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
def listsCategoriesMenu5(self):
link = self.cm.requestData(mainUrl2)
match = re.compile('<a href="filmy/rok(.+?).html" title="(.+?)"><span class="float-left">(.+?)</span><span class="float-right"></span></a></li>').findall(link)
if len(match) > 0:
for i in range(len(match)):
self.addDir('bestplayer', 'submenu', '', match[i][1], '', mainUrl + 'filmy/rok' + match[i][0] + '-strona-1.html', logoUrl, True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
def getFilmTable(self,url):
link = self.cm.requestData(url)
tabURL = link.replace('</div>', '').replace('<div class="fr" style="width:475px; margin-right:10px; margin-top:10px">', '').replace('&amp;', '').replace('quot;', '').replace('&amp;quot;', '')
match = re.compile('<a href="(.+?)" title=""><img src="(.+?)" width.+?/></a>\n.+?<div style.+?star.png" />\n.+?<div>Opini:.+?\n.+?\n.+?\n.+?<h2><a href=".+?">(.+?)</a></h2>\n.+?Kategorie:.+?</a></p>\n.+?\n.+?<div class="p5 film-dsc" >(.+?)\n.+?').findall(tabURL)
if len(match) > 0:
for i in range(len(match)):
self.addDir('bestplayer', 'playSelectedMovie', '', match[i][2], match[i][3], match[i][0], mainUrl + match[i][1], True, False)
match2 = re.compile('<li class="round "><a href="(.+?)" class="next"></a></li>').findall(link)
if len(match2) > 0:
nexturl = match2[0]
self.addDir('bestplayer', 'submenu', '', 'Następna strona', '', mainUrl + nexturl, '', True, False)
xbmcplugin.setContent(int(sys.argv[1]),'movies')
xbmc.executebuiltin("Container.SetViewMode(503)")
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
def getFilmTable2(self,url):
link = self.cm.requestData(url)
tabURL = link.replace('</div>', '').replace('&amp;', '').replace('quot;', '').replace('&amp;quot;', '')
match = re.compile('<a class=".+?" href="(.+?)" title=""><img src="(.+?)" height=.+?/></a>\n.+?<div class="trigger.+?".+?star.png" />\n.+?<div class="trigger.+?".+?\n.+?<div class="trigger.+?".+?\n.+?\n.+?<div class="fr".+?\n.+?<h2><a href=".+?">(.+?)</a></h2>\n.+?Kategorie.+?\n.+?\n.+?<div class=".+?" class="p5 film-dsc".+?">(.+?)\n.+?<a class="trigger.+?"').findall(tabURL)
if len(match) > 0:
for i in range(len(match)):
self.addDir('bestplayer', 'playSelectedMovie', '', match[i][2], match[i][3], match[i][0], mainUrl + match[i][1], True, False)
xbmcplugin.setContent(int(sys.argv[1]),'movies')
xbmc.executebuiltin("Container.SetViewMode(503)")
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
def searchInputText(self):
text = None
k = xbmc.Keyboard()
k.doModal()
if (k.isConfirmed()):
text = k.getText()
return text
 
def searchTab(self):
text = self.searchInputText()
searchUrl = mainUrl
values = {'q': text}
headers = { 'User-Agent' : HOST }
data = urllib.urlencode(values)
req = urllib2.Request(searchUrl, data, headers)
response = urllib2.urlopen(req)
link = response.read()
response.close()
tabURL = link.replace('</div>', '').replace('&amp;', '').replace('quot;', '').replace('&amp;quot;', '')
match = re.compile('<div class="movie-cover fl">\n.+?<a href="(.+?)" title=""><img src="(.+?)" width="150" height="200" alt="okladka" /></a>\n.+?<div.+?png" />\n.+?<div>O.+?\n.+?\n.+?<div.+?px">\n.+?<h2><a.+?>(.+?)</a></h2>\n.+?Kat.+?</a></p>\n.+?\n.+?<div class="p5 film-dsc" >(.+?)\n.+?<div style="margin-top: 10px;">').findall(tabURL)
if len(match) > 0:
for i in range(len(match)):
self.addDir('bestplayer', 'playSelectedMovie', '', match[i][2], match[i][3], match[i][0], mainUrl + match[i][1], True, False)
match2 = re.compile('<li class="round "><a href="(.+?)" class="next"></a></li>').findall(link)
if len(match2) > 0:
nexturl = match2[0]
self.addDir('bestplayer', 'submenu', '', 'Następna strona', '', mainUrl + nexturl, '', True, False)
xbmcplugin.setContent(int(sys.argv[1]),'movies')
xbmc.executebuiltin("Container.SetViewMode(503)")
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
def getVideoID(self,url):
videoID = ''
link = self.cm.requestData(url)
match = re.compile('<iframe src="(.+?)" style="border:0px; width: 740px; height: 475px;" scrolling="no"></iframe>').findall(link)
if len(match) > 0:
videoID = match[0]
return videoID
 
def addDir(self, service, name, category, title, plot, link, iconimage, folder = True, isPlayable = True):
u=sys.argv[0] + "?service=" + service + "&name=" + name + "&category=" + category + "&title=" + title + "&page=" + urllib.quote_plus(link)
if name == 'main-menu':
title = category
if iconimage == '':
iconimage = "DefaultVideo.png"
liz=xbmcgui.ListItem(title, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
if isPlayable:
liz.setProperty("IsPlayable", "true")
liz.setInfo( type="Video", infoLabels={ "Title": title, "Plot": plot } )
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=folder)
def LOAD_AND_PLAY_VIDEO(self, videoUrl):
ok=True
if videoUrl == '':
d = xbmcgui.Dialog()
d.ok('Nie znaleziono streamingu.', 'Może to chwilowa awaria.', 'Spróbuj ponownie za jakiś czas')
return False
try:
xbmcPlayer = xbmc.Player()
xbmcPlayer.play(videoUrl)
except:
d = xbmcgui.Dialog()
d.ok('Błąd przy przetwarzaniu, lub wyczerpany limit czasowy oglądania.', 'Zarejestruj się i opłać abonament.', 'Aby oglądać za darmo spróbuj ponownie za jakiś czas')
return ok
 
def handleService(self):
params = self.parser.getParams()
name = self.parser.getParam(params, "name")
title = self.parser.getParam(params, "title")
category = self.parser.getParam(params, "category")
page = self.parser.getParam(params, "page")
if name == None:
self.listsMainMenu(MENU_TAB)
elif name == 'main-menu' and category == 'Lektor':
self.listsCategoriesMenu2()
elif name == 'main-menu' and category == 'Napisy':
self.listsCategoriesMenu3()
elif name == 'main-menu' and category == "Premiery":
self.listsCategoriesMenu4()
elif name == 'main-menu' and category == "TOP":
self.getFilmTable2(mainUrl3)
elif name == 'main-menu' and category == 'Data wydania':
self.listsCategoriesMenu5()
elif name == 'main-menu' and category == 'Szukaj':
self.searchTab()
elif name == 'submenu':
self.getFilmTable(page)
 
if name == 'playSelectedMovie':
nUrl = mainUrl + page
linkVideo = ''
ID = ''
ID = self.getVideoID(nUrl)
if ID != '':
linkVideo = self.up.getVideoLink(ID)
if linkVideo != False:
self.LOAD_AND_PLAY_VIDEO(linkVideo)
else:
d = xbmcgui.Dialog()
d.ok('Brak linku', 'Maxvideo - tymczasowo wyczerpałeś limit ilości uruchamianych seriali.', 'Zapraszamy za godzinę.')
/trunk/xbmc-addons/src/plugin.video.polishtv.live/hosts/wlacztv.py
13,14 → 13,19
BASE_RESOURCE_PATH = os.path.join( ptv.getAddonInfo('path'), "../resources" )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ) )
 
import pLog, settings, Parser
import pLog, settings, Parser, pCommon
 
log = pLog.pLog()
cj = cookielib.LWPCookieJar()
 
HOST = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110621 Mandriva Linux/1.9.2.18-0.1mdv2010.2 (2010.2) Firefox/3.6.18'
mainUrl = "http://www.wlacz.tv"
mainChannels = mainUrl + "/kanaly"
#mainUrl = "http://www.wlacz.tv"
#mainChannels = mainUrl + "/kanaly"
mainUrl = 'http://www.wlacz.tv'
playerUrl = mainUrl + '/api/setPlayer'
channelsUrl = mainUrl + '/api/online_channels'
loginUrl = mainUrl + '/api/login'
isLoggedUrl = mainUrl + '/api/is_logged'
 
COOKIEFILE = ptv.getAddonInfo('path') + os.path.sep + "cookies" + os.path.sep + "wlacztv.cookie"
 
31,6 → 36,7
dstpath = ptv.getSetting('default_dstpath')
timedelta_h = ptv.getSetting('default_timedelta_hours')
timedelta_m = ptv.getSetting('default_timedelta_minutes')
strmdir = ptv.getSetting('wlacztv_strm')
 
VIDEO_MENU = [ t(55611).encode("utf-8"), t(55613).encode("utf-8"), t(55614).encode("utf-8") ]
 
39,90 → 45,71
def __init__(self):
log.info("Loading wlacz.tv")
self.parser = Parser.Parser()
def requestData(self, url):
if os.path.isfile(COOKIEFILE):
cj.load(COOKIEFILE)
req = urllib2.Request(url)
req.add_header('User-Agent', HOST)
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
response = opener.open(req)
data = response.read()
response.close()
return data
self.common = pCommon.common()
 
def dec(self, string):
json_ustr = json.dumps(string, ensure_ascii=False)
return json_ustr.encode('utf-8')
def checkDirCookie(self):
if not os.path.isdir(ptv.getAddonInfo('path') + os.path.sep + "cookies"):
os.mkdir(ptv.getAddonInfo('path') + os.path.sep + "cookies")
def isLogged(self):
content_json = self.common.getURLFromFileCookieData(isLoggedUrl, COOKIEFILE)
result_json = json.loads(content_json)
res = self.dec(result_json['logged_in']).replace("\"", "")
if res == 'true':
return True
else:
return False
def requestLoginData(self):
if login == "" or password == "":
d = xbmcgui.Dialog()
d.ok(t(55604).encode("utf-8"), t(55605).encode("utf-8"), t(55606).encode("utf-8"))
exit()
else:
url = mainUrl + "/user/login"
headers = { 'User-Agent' : HOST }
post = { 'email': login, 'password': password }
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
data = urllib.urlencode(post)
req = urllib2.Request(url, data, headers)
response = opener.open(req)
link = response.read()
response.close()
post = { 'username': login, 'password': password }
self.checkDirCookie()
cj.save(COOKIEFILE)
self.common.saveURLToFileCookieData(loginUrl, COOKIEFILE, post)
def channelsList(self, url):
req = self.requestData(url)
match_icon = re.compile("<a href=\"/kanal/(.+?)\"><img src=\"(.+?)\" alt=\"\" /></a>").findall(req)
match = re.compile("<h5><i class=\"icon-picture\"></i> <a href=\"(.+?)\">(.+?)</a></a></h5>").findall(req)
if len(match) > 0 and len(match_icon) > 0:
chanTab = []
valTab = []
for i in range(len(match)):
chanTab.append(match[i][0])
chanTab.append(match[i][1])
chanTab.append(match_icon[i][1])
valTab.append(chanTab)
chanTab = []
valTab.sort(key = lambda x: x[1])
#log.info('valTab: ' + str(valTab))
for i in range(len(valTab)):
self.addChannel('wlacztv', valTab[i][1], mainUrl + valTab[i][0], mainUrl + valTab[i][2])
#for i in range(len(match)):
# self.addChannel('wlacztv', match[i][1], mainUrl + match[i][0], mainUrl + match_icon[i][1])
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_TITLE)
xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
xbmcplugin.endOfDirectory(int(sys.argv[1]))
raw_json = self.common.getURLFromFileCookieData(url, COOKIEFILE)
result_json = json.loads(raw_json)
for o in result_json:
title = self.dec(o['name']).replace("\"", "")
#url = self.dec(o['uri']).replace("\"", "")
icon = self.dec(o['image']).replace("\"", "")
key = self.dec(o['key']).replace("\"", "")
self.addChannel('wlacztv', title, key, icon)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_TITLE)
xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
xbmcplugin.endOfDirectory(int(sys.argv[1]))
def getChannelRTMPLink(self, url, title, icon):
req = self.requestData(url)
match = re.compile("<param name=\"flashvars\" value=\"src=(.+?)&poster=(.+?)&streamType=live&autoPlay=true\"></param>").findall(req)
if len(match) > 0:
raw_rtmp_tab = match[0][0].split("?")
split_rtmp_tab = raw_rtmp_tab[0].split("/")
rtmp_link = raw_rtmp_tab[0]
if split_rtmp_tab[len(split_rtmp_tab) - 1].endswith(".stream"):
app = "live?" + raw_rtmp_tab[1]
tcurl = "rtmp://" + split_rtmp_tab[len(split_rtmp_tab) - 3] + ":1935/live?" + raw_rtmp_tab[1]
playpath = split_rtmp_tab[len(split_rtmp_tab) - 1]
else:
app = "wlacztv?" + raw_rtmp_tab[1]
tcurl = "rtmp://" + split_rtmp_tab[len(split_rtmp_tab) - 3] + ":1935/live?" + raw_rtmp_tab[1]
playpath = split_rtmp_tab[len(split_rtmp_tab) - 1] + "?" + raw_rtmp_tab[1]
rtmp = {'title': title, 'icon': icon, 'rtmp': rtmp_link, 'app': app, 'pageurl': url, 'tcurl': tcurl, 'playpath': playpath}
#log.info("rtmp link: " + str(rtmp))
return rtmp
def getChannelRTMPLink(self, key, title, icon):
post = { 'key': key }
#log.info('rtmp: ' + str(self.common.postURLFromFileCookieData(playerUrl, COOKIEFILE, post)))
rtmp_json = json.loads(self.common.postURLFromFileCookieData(playerUrl, COOKIEFILE, post))
#tcurl = rtmp_json['rtmp_server'] + '/wlacztv/' + rtmp_json['playPath']
rtmp = rtmp_json['rtmp_server'] + "/" + rtmp_json['app'] + '?wlacztv_session_token=' + rtmp_json['token']
return { 'title': title, 'icon': icon, 'key': key, 'rtmp': rtmp, 'playpath': rtmp_json['playPath'] }
def addChannel(self, service, title, url, icon):
u = "%s?service=%s&title=%s&url=%s&icon=%s" % (sys.argv[0], service, title, urllib.quote_plus(url), urllib.quote_plus(icon))
def addChannel(self, service, title, key, icon):
u = "%s?service=%s&title=%s&key=%s&icon=%s" % (sys.argv[0], service, title, key, urllib.quote_plus(icon))
liz = xbmcgui.ListItem(title, iconImage="DefaultFolder.png", thumbnailImage = icon)
liz.setInfo(type="Video", infoLabels={ "Title": title, })
xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = liz, isFolder = False)
if strmdir != 'None':
if not os.path.isdir(strmdir):
os.mkdir(strmdir)
FILE = open(os.path.join(strmdir, "%s.strm" % ''.join(c for c in title if c in '-_.() abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')),"w+")
FILE.write("plugin://plugin.video.polishtv.live/?service=%s&key=%s&icon=%s&title=%s" % (service, key, urllib.quote_plus(icon), urllib.quote_plus(title)))
 
 
class Player:
def __init__(self):
173,31 → 160,28
if os.path.isdir(dstpath):
if rectime > 0:
dwnl = RTMPDownloader()
params = { "url": jsonUrl['rtmp'], "download_path": dstpath, "title": jsonUrl['title'], "live": "true", "tcUrl": jsonUrl['tcurl'], "pageUrl": jsonUrl['pageurl'], "playpath": jsonUrl['playpath'], "app": jsonUrl['app'], "duration": int(rectime) }
params = { "url": jsonUrl['rtmp'], "playpath": jsonUrl['playpath'], "download_path": dstpath, "title": jsonUrl['title'], "duration": int(rectime) }
dwnl.download(rtmppath, params)
else:
msg = xbmcgui.Dialog()
msg.ok(t(55618).encode("utf-8"), t(55619).encode("utf-8"))
elif item == 2:
rec = Record()
rec.Init(jsonUrl['pageurl'], jsonUrl['title'], mainUrl + "/user/login")
rec.Init(playerUrl, jsonUrl['key'], jsonUrl['title'], loginUrl)
exit()
if record == 'false' or item == 1:
try:
liz = xbmcgui.ListItem(jsonUrl['title'], iconImage = jsonUrl['icon'], thumbnailImage = jsonUrl['icon'])
liz.setInfo( type="Video", infoLabels={ "Title": jsonUrl['title'], } )
videoUrl = jsonUrl['rtmp']
videoUrl += " app=" + jsonUrl['app']
videoUrl += " pageUrl=" + jsonUrl['pageurl']
videoUrl += " tcUrl=" + jsonUrl['tcurl']
videoUrl = jsonUrl['rtmp']
videoUrl += " playpath=" + jsonUrl['playpath']
videoUrl += " live=true"
#log.info('rtmp raw: ' + videoUrl)
log.info('rtmp raw: ' + videoUrl)
xbmcPlayer = xbmc.Player()
xbmcPlayer.play(videoUrl, liz)
except:
log.info('tutaj')
#log.info('tutaj')
d = xbmcgui.Dialog()
d.ok(t(55609).encode("utf-8"), t(55610).encode("utf-8"))
 
214,7 → 198,7
nt = time.mktime(td.timetuple())
today = datetime.datetime.fromtimestamp(nt)
file = os.path.join(str(params['download_path']), str(params['title']).replace(" ", "_") + "-" + str(today).replace(" ", "_").replace(":", ".") + ".flv")
os.system(str(app) + " -B " + str(params['duration']) + " -r " + str(params['url']) + " -a " + str(params['app']) + " -p " + str(params['pageUrl']) + " -t " + str(params['tcUrl']) + " -y " + str(params['playpath']) + " -v live -o " + file)
os.system(str(app) + " -B " + str(params['duration']) + " -r " + str(params['url']) + " -y " + str(params['playpath']) + " -v live -o " + file)
 
 
class Record:
229,7 → 213,7
text = k.getText()
return text
def Init(self, url, title, login_url):
def Init(self, url, key, title, login_url):
nowTime = datetime.datetime.now() + datetime.timedelta(hours = int(timedelta_h), minutes = int(timedelta_m))
nowDate = str(nowTime.strftime("%Y-%m-%d"))
nTime = str(nowTime.strftime("%H:%M"))
239,7 → 223,7
e_End = self.input(nTime, t(55623).encode("utf-8"))
setTime = self.SetTime(s_Date, s_Start, e_Date, e_End)
nameRec = title.replace(" ", "_") + "_" + s_Date + "." + s_Start.replace(":", ".")
opts = { 'service': 'wlacztv', 'login_url': login_url, 'date': s_Date, 'start': s_Start, 'rectime': str(setTime[1]), 'name': nameRec, 'url': url, 'login': login, 'password': password, 'dst_path': dstpath, 'rtmp_path': rtmppath, 'hours_delta': timedelta_h, 'minutes_delta': timedelta_m }
opts = { 'service': 'wlacztv', 'key': key, 'login_url': login_url, 'date': s_Date, 'start': s_Start, 'rectime': str(setTime[1]), 'name': nameRec, 'url': url, 'login': login, 'password': password, 'dst_path': dstpath, 'rtmp_path': rtmppath, 'hours_delta': timedelta_h, 'minutes_delta': timedelta_m }
self.saveFile(opts)
xbmc.executebuiltin('AlarmClock(' + str(nameRec) + ', "RunScript(' + str(self.cmddir) + str(os.sep) + 'record.py, ' + str(self.recdir) + str(os.sep) + str(nameRec) + '.json)", ' + str(setTime[0]) + '))')
299,15 → 283,20
def handleService(self):
params = self.parser.getParams()
title = str(self.parser.getParam(params, "title"))
url = str(self.parser.getParam(params, "url"))
key = str(self.parser.getParam(params, "key"))
icon = str(self.parser.getParam(params, "icon"))
#log.info('title: ' + title)
log.info('title: ' + title)
#log.info('url: ' + url)
self.channel.checkDirCookie()
try:
if not self.channel.isLogged():
self.channel.requestLoginData()
except:
self.channel.requestLoginData()
if title == 'None':
self.channel.requestLoginData()
self.channel.channelsList(mainChannels)
elif title != '' and url != '':
self.player.LOAD_AND_PLAY_VIDEO(self.channel.getChannelRTMPLink(url, title, icon))
self.channel.channelsList(channelsUrl)
elif title != '' and key != '':
self.player.LOAD_AND_PLAY_VIDEO(self.channel.getChannelRTMPLink(key, title, icon))
 
def handleRecords(self):
d = xbmcgui.Dialog()
/trunk/xbmc-addons/src/plugin.video.polishtv.live/hosts/maxvideo.py
New file
0,0 → 1,161
# -*- coding: utf-8 -*-
import os, string, cookielib, StringIO
import time, base64, logging, calendar
import urllib, urllib2, re, sys, math
import xbmcgui, xbmc, xbmcaddon, xbmcplugin
 
scriptID = 'plugin.video.polishtv.live'
scriptname = "Polish Live TV"
ptv = xbmcaddon.Addon(scriptID)
 
BASE_RESOURCE_PATH = os.path.join( ptv.getAddonInfo('path'), "../resources" )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ) )
 
import pLog, settings, Parser, urlparser, pCommon
 
log = pLog.pLog()
 
mainUrl = 'http://maxvideo.pl'
logoUrl = mainUrl + '/refresh140820/style/img/maxVideo.png'
 
 
HOST = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
 
 
class Maxvideo:
def __init__(self):
log.info('Loading Maxvideo')
self.settings = settings.TVSettings()
self.parser = Parser.Parser()
self.up = urlparser.urlparser()
self.cm = pCommon.common()
 
def getMenuTable(self):
nTab = []
data = self.cm.requestData(mainUrl)
match = re.compile('<li.+?>\n.+?<a href="(.+?)">(.+?)</a>\n.+?</li>').findall(data)
if len(match) > 0:
nTab = match
return nTab
def getMovieTab(self, url):
log.info("reading: " + url)
strTab = []
valTab = []
data = self.cm.requestData(url)
match = re.compile("""<h1 class="indexVideoTitle">.+?</a>(.+?)<br/>""").findall(data)
if len(match) > 0:
titles = match
else:
titles = []
#file: "http://s171.maxvideo.pl/flv/unlimited/3d/3d19a5515e4e6e77e37d6a443b83a76e.flv",
match = re.compile("""file: "(.+?)",\n.+?,\n.+?,\n.+?,\n.+?,\n.+?'(.+?)'""").findall(data)
if len(match) > 0:
for i in range(len(match)):
value = match[i]
strTab.append(titles[i])
strTab.append(value[0])
strTab.append(value[1])
valTab.append(strTab)
strTab = []
#pokaz wiecej
match = re.compile("""<span class="navFont">\&raquo;</span>""").findall(data)
if len(match) > 0:
strTab.append('pokaz wiecej')
strTab.append('')
strTab.append('')
valTab.append(strTab)
#[title, url, image]
return valTab
 
def listsAddLinkMovie(self, table, category, page):
if page == 'None':
page = 1
else:
page = int(page)
page = str (page + 1)
for i in range(len(table)):
value = table[i]
title = value[0]
url = value[1]
iconimage = value[2]
if title == 'pokaz wiecej':
url = category + page
self.add('maxvideo', title, category, page, title, iconimage, url, True, False)
else:
self.add('maxvideo', 'playSelectedMovie', 'movie', 'None', title, iconimage, url, False, True)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
def listsAddDirMenu(self, table):
for i in range(len(table)):
if not 'kategoria' in table[i][0]:
category = table[i][0] + '/kategoria/'
else:
category = table[i][0] + '/'
print category
n = table[i][1]
self.add('maxvideo', n, category, 'None', 'None', logoUrl, category, True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
 
def add(self, service, name, category, page, title, iconimage, url, folder = True, isPlayable = True):
u=sys.argv[0] + "?service=" + service + "&name=" + urllib.quote_plus(name) + "&category=" + urllib.quote_plus(category) + "&page=" + urllib.quote_plus(page) + "&url=" + urllib.quote_plus(url)
#"&title=" + urllib.quote_plus(title) +
#log.info(str(u))
if name == 'playSelectedMovie':
name = title
if iconimage == '':
iconimage = "DefaultVideo.png"
liz=xbmcgui.ListItem(name.decode('utf-8'), iconImage=iconimage, thumbnailImage=iconimage)
if isPlayable:
liz.setProperty("IsPlayable", "true")
liz.setInfo('video', {'title' : title.decode('utf-8')} )
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=folder)
 
def LOAD_AND_PLAY_VIDEO(self, videoUrl):
ok=True
if videoUrl == '':
d = xbmcgui.Dialog()
d.ok('Nie znaleziono streamingu.', 'Może to chwilowa awaria.', 'Spróbuj ponownie za jakiś czas')
try:
log.info ("playing: " + videoUrl)
xbmcPlayer = xbmc.Player()
xbmcPlayer.play(videoUrl)
except:
d = xbmcgui.Dialog()
d.ok('Blad przy przetwarzaniu.', 'Najprawdopodobniej video zostalo usuniete')
return ok
 
def handleService(self):
params = self.parser.getParams()
name = str(self.parser.getParam(params, "name"))
title = str(self.parser.getParam(params, "title"))
category = str(self.parser.getParam(params, "category"))
page = str(self.parser.getParam(params, "page"))
url = str(self.parser.getParam(params, "url"))
name = name.replace("+", " ")
category = category.replace("+", " ")
page = page.replace("+", " ")
log.info('nazwa: ' + name)
log.info('cat: ' + category)
log.info('page: ' + page)
log.info('url: ' + url)
if name == 'None':
self.listsAddDirMenu(self.getMenuTable())
else:
if name <> 'playSelectedMovie':
self.listsAddLinkMovie(self.getMovieTab(url), category, page)
else:
#odtwarzaj video
self.LOAD_AND_PLAY_VIDEO(url)
 
/trunk/xbmc-addons/src/plugin.video.polishtv.live/hosts/weebtv.py
33,6 → 33,7
dstpath = ptv.getSetting('default_dstpath')
timedelta_h = ptv.getSetting('default_timedelta_hours')
timedelta_m = ptv.getSetting('default_timedelta_minutes')
strmdir = ptv.getSetting('weebtv_strm')
 
VIDEO_MENU = [ "Nagrywanie", "Odtwarzanie", "Zaprogramowanie nagrania" ]
 
134,19 → 135,22
msg = xbmcgui.Dialog()
msg.ok("Błąd API", "Brak kanałów pobranych z API.")
 
def addChannel(self, service, action, cid, title, img, desc, tags, user, name):
label = title
liz = xbmcgui.ListItem(label, iconImage = "DefaultFolder.png", thumbnailImage = img)
liz.setProperty("IsPlayable", "false")
liz.setInfo(type = "Video", infoLabels={ "Title": title,
def addChannel(self, service, action, cid, title, img, desc, tags, user, name):
label = title
liz = xbmcgui.ListItem(label, iconImage = "DefaultFolder.png", thumbnailImage = img)
liz.setProperty("IsPlayable", "false")
liz.setInfo(type = "Video", infoLabels={ "Title": title,
"Plot": desc,
"Studio": "WEEB.TV",
"Tagline": tags,
"Aired": user } )
u = '%s?service=%s&action=%d&cid=%d&title=%s' % (sys.argv[0], str(service), int(action), int(cid), urllib.quote_plus(title))
xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = liz, isFolder = False)
FILE = open(os.path.join(ptv.getAddonInfo('path'), "strm", "%s.strm" % ''.join(c for c in title if c in '-_.() abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')),"w+")
FILE.write("plugin://plugin.video.polishtv.live/?service=%s&action=%d&cid=%s&title=%s" % (service, int(action), cid, urllib.quote_plus(title)))
u = '%s?service=%s&action=%d&cid=%d&title=%s' % (sys.argv[0], str(service), int(action), int(cid), urllib.quote_plus(title))
xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = u, listitem = liz, isFolder = False)
if strmdir != 'None':
if not os.path.isdir(strmdir):
os.mkdir(strmdir)
FILE = open(os.path.join(strmdir, "%s.strm" % ''.join(c for c in title if c in '-_.() abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')),"w+")
FILE.write("plugin://plugin.video.polishtv.live/?service=%s&action=%d&cid=%s&title=%s" % (service, int(action), cid, urllib.quote_plus(title)))
 
 
class Player(xbmc.Player):
/trunk/xbmc-addons/src/plugin.video.polishtv.live/hosts/ekinotv.py
10,24 → 10,32
 
BASE_RESOURCE_PATH = os.path.join( ptv.getAddonInfo('path'), "../resources" )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ) )
COOKIEFILE = ptv.getAddonInfo('path') + os.path.sep + "cookies" + os.path.sep + "ekinotv.cookie"
 
import pLog, settings, Parser, urlparser
 
log = pLog.pLog()
cj = cookielib.LWPCookieJar()
 
mainUrl = 'http://www.ekino.tv'
 
 
sortby = ptv.getSetting('ekinotv_sort')
sortorder = ptv.getSetting('ekinotv_sortorder')
username = ptv.getSetting('ekinotv_login')
password = ptv.getSetting('ekinotv_password')
 
EKINO_MENU_TABLE = { 1: "Filmy [wg. gatunków]",
2: "Filmy [lektor]",
3: "Filmy [napisy]",
4: "Filmy [najpopularniejsze]",
5: "Seriale",
6: "Wyszukaj" }
 
EKINO_MENU_TABLE = {
1: "Filmy [wg. gatunków]",
2: "Filmy [lektor]",
3: "Filmy [napisy]",
4: "Filmy [najpopularniejsze]",
5: "Seriale",
6: "Wyszukaj"
}
 
 
HOST = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110621 Mandriva Linux/1.9.2.18-0.1mdv2010.2 (2010.2) Firefox/3.6.18'
PAGE_MOVIES = 10
DUB_LINK = mainUrl + '/tag,lektor,1.html'
40,6 → 48,62
self.settings = settings.TVSettings()
self.parser = Parser.Parser()
self.up = urlparser.urlparser()
def postData(self, url, postval = {}):
headers = { 'User-Agent' : HOST }
data = urllib.urlencode(postval)
req = urllib2.Request(url, data, headers)
response = urllib2.urlopen(req)
data = response.read()
response.close()
return data
def requestData(self, url):
if os.path.isfile(COOKIEFILE):
cj.load(COOKIEFILE)
req = urllib2.Request(url)
req.add_header('User-Agent', HOST)
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
response = opener.open(req)
data = response.read()
response.close()
return data
def checkDirCookie(self):
if not os.path.isdir(ptv.getAddonInfo('path') + os.path.sep + "cookies"):
os.mkdir(ptv.getAddonInfo('path') + os.path.sep + "cookies")
def requestLoginData(self):
if username=='' or password=='':
xbmc.executebuiltin("XBMC.Notification(Niezalogowany, uzywam Player z limitami,2000)")
else:
url = mainUrl + "/logowanie.html?login=1"
headers = { 'User-Agent' : HOST }
post = { 'username': username, 'password': password }
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
data = urllib.urlencode(post)
req = urllib2.Request(url, data, headers)
response = opener.open(req)
link = response.read()
response.close()
self.checkDirCookie()
cj.save(COOKIEFILE)
if self.isLoggedIn(link):
xbmc.executebuiltin("XBMC.Notification(" + username + ", Zostales poprawnie zalogowany,2000)")
else:
xbmc.executebuiltin("XBMC.Notification(Blad logowania, uzywam Player z limitami,2000)")
 
 
def isLoggedIn(self, data):
#<div class="span-7 medium lh200 last">Zalogowany jako: <b>
if 'Zalogowany jako:' in data:
return True
else:
return False
def setTable(self):
return EKINO_MENU_TABLE
64,11 → 128,7
valTab = []
strTab = []
url = mainUrl + '/kategorie.html'
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link = response.read()
response.close()
link = self.requestData(url)
tabURL = link.replace(' ', '').split('\n')
for line in tabURL:
r = re.compile('<ahref="(' + mainUrl + '/filmy,.+?)"title=".+?"><divclass="columnspan-4">(.+?)<span>\((.+?)\)</span></div></a>').findall(line)
76,7 → 136,6
strTab.append(r[0][0])
strTab.append(r[0][1])
strTab.append(r[0][2])
#log.info(str(strTab))
valTab.append(strTab)
if '/span' in line:
strTab = []
114,7 → 173,6
 
def getMovieTab(self, url):
log.info(url)
if sortby=='ocena':
sSort = 'p'
if sortby=='popularnosc':
133,31 → 191,20
strTab = []
valTab = []
values = {'sSort': sSort, 'sHow': sHow}
 
headers = { 'User-Agent' : 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' }
data = urllib.urlencode(values)
req = urllib2.Request(url, data, headers)
response = urllib2.urlopen(req)
link = response.read()
response.close()
link = self.postData(url, values)
tabURL = link.replace('\t', '').split('\n')
for line in tabURL:
#log.info(line)
expr1 = re.match(r'^.+?<img class="link_img" src="(.+?)" title="(.+?)" .+ />', line, re.M|re.I)
expr2 = re.match(r'^<p>(.+?)<a href="(.+?)" title=".+?">.+?</a></p>$', line, re.M|re.I)
expr3 = re.match(r'^<li style="display:inline;" class="next"><a href="(.+?)" title=".+?" >.+?</a></li>$', line, re.M|re.I)
if expr1:
#log.info(expr1.group(1))
#log.info(expr1.group(2))
title = expr1.group(2)
strTab.append(expr1.group(1))
strTab.append(expr1.group(2))
if expr2:
plot = expr2.group(1)
metadata = [title,plot]
#log.info(expr2.group(1))
#log.info(expr2.group(2))
#strTab.append(expr2.group(1))
strTab.append(metadata)
strTab.append(expr2.group(2))
valTab.append(strTab)
166,8 → 213,7
if '<div class="column span-15 movie_container">' in line:
strTab = []
if nextPage:
valTab.append(['','nastepna','',nextPage])
#log.info(str(valTab))
valTab.append(['','nastepna','',nextPage])
return valTab
 
 
191,23 → 237,15
valTab = []
strTab = []
url = mainUrl + '/seriale-online.html'
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link = response.read()
response.close()
#tabURL = link.replace('\n', '').split('<')
link = self.requestData(url)
tabURL = link.replace('\t', '').replace('<sup class=\'red\'>new!</sup>', '').split('</li>')
for line in tabURL:
#log.info(line)
expr = re.match(r'.+?<a class=".+?" href="(.+?)" title=".+?">(.+?)</a>', line, re.M|re.I)
if expr:
#log.info(expr.group(2))
strTab.append(expr.group(2).replace('&nbsp;', ''))
strTab.append(expr.group(1))
valTab.append(strTab)
strTab = []
#log.info(valTab)
expr = re.match(r'.+?<a class=".+?" href="(.+?)" title=".+?">(.+?)</a>', line, re.M|re.I)
if expr:
strTab.append(expr.group(2).replace('&nbsp;', ''))
strTab.append(expr.group(1))
valTab.append(strTab)
strTab = []
return valTab
 
217,7 → 255,6
value = table[i]
name = value[0]
nameTab.append(name.replace('&nbsp;', ''))
#nameTab.sort()
return nameTab
227,100 → 264,79
 
def getSerialInfoTab(self, url):
strTab = []
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link = response.read()
response.close()
#tabURL = link.replace('\n', '').split('<')
link = self.requestData(url)
tabURL = link.replace('\t', '').split('</div>')
for line in tabURL:
#log.info(line.replace('\n', ''))
expr1 = re.match(r'.+?<div class="content" style="text-align:center">.+?<img src="(.+?)" alt="(.+?)"/>', line.replace('\n', ''), re.M|re.I)
expr2 = re.match(r'.+?<div class="content">.+?<center><img src=".+?" title=".+?" style="max-width:450px;"></center>.+?<p class="truncate200">(.+?)</p>', line.replace('\n', ''), re.M|re.I)
if expr1:
strTab.append(expr1.group(2))
strTab.append(expr1.group(1))
if expr2:
strTab.append(expr2.group(1).replace('\t' , '').replace(' ', ''))
#log.info(strTab)
expr1 = re.match(r'.+?<div class="content" style="text-align:center">.+?<img src="(.+?)" alt="(.+?)"/>', line.replace('\n', ''), re.M|re.I)
expr2 = re.match(r'.+?<div class="content">.+?<center><img src=".+?" title=".+?" style="max-width:450px;"></center>.+?<p class="truncate200">(.+?)</p>', line.replace('\n', ''), re.M|re.I)
if expr1:
strTab.append(expr1.group(2))
strTab.append(expr1.group(1))
if expr2:
strTab.append(expr2.group(1).replace('\t' , '').replace(' ', ''))
return strTab
 
 
def getSerialsFullTab(self):
strTab = []
valTab = []
table = self.getSerialsTab()
for i in range(len(table)):
value = table[i]
#log.info(str(value))
url = value[1]
title = value[0]
img = ''
plot = ''
tab = self.getSerialInfoTab(url)
for i in range(len(tab)):
value = tab[i]
img = value[0]
plot = value[1]
strTab.append(img)
strTab.append(title)
strTab.append(plot)
strTab.append(url)
valTab.append(strTab)
#log.info(str(strTab))
strTab = []
#log.info(str(valTab))
return valTab
strTab = []
valTab = []
table = self.getSerialsTab()
for i in range(len(table)):
value = table[i]
url = value[1]
title = value[0]
img = ''
plot = ''
tab = self.getSerialInfoTab(url)
for i in range(len(tab)):
value = tab[i]
img = value[0]
plot = value[1]
strTab.append(img)
strTab.append(title)
strTab.append(plot)
strTab.append(url)
valTab.append(strTab)
strTab = []
return valTab
 
 
def getSeasonsTab(self, url):
strTab = []
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link = response.read()
response.close()
#tabURL = link.replace('\n', '').split('<')
link = self.requestData(url)
tabURL = link.replace('\t', '').split('\n')
for line in tabURL:
#log.info(line)
expr = re.match(r'.+?<div class="header"><h2>(.+?)</h2></div>$', line, re.M|re.I)
if expr:
if 'Sezon ' in expr.group(1):
strTab.append(expr.group(1))
#log.info(strTab)
return strTab
 
 
def getPartsTab(self, url):
valTab = []
strTab = []
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link = response.read()
response.close()
link = self.requestData(url)
tabURL = link.replace('\t', '').split('\n')
for line in tabURL:
expr = re.match(r'.+?<li>(.+)<a href="(.+?)" title="(.+?) Odcinek\:.+?">(.+?)</a></li>$', line, re.M|re.I)
expr_bak = re.match(r'.+?<li>(.+)<a href="(.+?)" title="(.+?) Odcinek\:.+?">(.+?)</a>.+?</li>$', line, re.M|re.I)
if expr:
if expr.group(2).startswith('http://'):
strTab.append(expr.group(1).replace('\t' , '').replace(' ', ''))
strTab.append(expr.group(2))
strTab.append(expr.group(3))
strTab.append(expr.group(4))
valTab.append(strTab)
strTab = []
elif expr_bak:
if expr_bak.group(2).startswith('http://'):
strTab.append(expr_bak.group(1).replace('\t' , '').replace(' ', ''))
strTab.append(expr_bak.group(2))
strTab.append(expr_bak.group(3))
strTab.append(expr_bak.group(4))
valTab.append(strTab)
strTab = []
expr = re.match(r'.+?<li>(.+)<a href="(.+?)" title="(.+?) Odcinek\:.+?">(.+?)</a></li>$', line, re.M|re.I)
expr_bak = re.match(r'.+?<li>(.+)<a href="(.+?)" title="(.+?) Odcinek\:.+?">(.+?)</a>.+?</li>$', line, re.M|re.I)
if expr:
if expr.group(2).startswith('http://'):
strTab.append(expr.group(1).replace('\t' , '').replace(' ', ''))
strTab.append(expr.group(2))
strTab.append(expr.group(3))
strTab.append(expr.group(4))
valTab.append(strTab)
strTab = []
elif expr_bak:
if expr_bak.group(2).startswith('http://'):
strTab.append(expr_bak.group(1).replace('\t' , '').replace(' ', ''))
strTab.append(expr_bak.group(2))
strTab.append(expr_bak.group(3))
strTab.append(expr_bak.group(4))
valTab.append(strTab)
strTab = []
return valTab
 
332,7 → 348,6
name = value[0]
if title == name:
url = value[1]
#log.info(url)
return url
347,22 → 362,19
season = value[2]
if s[1] in season:
titles.append(part + ' ' + name)
#log.info(titles)
return titles
def getPartURL(self, key, title):
url = ''
table = self.getPartsTab(self.getSerialURL(title))
for i in range(len(table)):
value = table[i]
name = value[3]
#log.info(name + ' < jest w > ' + key)
if name in key:
url = value[1]
break
#log.info('part: ' + url)
return url
url = ''
table = self.getPartsTab(self.getSerialURL(title))
for i in range(len(table)):
value = table[i]
name = value[3]
if name in key:
url = value[1]
break
return url
 
 
def getItemTitles(self, table):
385,24 → 397,29
 
def getMovieURLFalse(self, url):
fl = 'None'
req = urllib2.Request(url)
req.add_header('User-Agent', HOST)
response = urllib2.urlopen(req)
link = response.read()
response.close()
match = re.compile('<div class="placeholder" style=".+?" onclick="(.+?)"><img src="http://static.ekino.tv/static/img/player_kliknij.jpg" alt="player" /></div>').findall(link)
#log.info("false link: " + match[0])
link = self.requestData(url)
if self.isLoggedIn(link):
#showVideo('http://www.ekino.tv/gcp,115451,v.html', $('#7e40699b1694f9d5e248289731904d47'));
match = re.compile("showVideo\('(.+?)'").findall(link)
else:
match = re.compile('<div class="placeholder" style=".+?" onclick="(.+?)"><img src="http://static.ekino.tv/static/img/player_kliknij.jpg" alt="player" /></div>').findall(link)
if len(match) == 1:
fLink = match[0].split('\'')
fl = str(fLink[1])
if self.isLoggedIn(link):
fl = match[0]
else:
fLink = match[0].split('\'')
fl = str(fLink[1])
elif len(match) > 1:
valTab = []
strTab = []
for i in range(len(match)):
a = i + 1
fLink = match[i].split('\'')
strTab.append('Film ' + str(a))
strTab.append(fLink[1])
if self.isLoggedIn(link):
strTab.append(match[i])
else:
fLink = match[i].split('\'')
strTab.append(fLink[1])
valTab.append(strTab)
strTab = []
d = xbmcgui.Dialog()
414,29 → 431,27
d = xbmcgui.Dialog()
d.ok('Brak linku do filmu', 'Przepraszamy, ale w tej chwili nie możemy wyświetlić', 'Ci pełnej wersji tego filmu.')
fl = 'None'
print fl
return fl
 
 
def videoMovieLink(self, url):
nUrl = ''
link = self.getMovieURLFalse(url)
if link != 'None':
req = urllib2.Request(link)
req.add_header('User-Agent', HOST)
response = urllib2.urlopen(req)
link = response.read()
response.close()
log.info("iframe: " + link)
match = re.compile('<iframe src="(.+?)".+?width').findall(link)
if len(match) > 0:
#log.info("almost there: " + match[0])
nUrl = self.up.getVideoLink(match[0])
else:
d = xbmcgui.Dialog()
d.ok('Player Limit','Wyczerpany limit czasowy oglądania','Spróbuj ponownie za jakiś czas')
return nUrl
nUrl = ''
link = self.getMovieURLFalse(url)
if link != 'None':
data = self.requestData(link)
if "provider: 'lighttpd'" in data:
match = re.compile("clip: {\n.+?url: '(.+?)'").findall(data)
if len(match)==1:
nUrl = match[0]
else:
match = re.compile('<iframe src="(.+?)".+?width').findall(link)
if len(match) > 0:
nUrl = self.up.getVideoLink(match[0])
if nUrl == '':
d = xbmcgui.Dialog()
d.ok('Player Limit','Wyczerpany limit czasowy oglądania','Spróbuj ponownie za jakiś czas')
return nUrl
 
def searchInputText(self):
459,21 → 474,18
response = urllib2.urlopen(req)
link = response.read()
response.close()
#tabURL = link.replace('\t', '').split('\n')
tabURL = link.replace('\n', '').split('<p class="separator_h_5">')
for line in tabURL:
expr = re.match(r'^.+?<img class="link_img" src="(.+?)" title=".+?" alt=".+?" /></a>.+?</div>.+?<p class="h2"><a href=".+?" title=">.+?">(.+?)</a></p>.+?<p>(.+?)<a href="(.+?)" title=".+?">.+?</a></p>', line, re.M|re.I)
if expr:
title = expr.group(2)
plot = expr.group(3)
#log.info('1: ' + expr.group(2))
strTab.append(expr.group(1))
strTab.append(expr.group(2))
strTab.append([title,plot])
strTab.append(expr.group(4))
valTab.append(strTab)
strTab = []
#log.info(str(valTab))
return valTab
 
486,145 → 498,133
 
 
def listsAddLinkMovie(self, table):
#table.sort(key=lambda x: x[1])
#log.info(str(table))
for i in range(len(table)):
value = table[i]
title = value[1]
iconimage = value[0]
if title!='nastepna' and title!='poprzednia':
dict = self.videoMetadata(value[2][0],value[2][1])
self.add('ekinotv', 'playSelectedMovie', 'movie', 'None', title, iconimage, dict, True, False)
else:
expr1 = value[3].split(',')
category = expr1[1]
if category=='lektor' or category=='napisy':
expr2 = expr1[2].split('.')
else:
expr2 = expr1[3].split('.')
page = expr2[0]
#log.info(str(expr1))
#log.info(category)
#log.info(page)
self.add('ekinotv', title, category, page, 'None', 'None', self.videoMetadata(), True, False)
#zmien view na "Media Info 2"
xbmcplugin.setContent(int(sys.argv[1]),'movies')
xbmc.executebuiltin("Container.SetViewMode(503)")
xbmcplugin.endOfDirectory(int(sys.argv[1]))
for i in range(len(table)):
value = table[i]
title = value[1]
iconimage = value[0]
if title!='nastepna':
dict = self.videoMetadata(value[2][0],value[2][1])
self.add('ekinotv', 'playSelectedMovie', 'movie', 'None', title, iconimage, dict, True, False)
else:
expr1 = value[3].split(',')
category = expr1[1]
if category=='lektor' or category=='napisy':
expr2 = expr1[2].split('.')
else:
expr2 = expr1[3].split('.')
page = expr2[0]
self.add('ekinotv', title, category, page, 'None', 'None', self.videoMetadata(), True, False)
#zmien view na "Media Info 2"
xbmcplugin.setContent(int(sys.argv[1]),'movies')
xbmc.executebuiltin("Container.SetViewMode(503)")
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
 
def listsAddLinkSerial(self, table, category):
#log.info(str(table))
for i in range(len(table)):
title = table[i]
self.add('ekinotv', 'playSelectedMovie', 'serial', category, title, '', self.videoMetadata(), True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
for i in range(len(table)):
title = table[i]
self.add('ekinotv', 'playSelectedMovie', 'serial', category, title, '', self.videoMetadata(), True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
 
def listsAddDirMenu(self, table, name, category, page):
for i in range(len(table)):
if name == 'None':
self.add('ekinotv', table[i], 'None', 'None', 'None', 'None', self.videoMetadata(), True, False)
elif category == 'None' and name != 'None':
self.add('ekinotv', name, table[i], 'None', 'None', 'None', self.videoMetadata(), True, False)
elif name != 'None' and category != 'None' and page == 'None':
self.add('ekinotv', name, category, table[i], 'None', 'None', self.videoMetadata(), True, False)
elif name != 'None' and category != 'None' and page != 'None':
self.add('ekinotv', name, category, page, table[i], 'None', self.videoMetadata(), True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
for i in range(len(table)):
if name == 'None':
self.add('ekinotv', table[i], 'None', 'None', 'None', 'None', self.videoMetadata(), True, False)
elif category == 'None' and name != 'None':
self.add('ekinotv', name, table[i], 'None', 'None', 'None', self.videoMetadata(), True, False)
elif name != 'None' and category != 'None' and page == 'None':
self.add('ekinotv', name, category, table[i], 'None', 'None', self.videoMetadata(), True, False)
elif name != 'None' and category != 'None' and page != 'None':
self.add('ekinotv', name, category, page, table[i], 'None', self.videoMetadata(), True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
 
def add(self, service, name, category, page, title, iconimage, metadata, folder = True, isPlayable = True):
u=sys.argv[0] + "?service=" + service + "&name=" + urllib.quote_plus(name) + "&category=" + urllib.quote_plus(category) + "&page=" + urllib.quote_plus(page) + "&title=" + urllib.quote_plus(title)
#log.info(str(u))
if name == 'playSelectedMovie':
name = title
name = title
elif name != 'None' and category != 'None' and page == 'None':
name = category
name = category
elif name != 'None' and category != 'None' and page != 'None' and not self.isNumeric(page):
name = page
name = page
if iconimage == '':
iconimage = "DefaultVideo.png"
iconimage = "DefaultVideo.png"
liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
if isPlayable:
liz.setProperty("IsPlayable", "true")
liz.setProperty("IsPlayable", "true")
liz.setInfo('video', metadata )
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=folder)
 
def LOAD_AND_PLAY_VIDEO(self, videoUrl):
ok=True
if videoUrl == '':
# d = xbmcgui.Dialog()
# d.ok('Nie znaleziono streamingu.', 'Może to chwilowa awaria.', 'Spróbuj ponownie za jakiś czas')
return False
try:
xbmcPlayer = xbmc.Player()
title = ""
liz=xbmcgui.ListItem()
liz.setInfo( type="Video", infoLabels={ "Title": title } )
xbmcPlayer.play(videoUrl, liz)
except:
d = xbmcgui.Dialog()
d.ok('Błąd przy przetwarzaniu, lub wyczerpany limit czasowy oglądania.', 'Zarejestruj się i opłać abonament.', 'Aby oglądać za darmo spróbuj ponownie za jakiś czas')
return ok
ok=True
if videoUrl == '':
return False
try:
xbmcPlayer = xbmc.Player()
title = ""
liz=xbmcgui.ListItem()
liz.setInfo( type="Video", infoLabels={ "Title": title } )
xbmcPlayer.play(videoUrl, liz)
except:
d = xbmcgui.Dialog()
d.ok('Błąd przy przetwarzaniu, lub wyczerpany limit czasowy oglądania.', 'Zarejestruj się i opłać abonament.', 'Aby oglądać za darmo spróbuj ponownie za jakiś czas')
return ok
 
 
def handleService(self):
params = self.parser.getParams()
name = str(self.parser.getParam(params, "name"))
title = str(self.parser.getParam(params, "title"))
category = str(self.parser.getParam(params, "category"))
page = str(self.parser.getParam(params, "page"))
name = name.replace("+", " ")
title = title.replace("+", " ")
category = category.replace("+", " ")
page = page.replace("+", " ")
#log.info('nazwa: ' + name)
#log.info('cat: ' + category)
#log.info('page: ' + page)
#log.info('tytuł: ' + title)
params = self.parser.getParams()
name = str(self.parser.getParam(params, "name"))
title = str(self.parser.getParam(params, "title"))
category = str(self.parser.getParam(params, "category"))
page = str(self.parser.getParam(params, "page"))
name = name.replace("+", " ")
title = title.replace("+", " ")
category = category.replace("+", " ")
page = page.replace("+", " ")
if name == 'None':
self.listsAddDirMenu(self.getMenuTable(), 'None', 'None', 'None')
elif name == self.setTable()[1] and category == 'None':
self.listsAddDirMenu(self.getCategoryName(), name, 'None', 'None')
elif name == self.setTable()[1] and category != 'None' and page == 'None':
self.listsAddLinkMovie(self.getMovieTab(mainUrl + '/filmy,' + category + ',1,1.html'))
elif name == 'nastepna' and category != 'None' and self.isNumeric(page):
if category == 'lektor' or category=='napisy':
self.listsAddLinkMovie(self.getMovieTab(mainUrl + '/tag,' + category + ',' + page + '.html'))
else:
self.listsAddLinkMovie(self.getMovieTab(mainUrl + '/filmy,' + category + ',1,' + page + '.html'))
page = str(int(page) + 1)
#lektor
if name == self.setTable()[2]:
self.listsAddLinkMovie(self.getMovieTab(self.setDubLink()))
#napisy
if name == self.setTable()[3]:
self.listsAddLinkMovie(self.getMovieTab(self.setSubLink()))
#najpopularniejsze
if name == self.setTable()[4]:
self.listsAddLinkMovie(self.getMoviesPopTab())
#serial
if name == self.setTable()[5] and category == 'None':
self.listsAddDirMenu(self.getSerialNames(), name, 'None', 'None')
elif name == self.setTable()[5] and category != 'None' and page == 'None':
self.listsAddDirMenu(self.getSeasonsTab(self.getSerialURL(category)), name, category, page)
elif name == self.setTable()[5] and category != 'None' and page != 'None':
self.listsAddLinkSerial(self.getSeasonPartsTitle(page, category), category)
#szukaj
if name == self.setTable()[6]:
text = self.searchInputText()
if text != None:
self.listsAddLinkMovie(self.searchTab(text))
if name == 'None':
self.requestLoginData()
self.listsAddDirMenu(self.getMenuTable(), 'None', 'None', 'None')
elif name == self.setTable()[1] and category == 'None':
self.listsAddDirMenu(self.getCategoryName(), name, 'None', 'None')
elif name == self.setTable()[1] and category != 'None' and page == 'None':
self.listsAddLinkMovie(self.getMovieTab(mainUrl + '/filmy,' + category + ',1,1.html'))
elif name == 'nastepna' and category != 'None' and self.isNumeric(page):
if category == 'lektor' or category=='napisy':
self.listsAddLinkMovie(self.getMovieTab(mainUrl + '/tag,' + category + ',' + page + '.html'))
else:
self.listsAddLinkMovie(self.getMovieTab(mainUrl + '/filmy,' + category + ',1,' + page + '.html'))
page = str(int(page) + 1)
#lektor
if name == self.setTable()[2]:
self.listsAddLinkMovie(self.getMovieTab(self.setDubLink()))
#napisy
if name == self.setTable()[3]:
self.listsAddLinkMovie(self.getMovieTab(self.setSubLink()))
#najpopularniejsze
if name == self.setTable()[4]:
self.listsAddLinkMovie(self.getMoviesPopTab())
#serial
if name == self.setTable()[5] and category == 'None':
self.listsAddDirMenu(self.getSerialNames(), name, 'None', 'None')
elif name == self.setTable()[5] and category != 'None' and page == 'None':
self.listsAddDirMenu(self.getSeasonsTab(self.getSerialURL(category)), name, category, page)
elif name == self.setTable()[5] and category != 'None' and page != 'None':
self.listsAddLinkSerial(self.getSeasonPartsTitle(page, category), category)
#szukaj
if name == self.setTable()[6]:
text = self.searchInputText()
if text != None:
self.listsAddLinkMovie(self.searchTab(text))
if name == 'playSelectedMovie':
urlLink = ''
if title != 'None' and category == 'movie':
urlLink = self.getMovieURL(self.searchTab(title), title)
elif title != 'None' and category == 'serial' and page != 'None':
urlLink = self.getPartURL(title, page)
if urlLink.startswith('http://'):
log.info("url: " + urlLink)
self.LOAD_AND_PLAY_VIDEO(self.videoMovieLink(urlLink))
if name == 'playSelectedMovie':
urlLink = ''
if title != 'None' and category == 'movie':
urlLink = self.getMovieURL(self.searchTab(title), title)
elif title != 'None' and category == 'serial' and page != 'None':
urlLink = self.getPartURL(title, page)
if urlLink.startswith('http://'):
log.info("url: " + urlLink)
self.LOAD_AND_PLAY_VIDEO(self.videoMovieLink(urlLink))
/trunk/xbmc-addons/src/plugin.video.polishtv.live/hosts/tvpvod.py
6,7 → 6,9
 
 
log = pLog.pLog()
urlCategoryList = 'https://itvp.one-2-one.pl/api/mp4.php'
#urlCategoryList = 'https://itvp.one-2-one.pl/api/mp4.php'
urlCategoryList = 'http://www.api.v3.tvp.pl/shared/listing.php?dump=json&direct=true&count=100&parent_id=1785454'
 
urlRecommended = 'http://www.api.v3.tvp.pl/shared/listing.php?parent_id=%d&direct=false&count=%d&page=%d&filter=android_enabled=true&dump=json'
urlEpisodesList = 'http://www.api.v3.tvp.pl/shared/listing.php?parent_id=%d&direct=false&count=%d&page=%d&filter=android_enabled=true&dump=json&type=video&order=release_date_long,-1'
urlVideo = 'http://www.tvp.pl/pub/stat/videofileinfo?video_id=%d&mime_type=video/mp4'
14,6 → 16,7
 
USER_AGENT = 'Apache-HttpClient/UNAVAILABLE (java 1.4)'
VOD_ID = 6442748
 
PAGE_MOVIES = 15
 
HANDLE = int(sys.argv[1])
64,12 → 67,13
return result
 
except urllib2.HTTPError, e:
print "HTTP error " + e.code
print "HTTP error " + str(e.code)
except urllib2.URLError, e:
print "URL error " + e.reason
except:
print "Request to TVP API failed"
return []
def getVideoJson(self,id):
url = urlVideo % (id)
try:
90,17 → 94,16
 
def listCategories(self):
result = self.getCategoriesJson()
if "name" in result:
self.addDir(result["name"].encode('utf-8'),"list_category",result["id"],"")
if "collectionOfSubcategories" in result:
for subCategory in result["collectionOfSubcategories"]:
if "name" in subCategory:
self.addDir(subCategory["name"].encode('utf-8'),"list_category",subCategory["id"],"")
for i in range(len(result.get('items'))):
if result.get('items')[i].get('types')[1] == 'directory_series':
ID = result.get('items')[i].get('_id')
title = result.get('items')[i].get('title').title().encode('utf-8')
self.addDir(title,"list_category",ID,"")
 
self.addDir("Polecane","list_category",VOD_ID,"")
 
xbmcplugin.endOfDirectory(HANDLE)
 
 
def listsVOD(self):
result = self.getListJson(int(self.actionid))
items = result['items']
146,8 → 149,8
if not 'episode' in prop:
prop['episode'] = 0
 
if self.watched(url):
prop['overlay'] = 7
#if self.watched(url):
# prop['overlay'] = 7
liz=xbmcgui.ListItem(prop['title'], iconImage="DefaultFolder.png", thumbnailImage=iconimage)
liz.setProperty("IsPlayable", "true")
liz.setInfo( type="Video", infoLabels={
194,11 → 197,11
req.add_header('User-Agent', USER_AGENT)
response = urllib2.urlopen(req)
result = response.read()
result = simplejson.loads(result)
result = simplejson.loads(result)
return result
 
except urllib2.HTTPError, e:
print "HTTP error " + e.code
print "HTTP error " + str(e.code)
except urllib2.URLError, e:
print "URL error " + e.reason
except:
280,11 → 283,11
 
print sql_data
 
xml_data = xbmc.executehttpapi( "QueryVideoDatabase(%s)" % urllib.quote_plus( sql_data ), )
print xml_data
# xml_data = xbmc.executehttpapi( "QueryVideoDatabase(%s)" % urllib.quote_plus( sql_data ), )
# print xml_data
 
wasWatched = re.findall( "<field>(.*?)</field>", xml_data)[0]
if int(wasWatched) > 0:
return True
else :
return False
# wasWatched = re.findall( "<field>(.*?)</field>", xml_data)[0]
# if int(wasWatched) > 0:
# return True
# else :
# return False
/trunk/xbmc-addons/src/plugin.video.polishtv.live/hosts/stations.py
1,7 → 1,7
# -*- coding: utf-8 -*-
import string, sys
import os, time
import xbmcgui, xbmcplugin, xbmcaddon
import xbmcgui, xbmcplugin, xbmcaddon, xbmc
 
scriptID = 'plugin.video.polishtv.live'
scriptname = "Polish Live TV"
10,80 → 10,201
BASE_RESOURCE_PATH = os.path.join( ptv.getAddonInfo('path'), "../resources" )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ) )
 
import pLog
import pLog, Parser, pCommon
 
log = pLog.pLog()
 
CATEGORY_TAB = [
[0, "Ogólnotematyczne"],
[1, "Informacyjne"],
[2, "Sportowe"],
[3, "Muzyczne"],
[4, "Religijne"],
[5, "Lokalne"],
[6, "Zagraniczne"],
[7, "Polskie stacje radiowe"]
]
 
MENU_TAB = [ [ "ESKA TV", "rtmp://46.105.112.212:1935/live playpath=mpegts.stream swfUrl=http://www.eska.tv/thrdparty/flowplayer/flowplayer.rtmp-3.1.4.swf pageUrl=http://www.eska.tv/player live=true swfVfy=true" ],
[ "Rebel.tv", "rtmp://gdansk.popler.tv:80/publishlive?play=123452/rebeltv playpath=rebeltv swfUrl=http://www.popler.tv/player/flowplayer.cluster.swf pageUrl=http://www.megawypas.pl/readarticle.php?article_id=405 live=true swfVfy=true" ],
[ "4Fun TV", "rtmp://creyden.popler.tv:80/publishlive?play=123452/4funtv playpath=4funtv swfUrl=http://www.popler.tv/player/flowplayer.cluster.swf pageUrl=http://www.megawypas.pl/readarticle.php?article_id=55 live=true swfVfy=true" ],
[ "NEXT Music", "rtmp://vod.wowza.astrosa.pl/rtplive/:music_540p.stream" ],
[ "Deluxe Music", "rtmp://flash.cdn.deluxemusic.tv/deluxemusic.tv-live/web_850.stream" ],
[ "Polo TV", "rtmp://stream1.polotv.com.pl/polotv/stream1" ],
[ "Tuba TV", "rtmp://fms.gazeta.pl/aglive/tuba_tv playpath=tuba_tv swfUrl=http://bi.gazeta.pl/im/Player.swf pageUrl=http://www.megawypas.pl/readarticle.php?article_id=358 live=true swfVfy=true" ],
[ "Czwórka Polskie Radio", "rtmp://stream85.polskieradio.pl/video/czworka.sdp" ],
[ "Kiss TV", "rtmp://kisstelevision.es.flash3.glb.ipercast.net/kisstelevision.es-live/live" ],
[ "CT.Fm", "rtmp://80.245.113.12/live/pubtalk2?ctfm&ctfm2012pgp" ],
[ "TVN", "rtmp://198.105.217.36/live/telewizyjka_pl_mix_?id=119553" ],
[ "Polsat", "rtmp://75.126.203.130/stream/darmowatelewizjacompolsat?id=59168" ],
[ "TVP INFO ", "rtmp://freeview.fms.visionip.tv/live/tvnetwork-polskaplus-tvpinfo-hsslive-25f-4x3-SDh?extsessionid=50444e8f09104-69afb3db1bb7434f243177b5996b8af1" ],
[ "TVP MIX", "http://195.245.213.199/Ch0003" ],
[ "orange sport", "rtmp://cdn.rtmp.tp.pl/orangecontent_s4/fmlestream" ],
[ "Trwam", "http://195.94.205.211/Trwam" ],
[ "Word of God", "mms://media.WordofGod.gr/WordofGod150PL" ],
[ "Christus Vincit ", "http://82.160.147.122/pustelnia" ],
[ "EduSat", "rtmp://178.73.10.66:1935/live/mpegts.stream" ],
[ "iTV", "mms://stream.mni.pl/ITV" ],
[ "Kosmica TV", "rtmp://streamserver.smartcast.de/kosmicaber/kosmicaber.stream" ],
[ "Pomerania TV", "mms://pomerania.tv:8080/" ],
[ "Telewizja sudecka", "mms://82.139.8.249/sudecka" ],
[ "Dami Radom", "mms://82.139.8.249/dami/" ],
[ "TV Kujawy", "http://77.91.63.211:8090/stream.flv" ],
[ "TV Narew", "http://93.105.142.26:2525/" ],
[ "TOYA ", "http://217.113.224.22/TVToya" ],
[ "RTV Lubuska", "rtmp://94.23.0.87/bankier/rtl" ],
# [title, category_id, videoUrl]
MENU_TAB = [
# [ "TVP2", 0, "rtsp://balancer.eu.wlacz.tv:1935/live/tvp2.stream" ],
# [ "TVP2", 0, "rtmp://balancer.eu.wlacz.tv:1935/live/_definst_/atm.stream" ],
[ "TVN", 0, "rtmp://75.126.203.130/stream/JardelloTV3333?id=59199" ],
[ "TVN LQ", 0, "rtmp://50.23.115.84/stream/telewizyjka?id=61660" ],
[ "TVN24", 1, "rtmp://50.23.65.36/stream/JardelloTV1002?id=57604" ],
# [ "POLSAT", 0, "rtsp://publish.001.wlacz.tv:1935/live/polsat.stream" ],
[ "POLSAT", 0, "rtmp://198.105.209.124/stream/JardelloTV4343?id=59200" ],
[ "Polsat LQ", 0, "rtmp://75.126.203.130/stream/darmowatelewizjacompolsat?id=59168" ],
# [ "TV4", 0, "rtsp://publish.005.wlacz.tv:1935/live/tv4.stream" ],
# [ "TVN7", 0, "rtsp://publish.001.wlacz.tv:1935/live/polsatsportnews.stream" ],
# [ "HBO", 0, "rtsp://publish.001.wlacz.tv:1935/live/hbo1.stream" ],
# [ "TTV", 0, "rtsp://publish.001.wlacz.tv:1935/live/utv.stream" ],
# [ "ATM Rozrywka", 0, "rtsp://publish.001.wlacz.tv:1935/live/atm.stream" ],
[ "TVP INFO ", 1, "rtmp://freeview.fms.visionip.tv/live/tvnetwork-polskaplus-tvpinfo-hsslive-25f-4x3-SDh?extsessionid=50444e8f09104-69afb3db1bb7434f243177b5996b8af1" ],
[ "TVP MIX 1", 0, "http://195.245.213.199/Ch0003" ],
[ "TVP MIX 2", 0, "http://195.245.213.204/Ch0018" ],
[ "TVP MIX 3", 0, "http://195.245.213.204/Ch0019" ],
[ "Nick jr.", 0, "http://95.188.126.233:1234/udp/233.7.70.169:5000" ],
[ "CanalPlus Sport", 2, "rtmp://94.23.39.164/satlive/channel1 playpath=channel1 swfUrl=http://satlive.pl/player/player.swf pageUrl=http://satlive.pl/stream,id-120.htm live=true swfVfy=true" ],
[ "CanalPlus Gol", 2, "rtmp://94.23.39.164/satlive/channel2 playpath=channel2 swfUrl=http://satlive.pl/player/player.swf pageUrl=http://satlive.pl/stream,id-121.htm live=true swfVfy=true" ],
[ "Eurosport2", 2, "rtmp://94.23.39.164/satlive/channel5 playpath=channel5 swfUrl=http://satlive.pl/player/player.swf pageUrl=http://satlive.pl/stream,id-124.htm live=true swfVfy=true" ],
[ "Polsat Sport", 2, "rtmp://94.23.39.164/satlive/channel3 playpath=channel3 swfUrl=http://satlive.pl/player/player.swf pageUrl=http://satlive.pl/stream,id-122.htm live=true swfVfy=true" ],
[ "Sport mix", 2, "rtmp://94.23.39.164/satlive/channel4 playpath=channel4 swfUrl=http://satlive.pl/player/player.swf pageUrl=http://satlive.pl/stream,id-123.htm live=true swfVfy=true" ],
[ "Nova Sport", 2, "http://212.79.96.134:8023/" ],
[ "ČT Sport", 2, "http://212.79.96.134:8014/" ],
[ "TVP Sport stream 1", 2, "http://195.245.213.204/Ch0002" ],
[ "TVP Sport stream 2", 2, "http://195.245.213.204/Ch0006" ],
[ "TVP Sport stream 3", 2, "http://195.245.213.204/Ch0001" ],
[ "TVP Parlament", 1, "http://195.245.213.204/Ch0014" ],
[ "orange sport", 2, "rtmp://cdn.rtmp.tp.pl/orangecontent_s4/fmlestream" ],
[ "ESKA TV", 3, "rtmp://46.105.112.212:1935/live playpath=mpegts.stream swfUrl=http://www.eska.tv/thrdparty/flowplayer/flowplayer.rtmp-3.1.4.swf pageUrl=http://www.eska.tv/player live=true swfVfy=true" ],
[ "Rebel.tv", 3, "rtmp://gdansk.popler.tv:80/publishlive?play=123452/rebeltv playpath=rebeltv swfUrl=http://www.popler.tv/player/flowplayer.cluster.swf pageUrl=http://www.megawypas.pl/readarticle.php?article_id=405 live=true swfVfy=true" ],
[ "4Fun TV", 3, "rtmp://creyden.popler.tv:80/publishlive?play=123452/4funtv playpath=4funtv swfUrl=http://www.popler.tv/player/flowplayer.cluster.swf pageUrl=http://www.megawypas.pl/readarticle.php?article_id=55 live=true swfVfy=true" ],
[ "NEXT Music", 3, "rtmp://vod.wowza.astrosa.pl/rtplive/:music_540p.stream" ],
[ "Deluxe Music", 3, "rtmp://flash.cdn.deluxemusic.tv/deluxemusic.tv-live/web_850.stream" ],
[ "TV Disco", 3, "rtmp://gdansk.popler.tv:80/publishlive?play=123452/tvdisco playpath=tvdisco swfUrl=http://www.popler.tv/player/flowplayer.cluster.swf pageUrl=http://www.megawypas.pl/readarticle.php?article_id=55 live=true swfVfy=true" ],
[ "Polo TV", 3, "rtmp://stream1.polotv.com.pl/polotv/stream1" ],
[ "Tuba TV", 3, "rtmp://fms.gazeta.pl/aglive/tuba_tv playpath=tuba_tv swfUrl=http://bi.gazeta.pl/im/Player.swf pageUrl=http://www.megawypas.pl/readarticle.php?article_id=358 live=true swfVfy=true" ],
[ "Czwórka Polskie Radio", 3, "rtmp://stream85.polskieradio.pl/video/czworka.sdp" ],
[ "Kiss TV", 3, "rtmp://kisstelevision.es.flash3.glb.ipercast.net/kisstelevision.es-live/live" ],
[ "CT.Fm", 3, "rtmp://80.245.113.12/live/pubtalk2?ctfm&ctfm2012pgp" ],
[ "Óčko TV", 3, "rtmp://194.79.52.79/ockoi/ockoHQ1" ],
[ "Trwam", 4, "http://195.94.205.211/Trwam" ],
[ "Word of God", 4, "mms://media.WordofGod.gr/WordofGod150PL" ],
[ "Christus Vincit ", 4, "http://82.160.147.122/pustelnia" ],
[ "EduSat", 0, "rtmp://178.73.10.66:1935/live/mpegts.stream" ],
[ "iTV", 0, "mms://stream.mni.pl/ITV" ],
[ "Kosmica TV", 0, "rtmp://streamserver.smartcast.de/kosmicaber/kosmicaber.stream" ],
[ "Pomerania TV", 5, "mms://pomerania.tv:8080/" ],
[ "Telewizja sudecka", 5, "mms://82.139.8.249/sudecka" ],
[ "Dami Radom", 5, "mms://82.139.8.249/dami/" ],
[ "TV Kujawy", 5, "http://77.91.63.211:8090/stream.flv" ],
[ "TV Narew", 5, "http://93.105.142.26:2525/" ],
[ "TV Toruń ", 5, "http://217.173.176.107:1935/live/ngrp:tvk.stream_all/chunklist-b1399547.m3u8?wowzasessionid=1841105475" ],
[ "TOYA ", 5, "http://217.113.224.22/TVToya" ],
[ "RTV Lubuska", 5, "rtmp://94.23.0.87/bankier/rtl" ],
[ "TV Asta ", 5, "http://xeon.asta-net.pl/tvasta" ],
[ "CW24TV", 5, "rtmp://cdn4.stream360.pl:1935/CW24/transmisja_live" ],
[ "Tawizja", 5, "rtmp://wwz1.4vod.tv:1935/4vod-rtp/tawizja.stream " ],
[ "Dla Ciebie.Tv", 5, "rtsp://mediaserver02.artcom.pl/live/DlaCiebieTv800.stream" ],
[ "Telewizja lubuszan", 5, "rtmp://212-112.livestream.com:80/mogulus-stream-edge/tllive/rtmp://212-47.livestream.com/mogulus/tllive/1da1455e-f1ad-47bb-b019-d8a0099bd196" ],
[ "TiWi", 0, "rtmp://extondemand.livestream.com:80/ondemand/trans/dv02/mogulus-user-files/chv2tivinet/2009/05/11/b4ae4fc2-a938-488b-9731-cb93278a10ad" ],
[ "Panorama Polska", 0, "rtmp://extondemand.livestream.com/ondemand/trans/dv03/mogulus-user-files/chpanoramapolska/2010/01/07/5825602e-bdd1-490f-8680-4054c7db78ca" ],
[ "Zdrowy Puls", 0, "rtmp://extondemand.livestream.com/ondemand/trans/dv15/mogulus-user-files/chzdrowypuls/2012/04/04/15bbcc6c-30dc-4f08-91ca-b14dc40bbe3a" ],
[ "SKY NEWS", 6,"mms://194.88.72.17:1755/skynews_wmlz_live300k" ],
[ "BBC World News HD", 6,"http://212.79.96.134:8011/" ],
[ "BBC 1", 6,"rtsp://195.90.118.93/bbc1_1" ],
[ "BBC 2", 6,"rtsp://195.90.118.93/bbc2_1" ],
[ "Россия 24", 6,"http://cdnvideowmlive.fplive.net/cdnvideowmlive-live/r24_hq" ],
[ "CBBC", 6,"rtsp://195.90.118.93/CBBC_1" ],
[ "EuroNews", 6,"http://212.79.96.134:8013/" ],
[ "Pro7", 6,"http://212.79.96.134:8009/" ],
[ "Rtl", 6,"http://212.79.96.134:8008/" ],
[ "Sat1", 6,"http://212.79.96.134:8010/" ],
[ "LTV 1", 6,"http://82.135.235.37:80/LTV" ],
[ "LTV World", 6,"http://82.135.235.37:80/LTVworld" ],
[ "MTV Россия", 3,"http://77.91.77.19:7015/?sid=" ],
[ "CNN", 6,"rtsp://media2.lsops.net:554/live/cnn_en_medium.sdp" ],
[ "Russia Today", 6,"rtmp://fms5.visionip.tv/live/RT_3" ],
[ "3Sat", 6,"rtsp://a62.l12560554061.c125605.g.lm.akamaistream.net/D/62/125605/v0001/reflector:54061" ],
[ "The Voice", 6,"http://62.41.56.32:80/PUBLIC_votv_fi" ],
[ "France 24 FR ", 6,"http://stream1.france24.yacast.net/f24_livefr" ],
[ "France 24 ANG ", 6,"http://stream1.france24.yacast.net/f24_liveen" ],
[ "ČT24 ", 6,"rtmp://wcdn42.nacevi.cz:80/CT24?id=HRydF7MABFzyrU7&publisher=lss/CT24-MP4_576p.stream" ],
[ "Publika TV", 6,"rtmp://91.230.214.56/publika/livepublika1" ],
[ "Big Pond Sport ", 6,"http://cht-cdn220-is-12.se.bptvlive.ngcdn.telstra.com/bp_online_bpsport_high" ],
[ "TVN24 [chello]", 0, "mms://stream.livetv.chello.pl/TVN24" ],
[ "TVN TURBO [BEZ REKLAM]", 0, "rtmp://adm.live.tvtp.pl/TVNTurbo/ playpath=tv swfUrl=http://www.tvtp.pl/player/player_o_video.swf?pUrl=tvnturbo_c.e9baa14091ebd631a7a7d03445c18c18&allowfullscreen=true&pAutoplay=1&pStreaming=11 pageUrl=http://www.tvtp.pl/player/player_o_video.swf?pUrl=tvnturbo_c.e9baa14091ebd631a7a7d03445c18c18&allowfullscreen=true&pAutoplay=1&pStreaming=11 live=true swfVfy=true" ],
[ "Poslkie stacje radiowe", 0, "http://xbmc.cba.pl/zbmc/onair.m3u" ],
[ "Jedynka Polskie Radio", 7,"rtmp://stream85.polskieradio.pl/live/pr1.sdp" ],
[ "Dwójka Polskie Radio", 7,"rtmp://stream85.polskieradio.pl/live/pr2.sdp" ],
[ "Trójka Polskie Radio", 7,"rtmp://stream85.polskieradio.pl/live/pr3.sdp" ],
[ "Czwórka Polskie Radio", 7,"rtmp://stream85.polskieradio.pl/live/pr4.sdp" ],
[ "RMF FM", 7,"http://195.150.20.243/RMFFM48" ],
[ "RMF CLASSIC", 7,"http://195.150.20.246/RMFCLASSIC48" ],
[ "RMF MAXX", 7,"http://217.74.72.10/RMFMAXXX48" ],
[ "Radio ZET", 7,"http://radiozetmp3-17.eurozet.pl:8400/;stream.nsv?seed=6046.38266377151" ],
[ "ChilliZET", 7,"http://chillizetmp3-03.eurozet.pl:8400/;stream.nsv?seed=13186.232442967594" ],
[ "Planeta FM", 7,"http://planetamp3-01.eurozet.pl:8400/;stream.nsv?seed=3665.857259184122" ],
[ "Antyradio ", 7,"http://94.23.88.162:9200/;stream.nsv?seed=20.587672479450703" ],
[ "Radio Plus", 7,"http://plus-siec-01.eurozet.pl:8500/;stream.nsv?seed=15073.804180137813" ],
[ "TOK FM", 7,"http://fm.tuba.pl/stream.pls?radio=10" ],
[ "Radio Złote Przeboje", 7,"http://fm.tuba.pl/stream.pls?radio=9" ],
[ "Roxy FM", 7,"http://fm.tuba.pl/stream.pls?radio=8" ],
[ "Eska", 7,"http://poznan5-5.radio.pionier.net.pl:8000/eska-warszawa.mp3" ],
[ "Eska Rock", 7,"http://poznan5.radio.pionier.net.pl:8000/eskarock.mp3" ],
[ "Radio Maryja", 7,"http://195.94.205.211/rm?MSWMExt=.asf" ],
[ "Radio Wrocław", 7,"http://poznan5-1.radio.pionier.net.pl:8000/prwroclaw.mp3" ],
[ "Radio Lublin", 7,"http://www.radio.lublin.pl/streaming/64k.m3u" ],
[ "Radio Kraków", 7,"http://panel.nadaje.com:9150/radiokrakow.ogg?1352066977890.ogg" ],
[ "Radio Rzeszów", 7,"http://radiointernetowe.net:9500/" ],
[ "Radio Białystok", 7,"http://bh2.pl:9938" ],
[ "Radio Katowice", 7,"http://85.11.77.142:8000/RadioKatowice.mp3.m3u" ],
[ "Radio Kielce", 7,"http://gra.radio.kielce.com.pl:8000/rk1" ],
[ "Radio Opole", 7,"http://213.73.25.178:7055/" ],
[ "Radio Szczecin", 7,"http://www.radio.szczecin.pl/onair.m3u" ],
[ "Radio Kaszëbë", 7,"http://stream3.nadaje.com:8048/;;0" ],
[ "Radio Fest", 7,"http://209.62.16.60/radiofest" ],
[ "Radio CCM", 7,"http://209.62.16.60/radioccm?1352151821734.mp3" ],
[ "Radio Piekary", 7,"http://shot2.inten.pl:8412/" ],
]
 
[ "TV Asta ", "http://xeon.asta-net.pl/tvasta" ],
[ "CW24TV", "rtmp://cdn4.stream360.pl:1935/CW24/transmisja_live" ],
[ "Telewizja lubuszan", "rtmp://212-104.livestream.com/mogulus-stream-edge/tllive/rtmp://212-97.livestream.com/mogulus/tllive/40c823ce-648b-44cd-9596-d5f4d6d31c8d" ],
[ "TiWi", "rtmp://extondemand.livestream.com:80/ondemand/trans/dv02/mogulus-user-files/chv2tivinet/2009/05/11/b4ae4fc2-a938-488b-9731-cb93278a10ad" ],
[ "Panorama Polska", "rtmp://extondemand.livestream.com/ondemand/trans/dv03/mogulus-user-files/chpanoramapolska/2010/01/07/5825602e-bdd1-490f-8680-4054c7db78ca" ],
[ "Zdrowy Puls", "rtmp://extondemand.livestream.com/ondemand/trans/dv15/mogulus-user-files/chzdrowypuls/2012/04/04/15bbcc6c-30dc-4f08-91ca-b14dc40bbe3a" ],
[ "Oczko tv", "rtmp://stream7.idnes.cz/live/ocko playpath=ocko swfUrl=http://g.idnes.cz/swf/flv/player.swf pageUrl=http://www.megawypas.pl/readarticle.php?article_id=194 live=true swfVfy=true" ],
# [ "SKY NEWS", "mms://194.88.72.17:1755/skynews_wmlz_live300k" ],
# [ "CNN", "rtsp://media2.lsops.net:554/live/cnn_en_medium.sdp" ],
# [ "Russia Today", "rtmp://fms5.visionip.tv/live/RT_3" ],
# [ "3Sat", "rtsp://a62.l12560554061.c125605.g.lm.akamaistream.net/D/62/125605/v0001/reflector:54061" ],
# [ "The Voice", "http://62.41.56.32:80/PUBLIC_votv_fi" ],
 
# [ "Publika TV", "rtmp://91.230.214.56/publika/livepublika1" ],
[ "TVN24 [chello]", "mms://stream.livetv.chello.pl/TVN24" ],
[ "TVN TURBO [BEZ REKLAM]", "rtmp://adm.live.tvtp.pl/TVNTurbo/ playpath=tv swfUrl=http://www.tvtp.pl/player/player_o_video.swf?pUrl=tvnturbo_c.e9baa14091ebd631a7a7d03445c18c18&allowfullscreen=true&pAutoplay=1&pStreaming=11 pageUrl=http://www.tvtp.pl/player/player_o_video.swf?pUrl=tvnturbo_c.e9baa14091ebd631a7a7d03445c18c18&allowfullscreen=true&pAutoplay=1&pStreaming=11 live=true swfVfy=true" ] ]
 
 
class StreamStations:
#def __init__(self):
def __init__(self):
self.parser = Parser.Parser()
self.cm = pCommon.common()
 
def showStations(self):
#MENU_TAB.sort()
def showStations(self, catID):
MENU_TAB.sort(key = lambda x: x[0])
for i in range(len(MENU_TAB)):
self.addLink(MENU_TAB[i][0], MENU_TAB[i][1])
if MENU_TAB[i][1]==int(catID):
self.add('stations', MENU_TAB[i][0], 'None', False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
 
def addLink(self, title, url):
u = url
liz=xbmcgui.ListItem(title, iconImage="DefaultFolder.png", thumbnailImage="DefaultVideo.png")
liz.setProperty("IsPlayable", "true")
liz.setInfo( type="Video", infoLabels={ "Title": title } )
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=False)
def showCategories(self):
CATEGORY_TAB.sort(key = lambda x: x[1])
for i in range(len(CATEGORY_TAB)):
self.add('stations', CATEGORY_TAB[i][1], str(CATEGORY_TAB[i][0]))
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
 
def add(self, service, name, val, folder = True, isPlayable = False):
u=sys.argv[0] + "?service=" + service + "&name=" + name + "&val=" + val
liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage="DefaultFolder.png")
if isPlayable:
liz.setProperty("IsPlayable", "true")
liz.setInfo( type="Video", infoLabels={ "Title": name } )
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=folder)
 
 
def getVideoLink(self, name):
nUrl = ""
for i in range(len(MENU_TAB)):
if MENU_TAB[i][0]==name:
nUrl = MENU_TAB[i][2]
return nUrl
def LOAD_AND_PLAY_VIDEO(self, videoUrl):
xbmcPlayer = xbmc.Player()
xbmcPlayer.play(videoUrl)
 
def handleService(self):
self.showStations()
 
params = self.parser.getParams()
name = str(self.parser.getParam(params, "name"))
val = str(self.parser.getParam(params, "val"))
log.info("name: " + name)
log.info("val: " + val)
if name == 'None':
self.showCategories()
else:
if self.cm.isNumeric(val):
self.showStations(val)
else:
url = self.getVideoLink(name)
self.LOAD_AND_PLAY_VIDEO(url)
/trunk/xbmc-addons/src/plugin.video.polishtv.live/hosts/serialnet.py
New file
0,0 → 1,189
# -*- coding: utf-8 -*-
import cookielib, os, string, StringIO
import os, time, base64, logging, calendar
import urllib, urllib2, re, sys, math
import xbmcgui, xbmc, xbmcaddon, xbmcplugin
 
scriptID = 'plugin.video.polishtv.live'
scriptname = "Polish Live TV"
ptv = xbmcaddon.Addon(scriptID)
 
BASE_RESOURCE_PATH = os.path.join( ptv.getAddonInfo('path'), "../resources" )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ) )
 
import pLog, settings, Parser, pCommon
 
log = pLog.pLog()
 
mainUrl = 'http://serialnet.pl'
watchUrl = mainUrl + '/ogladaj/'
 
version = ptv.getSetting('serialnet_wersja')
 
HOST = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110621 Mandriva Linux/1.9.2.18-0.1mdv2010.2 (2010.2) Firefox/3.6.18'
 
class SerialNet:
def __init__(self):
log.info('Loading SerialNet')
self.settings = settings.TVSettings()
self.parser = Parser.Parser()
self.cm = pCommon.common()
def getSerialsTable(self):
strTab = []
outTab = []
link = self.cm.requestData(mainUrl)
#<li><a href="http://serialnet.pl/serial/1-1023/10-things-i-hate-about-you">10 Things I Hate About You <
match = re.compile('<li><a href="http://serialnet.pl/serial/(.+?)">(.+?)<').findall(link)
if len(match) > 0:
for i in range(len(match)):
strTab.append(match[i][1])
strTab.append('http://serialnet.pl/serial/' + match[i][0])
outTab.append(strTab)
strTab = []
outTab.sort(key = lambda x: x[0])
return outTab
 
def getInfo(self,data):
outTab = []
#<meta property="og:image" content="http://static.serialnet.pl/thumbs/zakochana-zlosnica.jpg"/>
match = re.compile('<meta property="og:image" content="(.+?)"/>').findall(data)
if len(match) > 0:
imageLink = match[0]
else:
imageLink = ''
outTab.append(imageLink)
 
d = data.replace("<br/>","").replace("\n","")
match = re.compile('<p><fb:like href=.+?</p><strong>(.+?)</strong></p></div>').findall(d)
if len(match) > 0:
desc = match[0]
else:
desc = ''
outTab.append(desc)
return outTab
 
def showSerialTitles(self):
tab = self.getSerialsTable()
if len(tab) > 0:
for i in range(len(tab)):
self.addDir('serialnet', 'serial-title', 'None', tab[i][0], '', tab[i][1], '', True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
def showSeason(self, url):
link = self.cm.requestData(url)
info = self.getInfo(link)
#<h3>Sezon 1</h3></div>
match = re.compile('<div style=".+?"><h3>(.+?)</h3></div>').findall(link)
if len(match) > 0:
for i in range(len(match)):
if 'Sezon' in match[i]:
self.addDir('serialnet', 'serial-season', 'None', match[i], info[1], url, info[0], True, False)
#zmien view na "Media Info 2"
xbmcplugin.setContent(int(sys.argv[1]),'tvshows')
xbmc.executebuiltin("Container.SetViewMode(503)")
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
 
def showSerialParts(self, url, title):
link = self.cm.requestData(url)
info = self.getInfo(link)
tTab = title.split(' ')
num = tTab[1]
s = "sezon-" + str(num)
#href="http://serialnet.pl/ogladaj/1-20/10-things-i-hate-about-you-sezon-1-odcinek-20"><b>Odcinek: 20 : Revolution</b>
#<b>Odcinek: 1</b>
match = re.compile('href="(.+?)' + s + '(.+?)"><b>Odcinek:(.+?)</b>').findall(link)
if len(match) > 0:
for i in range(len(match)):
oTab = match[i][2].split(':')
if len(oTab)==2:
episode = 'Odcinek ' + oTab[0] + ' - ' + oTab[1]
else:
episode = 'Odcinek ' + oTab[0]
self.addDir('serialnet', 'playSelectedMovie', 'None', episode, info[1], match[i][0] + s + match[i][1], info[0], True, False)
#zmien view na "Media Info 2"
xbmcplugin.setContent(int(sys.argv[1]),'tvshows')
xbmc.executebuiltin("Container.SetViewMode(503)")
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
def getVideoUrl(self, url):
link = self.cm.requestData(url)
#<iframe id="framep" class="radi" src="http://serialnet.pl/play.php?t=1-18"
match = re.compile('<iframe id="framep" class="radi" src="(.+?)"').findall(link)
if len(match) > 0:
nUrl = match[0]
if version == 'false':
d = xbmcgui.Dialog()
item = d.select("Wybór wersji", ["Napisy","Bez lektora i napisow"])
if item != '':
log.info(item)
if item == 0:
nUrl = match[0] + '&wersja=napisy'
if item == 1:
nUrl = match[0] + '&wersja=oryginalny'
link = self.cm.requestData(nUrl)
#log.info(link)
#var flm = escape('http://50.7.220.66/folder/432ee8003a064ecc0eb46abfa59a044a_8555.mp4');
match_watch = re.compile("var flm = escape\('(.+?)'\);").findall(link)
if len(match_watch) > 0:
videoUrl = match_watch[0]
else:
videoUrl = ''
return videoUrl
 
def addDir(self, service, name, category, title, plot, link, iconimage, folder = True, isPlayable = True):
u=sys.argv[0] + "?service=" + service + "&name=" + name + "&category=" + category + "&title=" + title + "&page=" + urllib.quote_plus(link)
if iconimage == '':
iconimage = "DefaultVideo.png"
liz=xbmcgui.ListItem(title, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
if isPlayable:
liz.setProperty("IsPlayable", "true")
liz.setInfo( type="Video", infoLabels={ "Title": title, "Plot": plot } )
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=folder)
 
def LOAD_AND_PLAY_VIDEO(self, videoUrl):
ok=True
if videoUrl == '':
d = xbmcgui.Dialog()
d.ok('Nie znaleziono streamingu.', 'Może to chwilowa awaria.', 'Spróbuj ponownie za jakiś czas')
return False
try:
xbmcPlayer = xbmc.Player()
xbmcPlayer.play(videoUrl)
except:
d = xbmcgui.Dialog()
d.ok('Błąd przy przetwarzaniu, lub wyczerpany limit czasowy oglądania.', 'Zarejestruj się i opłać abonament.', 'Aby oglądać za darmo spróbuj ponownie za jakiś czas')
return ok
 
def handleService(self):
params = self.parser.getParams()
name = self.parser.getParam(params, "name")
title = self.parser.getParam(params, "title")
category = self.parser.getParam(params, "category")
page = self.parser.getParam(params, "page")
if name == None:
self.showSerialTitles()
elif name == 'serial-title':
self.showSeason(page)
elif name == 'serial-season' and title != None and page != None:
self.showSerialParts(page, title)
if name == 'playSelectedMovie':
log.info('video url: ' + page)
videoUrl = self.getVideoUrl(page)
print videoUrl
if videoUrl != '':
self.LOAD_AND_PLAY_VIDEO(videoUrl)
else:
d = xbmcgui.Dialog()
d.ok('Brak linku', 'SerialNet.pl - nie znaleziono linku')
/trunk/xbmc-addons/src/plugin.video.polishtv.live/hosts/tvn.py
26,6 → 26,16
scriptname = "Polish Live TV"
ptv = xbmcaddon.Addon(scriptID)
 
qualities = [
'HD',
'Bardzo wysoka',
'Wysoka',
'Standard',
'Średnia'
'Niska',
'Bardzo niska',
]
 
PAGE_LIMIT = ptv.getSetting('tvn_perpage')
platform = ptv.getSetting('tvn_platform')
quality = ptv.getSetting('tvn_quality')
324,10 → 334,11
return "http://redir.atmcdn.pl/http/%s?salt=%s&token=%s" % (url, salt, encryptedTokenHEX)
 
def watched(self, videoUrl):
wasWatched = ''
videoPath = videoUrl[0:1+videoUrl.rfind('/')]
sql_data = "SELECT count(*) FROM files LEFT JOIN path ON files.idPath = path.idPath WHERE path.strPath = '" + videoPath + "' AND files.playCount > 0"
xml_data = xbmc.executehttpapi( "QueryVideoDatabase(%s)" % urllib.quote_plus( sql_data ), )
wasWatched = re.findall( "<field>(.*?)</field>", xml_data)[0]
# sql_data = "SELECT count(*) FROM files LEFT JOIN path ON files.idPath = path.idPath WHERE path.strPath = '" + videoPath + "' AND files.playCount > 0"
# xml_data = xbmc.executehttpapi( "QueryVideoDatabase(%s)" % urllib.quote_plus( sql_data ), )
# wasWatched = re.findall( "<field>(.*?)</field>", xml_data)[0]
if wasWatched == "1":
return True
else :
357,13 → 368,16
def getUrlFromTab(self, tab, key):
out = ''
for i in range(len(tab)):
k = tab[i][0]
v = tab[i][1]
if key == k:
out = v
break
out = ''
for key in qualities if key == 'Maksymalna' else [key]:
for i in range(len(tab)):
k = tab[i][0]
v = tab[i][1]
if key == k:
out = v
break
if out != '':
break
if out == '':
tabmenu = []
for i in range(len(tab)):
/trunk/xbmc-addons/src/plugin.video.polishtv.live/cmd/record.py
14,7 → 14,11
scriptID = 'plugin.video.polishtv.live'
ptv = xbmcaddon.Addon(scriptID)
 
#REC_JSON_PATH = os.path.join(os.getcwd(), "../recs")
BASE_RESOURCE_PATH = os.path.join( ptv.getAddonInfo('path'), "resources" )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ) )
 
import pCommon
 
HOST_XBMC = 'XBMC'
HOST_URL = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110621 Mandriva Linux/1.9.2.18-0.1mdv2010.2 (2010.2) Firefox/3.6.18'
 
65,6 → 69,10
 
class Record:
def __init__(self):
self.common = pCommon.common()
#self.parser = Parser.Parser()
def getOptions(self):
file = sys.argv[1]
if os.path.isfile(file):
81,7 → 89,7
def downloadWlaczTV(self, rtmp, rectime, dstpath, name, opts = {}):
if os.path.isfile(rtmp) and os.access(rtmp, os.X_OK) and os.path.isdir(dstpath):
file = os.path.join(str(dstpath), name + ".flv")
os.system(str(rtmp) + " -B " + str(rectime) + " -r " + str(opts['rtmp']) + " -a " + str(opts['app']) + " -p " + str(opts['pageurl']) + " -t " + str(opts['tcurl']) + " -y " + str(opts['playpath']) + " -v live -o " + file)
os.system(str(rtmp) + " -B " + str(rectime) + " -r " + str(opts['rtmp']) + " -y " + str(opts['playpath']) + " -v live -o " + file)
os.remove(sys.argv[1])
def getWeebTVParams(self, playerUrl, login, password, channel, hq):
110,43 → 118,16
print urlerr
return data
 
def getWlaczTVParams(self, login_url, login, password, url):
def getWlaczTVParams(self, login_url, login, password, url, key):
rtmp = {}
cj = cookielib.LWPCookieJar()
l_headers = { 'User-Agent' : HOST_URL }
l_post = { 'email': login, 'password': password }
l_opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
l_data = urllib.urlencode(l_post)
l_req = urllib2.Request(login_url, l_data, l_headers)
l_response = l_opener.open(l_req)
l_link = l_response.read()
l_response.close()
post_login = { 'username': login, 'password': password }
post_key = { 'key': key }
if not os.path.isdir(ptv.getAddonInfo('path') + os.path.sep + "cookies"):
os.mkdir(ptv.getAddonInfo('path') + os.path.sep + "cookies")
cj.save(COOKIEFILE)
if os.path.isfile(COOKIEFILE):
cj.load(COOKIEFILE)
req = urllib2.Request(url)
req.add_header('User-Agent', HOST_URL)
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
response = opener.open(req)
data = response.read()
response.close()
match = re.compile("<param name=\"flashvars\" value=\"src=(.+?)&poster=(.+?)&streamType=live&autoPlay=true\"></param>").findall(data)
if len(match) > 0:
raw_rtmp_tab = match[0][0].split("?")
split_rtmp_tab = raw_rtmp_tab[0].split("/")
rtmp_link = raw_rtmp_tab[0]
if split_rtmp_tab[len(split_rtmp_tab) - 1].endswith(".stream"):
app = "live?" + raw_rtmp_tab[1]
tcurl = "rtmp://" + split_rtmp_tab[len(split_rtmp_tab) - 3] + ":1935/live?" + raw_rtmp_tab[1]
playpath = split_rtmp_tab[len(split_rtmp_tab) - 1]
else:
app = "wlacztv?" + raw_rtmp_tab[1]
tcurl = "rtmp://" + split_rtmp_tab[len(split_rtmp_tab) - 3] + ":1935/live?" + raw_rtmp_tab[1]
playpath = split_rtmp_tab[len(split_rtmp_tab) - 1] + "?" + raw_rtmp_tab[1]
rtmp = {'rtmp': rtmp_link, 'app': app, 'pageurl': url, 'tcurl': tcurl, 'playpath': playpath}
#log.info("rtmp link: " + str(rtmp))
self.common.saveURLToFileCookieData(login_url, COOKIEFILE, post_login)
rtmp_json = json.loads(self.common.postURLFromFileCookieData(url, COOKIEFILE, post_key))
rtmp_link = rtmp_json['rtmp_server'] + "/" + rtmp_json['app'] + '?wlacztv_session_token=' + rtmp_json['token']
rtmp = {'rtmp': rtmp_link, 'playpath': rtmp_json['playPath']}
return rtmp
 
 
157,6 → 138,6
params = rec.getWeebTVParams(opts['urlPlayer'], opts['login'], opts['password'], int(opts['channel']), opts['hq'])
rec.downloadWeebTV(opts['rtmp_path'], opts['rectime'], opts['dst_path'], opts['name'], params)
elif opts['service'] == 'wlacztv':
params = rec.getWlaczTVParams(opts['login_url'], opts['login'], opts['password'], opts['url'])
params = rec.getWlaczTVParams(opts['login_url'], opts['login'], opts['password'], opts['url'], opts['key'])
rec.downloadWlaczTV(opts['rtmp_path'], opts['rectime'], opts['dst_path'], opts['name'], params)
/trunk/xbmc-addons/src/plugin.video.polishtv.live/addon.xml
1,8 → 1,8
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.polishtv.live"
name="Telewizja Polska (kanały, VOD, filmy, seriale)"
version="0.0.4"
provider-name="Plesken">
version="0.1.0"
provider-name="SD Team">
<requires>
<import addon="xbmc.python" version="1.0"/>
<import addon="script.module.elementtree" version="1.2.7" />
/trunk/xbmc-addons/src/plugin.video.polishtv.live/resources/settings.xml
22,15 → 22,14
<setting type="sep"/>
<setting type="lsep" label="55010"/>
<setting id="weebtv_rec" type="bool" label="55011" default="false" />
<!--<setting id="weebtv_rtmp" type="file" label="55007" default="" />-->
<!--<setting id="weebtv_dstpath" type="folder" label="55008" default="" />-->
<setting type="lsep" label="55007" />
<setting id="weebtv_strm" type="folder" label="55008" default="None" />
</category>
<category label="55200">
<setting id="tvn_perpage" type="labelenum" label="55201" values="10|20|30|40|50" default="50" />
<setting id="tvn_platform" type="labelenum" label="55202" values="Mobile (Android)|Samsung TV" default="Samsung TV" />
<setting id="tvn_quality_manual" type="bool" label="55204" default="false" />
<setting id="tvn_quality" type="labelenum" label="55203" values="HD|Bardzo wysoka|Wysoka|Standard|Średnia|Niska|Bardzo niska" default="Bardzo wysoka" visible="eq(-1,false)" />
<setting id="tvn_quality_temp" type="labelenum" label="" values="" default="" visible="false" />
<setting id="tvn_quality" type="labelenum" label="55203" values="Maksymalna|HD|Bardzo wysoka|Wysoka|Standard|Średnia|Niska|Bardzo niska" default="Maksymalna" visible="eq(-1,false)" /> <setting id="tvn_quality_temp" type="labelenum" label="" values="" default="" visible="false" />
</category>
<category label="55300">
<setting id="tvp_perpage" type="labelenum" label="55301" values="10|20|30|40|50" default="50" />
39,6 → 38,8
<setting id="iplex_adult" type="bool" label="55401" default="false" />
</category>
<category label="55500">
<setting id="ekinotv_login" type="text" label="55503" default="" />
<setting id="ekinotv_password" type="text" label="55504" option="hidden" default="" />
<setting id="ekinotv_sort" type="labelenum" label="55501" values="ocena|popularnosc|data dodania|tytul" default="data dodania" />
<setting id="ekinotv_sortorder" type="labelenum" label="55502" values="malejaco|rosnaco" default="malejaco" />
</category>
48,5 → 49,10
<setting id="wlacztv_pass" type="text" label="55603" option="hidden" default="" />
<setting type="lsep" label="55611"/>
<setting id="wlacztv_rec" type="bool" label="55612" default="false" />
<setting type="lsep" label="55007" />
<setting id="wlacztv_strm" type="folder" label="55008" default="None" />
</category>
<category label="55700">
<setting id="serialnet_wersja" type="bool" label="55701" default="true" />
</category>
</settings>
/trunk/xbmc-addons/src/plugin.video.polishtv.live/resources/language/English/strings.xml
18,7 → 18,8
<string id="55004">Włącz logowanie</string>
<!--<string id="55005">Ustawienie IP streamingu</string>-->
<string id="55005">Ustawienie jakości streamingu</string>
<string id="55006">Wybierz IP</string>
<string id="55007">EPG</string>
<string id="55008">Choose directory for STRM files</string>
<string id="55009">High quality (if available)</string>
<string id="55010">Record</string>
<string id="55011">Enable record question</string>
43,6 → 44,8
<string id="55500">EkinoTV</string>
<string id="55501">Sort by</string>
<string id="55502">Order by</string>
<string id="55503">Username:</string>
<string id="55504">Password:</string>
<!-- Wlacz TV settings -->
<string id="55600">WlaczTV</string>
69,4 → 72,8
<string id="55621">Start recording time</string>
<string id="55622">Enter end of recording date</string>
<string id="55623">End recording time</string>
<!-- SerialNet settings -->
<string id="55700">SerialNet</string>
<string id="55701">Disable version question</string>
</strings>
/trunk/xbmc-addons/src/plugin.video.polishtv.live/resources/language/Polish/strings.xml
18,7 → 18,8
<string id="55004">Włącz logowanie</string>
<!--<string id="55005">Ustawienie IP streamingu</string>-->
<string id="55005">Ustawienie jakości streamingu</string>
<string id="55006">Wybierz IP</string>
<string id="55007">EPG</string>
<string id="55008">Wybierz katalog dla plików STRM</string>
<string id="55009">Wysoka jakość (jeśli dostępna)</string>
<string id="55010">Nagrywanie</string>
<string id="55011">Włącz pytanie o nagranie</string>
43,6 → 44,8
<string id="55500">EkinoTV</string>
<string id="55501">Sortuj</string>
<string id="55502">Porządek</string>
<string id="55503">Użytkownik:</string>
<string id="55504">Hasło:</string>
<!-- Wlacz TV settings -->
<string id="55600">WlaczTV</string>
69,4 → 72,8
<string id="55621">Początek nagrania</string>
<string id="55622">Wprowadź datę końca nagrania</string>
<string id="55623">Koniec nagrania</string>
<!-- SerialNet settings -->
<string id="55700">SerialNet</string>
<string id="55701">Wylacz pytanie o wersje video</string>
</strings>
/trunk/xbmc-addons/src/plugin.video.polishtv.live/resources/lib/common.py
New file
0,0 → 1,30
# -*- coding: utf-8 -*-
import re, os, sys, cookielib
import urllib, urllib2, re, sys, math
 
scriptID = sys.modules[ "__main__" ].scriptID
scriptname = "Polish Live TV"
 
HOST = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110621 Mandriva Linux/1.9.2.18-0.1mdv2010.2 (2010.2) Firefox/3.6.18'
 
cj = cookielib.LWPCookieJar()
 
class common:
def __init__(self):
pass
def requestData(self, url):
req = urllib2.Request(url)
req.add_header('User-Agent', HOST)
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
response = opener.open(req)
data = response.read()
response.close()
return data
def isNumeric(self,s):
try:
float(s)
return True
except ValueError:
return False
/trunk/xbmc-addons/src/plugin.video.polishtv.live/resources/lib/pCommon.py
New file
0,0 → 1,81
# -*- coding: utf-8 -*-
import re, os, sys, cookielib
import urllib, urllib2, re, sys, math
 
scriptID = sys.modules[ "__main__" ].scriptID
scriptname = "Polish Live TV"
 
HOST = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110621 Mandriva Linux/1.9.2.18-0.1mdv2010.2 (2010.2) Firefox/3.6.18'
 
cj = cookielib.LWPCookieJar()
 
class common:
def __init__(self):
pass
def requestData(self, url):
req = urllib2.Request(url)
req.add_header('User-Agent', HOST)
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
response = opener.open(req)
data = response.read()
response.close()
return data
def getURLFromFileCookieData(self, url, COOKIEFILE):
cj.load(COOKIEFILE)
req = urllib2.Request(url)
req.add_header('User-Agent', HOST)
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
response = opener.open(req)
data = response.read()
response.close()
return data
 
def postURLFromFileCookieData(self, url, COOKIEFILE, POST = {}):
cj.load(COOKIEFILE)
headers = { 'User-Agent' : HOST }
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
dataPost = urllib.urlencode(POST)
req = urllib2.Request(url, dataPost, headers)
response = opener.open(req)
data = response.read()
response.close()
return data
def saveURLToFileCookieData(self, url, COOKIEFILE, POST = {}):
headers = { 'User-Agent' : HOST }
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
dataPost = urllib.urlencode(POST)
req = urllib2.Request(url, dataPost, headers)
response = opener.open(req)
data = response.read()
response.close()
cj.save(COOKIEFILE)
return data
def makeABCList(self):
strTab = []
strTab.append('0 - 9');
for i in range(65,91):
strTab.append(str(unichr(i)))
return strTab
def getItemByChar(self, char, tab):
strTab = []
char = char[0]
for i in range(len(tab)):
if ord(char) >= 65:
if tab[i][0].upper() == char:
strTab.append(tab[i])
else:
if ord(tab[i][0]) >= 48 and ord(tab[i][0]) <= 57:
strTab.append(tab[i])
return strTab
def isNumeric(self,s):
try:
float(s)
return True
except ValueError:
return False
/trunk/xbmc-addons/src/plugin.video.polishtv.live/default.py
16,7 → 16,7
sys.path.append( os.path.join( ptv.getAddonInfo('path'), "hosts" ) )
 
import pLog, settings, Parser
import weebtv, stations, tvp, tvn, iplex, tvpvod, ekinotv, iitvinfo, anyfiles, wlacztv
import weebtv, stations, tvp, tvn, iplex, tvpvod, ekinotv, iitvinfo, anyfiles, wlacztv, serialnet, bestplayer
#import ipla
 
log = pLog.pLog()
28,14 → 28,16
}
 
VOD_ONLINE_TABLE = {
200: "AnyFiles [różne filmy]",
201: "Ekino TV [filmy, seriale]",
202: "iiTV info [seriale]",
#203: "IPLA",
204: "IPLEX",
205: "TVN Player",
206: "TVP [info]",
207: "TVP VOD",
200: "AnyFiles [różne filmy]",
201: "Ekino TV [filmy, seriale]",
202: "iiTV info [seriale]",
#203: "IPLA",
204: "IPLEX",
205: "TVN Player",
206: "TVP [info]",
207: "TVP VOD",
208: "SerialNet [seriale]",
209: "BestPlayer [filmy]",
}
 
REC_DOWN_TABLE = { 300: "Weeb TV",
50,63 → 52,69
self.parser = Parser.Parser()
 
def showListOptions(self):
params = self.parser.getParams()
mode = self.parser.getIntParam(params, "mode")
name = self.parser.getParam(params, "name")
service = self.parser.getParam(params, 'service')
if mode == None and name == None and service == None:
log.info('Wyświetlam kategorie')
self.CATEGORIES()
elif mode == 1:
self.LIST(TV_ONLINE_TABLE)
elif mode == 100 or service == 'weebtv':
tv = weebtv.WeebTV()
tv.handleService()
params = self.parser.getParams()
mode = self.parser.getIntParam(params, "mode")
name = self.parser.getParam(params, "name")
service = self.parser.getParam(params, 'service')
if mode == None and name == None and service == None:
log.info('Wyświetlam kategorie')
self.CATEGORIES()
elif mode == 1:
self.LIST(TV_ONLINE_TABLE)
elif mode == 100 or service == 'weebtv':
tv = weebtv.WeebTV()
tv.handleService()
elif mode == 101 or service == 'wlacztv':
tv = wlacztv.WlaczTV()
tv.handleService()
elif mode == 102:
tv = stations.StreamStations()
tv.handleService()
elif mode == 2:
#log.info('Wejście do TV internetowej')
self.LIST(VOD_ONLINE_TABLE)
elif mode == 200 or service == 'anyfiles':
vod = anyfiles.AnyFiles()
vod.handleService()
elif mode == 201 or service == 'ekinotv':
vod = ekinotv.EkinoTV()
vod.handleService()
elif mode == 202 or service == 'iitvinfo':
vod = iitvinfo.iiTVInfo()
vod.handleService()
#elif mode == 203 or service == 'ipla':
# vod = ipla.IPLA()
# vod.handleService()
elif mode == 204 or service == 'iplex':
vod = iplex.IPLEX()
vod.handleService()
elif mode == 205 or service == 'tvn':
vod = tvn.tvn()
vod.handleService()
elif mode == 206 or service == 'tvp':
vod = tvp.tvp()
vod.handleService()
elif mode == 207 or service == 'tvpvod':
vod = tvpvod.tvpvod()
vod.handleService()
elif mode == 300:
vod = weebtv.WeebTV()
vod.handleRecords()
elif mode == 301:
tv = wlacztv.WlaczTV()
tv.handleService()
elif mode == 102 or service == 'stations':
tv = stations.StreamStations()
tv.handleService()
elif mode == 2:
#log.info('Wejście do TV internetowej')
self.LIST(VOD_ONLINE_TABLE)
elif mode == 200 or service == 'anyfiles':
vod = anyfiles.AnyFiles()
vod.handleService()
elif mode == 201 or service == 'ekinotv':
vod = ekinotv.EkinoTV()
vod.handleService()
elif mode == 202 or service == 'iitvinfo':
vod = iitvinfo.iiTVInfo()
vod.handleService()
#elif mode == 203 or service == 'ipla':
# vod = ipla.IPLA()
# vod.handleService()
elif mode == 204 or service == 'iplex':
vod = iplex.IPLEX()
vod.handleService()
elif mode == 205 or service == 'tvn':
vod = tvn.tvn()
vod.handleService()
elif mode == 206 or service == 'tvp':
vod = tvp.tvp()
vod.handleService()
elif mode == 207 or service == 'tvpvod':
vod = tvpvod.tvpvod()
vod.handleService()
elif mode == 208 or service == 'serialnet':
vod = serialnet.SerialNet()
vod.handleService()
elif mode == 209 or service == 'bestplayer':
vod = bestplayer.BestPlayer()
vod.handleService()
elif mode == 300:
vod = weebtv.WeebTV()
vod.handleRecords()
elif mode == 301:
vod = wlacztv.WlaczTV()
vod.handleRecords()
elif mode == 19:
log.info('Zarządzanie nagrywaniem/ściąganiem')
self.LIST(REC_DOWN_TABLE)
elif mode == 20:
log.info('Wyświetlam ustawienia')
self.settings.showSettings()
elif mode == 19:
log.info('Zarządzanie nagrywaniem/ściąganiem')
self.LIST(REC_DOWN_TABLE)
elif mode == 20:
log.info('Wyświetlam ustawienia')
self.settings.showSettings()
 
 
def listsMenu(self, table, title):
115,9 → 123,9
d = xbmcgui.Dialog()
choice = d.select(title, table)
for i in range(len(table)):
#log.info(table[i])
if choice == i:
value = table[i]
#log.info(table[i])
if choice == i:
value = table[i]
return value
 
 
128,17 → 136,26
 
 
def CATEGORIES(self):
self.addDir("Telewizja", 1, False, False)
self.addDir("Filmy, Seriale", 2, False, False)
self.addDir('Zarządzanie nagrywaniem/ściąganiem', 19, False, False)
self.addDir('Ustawienia', 20, True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
self.addDir("Telewizja", 1, False, False)
self.addDir("Filmy, Seriale", 2, False, False)
self.addDir('Zarządzanie nagrywaniem/ściąganiem', 19, False, False)
self.addDir('Ustawienia', 20, True, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
 
def LIST(self, table = {}):
for num, val in table.items():
self.addDir(val, num, False, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
valTab = []
strTab = []
for num, val in table.items():
#self.addDir(val, num, False, False)
strTab.append(num)
strTab.append(val)
valTab.append(strTab)
strTab = []
valTab.sort(key = lambda x: x[1])
for i in range(len(valTab)):
self.addDir(valTab[i][1], valTab[i][0], False, False)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
 
 
def addDir(self, name, mode, autoplay, isPlayable = True):
155,3 → 172,4
 
init = PolishLiveTV()
init.showListOptions()
 
/trunk/xbmc-addons/src/addons.xml.md5
1,0 → 0,0
8a2fc3057bad222d7b1ab9260c75ee01
a64aedc0704f31df3995e3ffa1ed7c11
/wiki/CustomUpdate.wiki
21,9 → 21,9
*ipla.py*
* _(source)_ plik znajduje sie tutaj: [http://jatrn.com/xbmc/sd-xbmc/ipla.py],
* _(destination)_ ma byc skopiowany do `hosts/ipla.py`
*stations.py*
* _(source)_ kopiujemy pliki z katalogu wtyczki `plugin.video.polishtv.live/hosts/stations.py` do `c:\sd-xbmc\stations.py`. Z linij 54 i 55 usuwamy hash (#) aby je odkomentowac, zapisujemy plik i zamykamy.
* _(destination)_ ma byc skopiowany do `hosts/stations.py`
~~*stations.py*~~
* ~~_(source)_ kopiujemy pliki z katalogu wtyczki `plugin.video.polishtv.live/hosts/stations.py` do `c:\sd-xbmc\stations.py`. Z linij 54 i 55 usuwamy hash (#) aby je odkomentowac, zapisujemy plik i zamykamy.~~
* ~~_(destination)_ ma byc skopiowany do `hosts/stations.py`~~
*default.py*
* _(source)_ plik znajduje sie tutaj: [http://jatrn.com/xbmc/sd-xbmc/default.py],
* _(destination)_ ma byc skopiowany do `default.py`
40,14 → 40,9
<source>http://jatrn.com/xbmc/sd-xbmc/ipla.py</source>
<destination>hosts/ipla.py</destination>
</file>
<file>
<source>c:\sd-xbmc\stations.py</source>
<destination>hosts/stations.py</destination>
</file>
</custom>
}}}
Tworzymy plik i zapisujemy go w jakiejs dogodnej lokacji, np. `c:\sd-xbmc\custom.xml`. Nastepnie wchodzimy do Ustawien wtyczki, w `Default/Custom Update` w polu `XML file path` wpisujemy lokalizacje naszego wcieszniej stworazonego pliku XML, czyli: `c:\sd-xbmc\custom.xml`
Naciskamy `OK` by zaakceptowac zaminy. Wchodzimy do Ustawien jeszcze raz i naciskamy `Run Custom Update` i to tyle.
 
A tak na koniec. Jesli nie chce wam sie bawic w towrzenie XML czy modyfikacje `stations.py`, a zalezy wam by miec IPLE, to pod adresem [http://jatrn.com/xbmc/sd-xbmc/custom.xml] znajduje sie gotowy XML. Nalezy wpisac ten adres w Ustawieniach wtyczki, nacisnac `OK` i `Run Custom Update` i po sprawie. Powodzenia!
 
A tak na koniec. Jesli nie chce wam sie bawic w towrzenie XML ~~czy modyfikacje `stations.py`~~, a zalezy wam by miec IPLE, to pod adresem [http://jatrn.com/xbmc/sd-xbmc/custom.xml] znajduje sie gotowy XML. Nalezy wpisac ten adres w Ustawieniach wtyczki, nacisnac `OK` i `Run Custom Update` i po sprawie. Powodzenia!
/wiki/InstalacjaPluginuAndroid.wiki
New file
0,0 → 1,29
#summary Instrukcja jak zainstalować XBMC i plugin.video.polishtv.live na Android
 
=Opis i modyfikacje wykonane na Samsung Galaxy Tap 2 z Android 4.0=
Autorem jest *matiszek30@gmail.com*
 
Na początek zaznczamy w ustawieniach bezpieczeństwa żeby można było instalować pliki z innych źródeł. Następnie ściągamy XBMC na Androida, który znajdziemy tutaj [http://depositfiles.com/files/soxkfz662].
Instalujemy go normalnie jak każdą aplikacje i gotowe mamy XBMC na Androidzie.
 
 
==Instalacja wtyczki plugin.video.polishtv.live==
Ściągamy Repozytorium SD-XBMC z działu [http://code.google.com/p/sd-xbmc/downloads/list Downloads], tak jak na komputerach stacjonarnych.
Ściągnięty plik będzie się znajdował w główny katalogu {{{moje pliki/sdcard/}}} w folderze {{{download}}} lub {{{downloads}}}. Potem już podąrzamy za poradnikiem na WIKI jak zainstalowac wtyczke, [http://code.google.com/p/sd-xbmc/wiki/InstalacjaPluginu Instalacja Pluginu].
 
 
==Modyfikacje==
Poniżej zamieszczam poradnik jak wpisać login i hasło na Wlacz TV.
 
Najpierw wchodzimy w {{{moje foldery}}} i w ustawienia gdzie zaznaczamy by pokazywało ukryte pliki. Następnie ściągamy Notepad z Google z opcją edycji plików obojętnie jaki i wchodzimy w niego i dajemy edytuj plik:
 
{{{
sdcard/Android/data/org.xbmc.xbmc/files/xbmc/userdata/addon_data/plugin.video.polishtv.live/settings.xml
}}}
 
Kiedy tam wejdziemy będziemy mieli miedzy innymi:
{{{
<setting value="" id="wlacztv_login"/>
<setting value="" id="wlacztv_pass"/>
}}}
Wpisujemy nazwe uzytkownika i haslo do tych pustych cudzysłowiow i gotowe.
/wiki/WeebTV_TVGuide.wiki
New file
0,0 → 1,77
#summary integracja strumieni weebtv z TVGuide
 
=Opisy i modyfikacje wykonane na TV Guide v1.3.5 + XBMC 11 Eden + WIN XP SP3=
Autorem jest *midcars1@gmail.com*
 
==Instalacja pluginu TV Guide==
W XBMC wchodzimy w _programy => pobierz więcej_ i z listy wybieramy TV Guide.
 
 
==Konfiguracja==
Wchodzimy w _system => wtyczki => włączone wtyczki => wtyczki programów => TV Guide_
 
Klikamy ustaw, jako źródło ustawiamy XMLTV, następnie ściągamy na dysk którąś z wersji EPG:
 
||[http://db.tt/ABX5BUx3]|| wersja na 3 dni + opisy około 5Mb posegregowane tematycznie||
||[http://db.tt/HSRgGwSx3]|| wersja na 3 dni + opisy około 5Mb posegregowane tematycznie dla strefy czasowej UTC||
||[http://jatrn.com/xbmc/epg_weebtv.xml]|| wersja na 48 godzin dla weeb.tv||
||[http://jatrn.com/xbmc/epg_weebtv_CST.xml]|| wersja na 48 godzin dla weeb.tv dla strefy czasowej CST||
||[http://jatrn.com/xbmc/epg_weebtv_EST.xml]|| wersja na 48 godzin dla weeb.tv dla strefy czasowej EST||
||[http://jatrn.com/xbmc/epg.xml]|| wersja na 7 dni dla 160+ kanałów, około 14Mb||
 
W polu plik XMLTV wskazujemy ścieżkę do pliku który ściągnęliśmy.
 
 
==Dodanie loga kanałów do TV Guide==
ściągamy: [http://dl.dropbox.com/u/42558348/weeb.tv/picons.rar]
 
po wypakowaniu podajemy ścieżkę ikonek stacji w _"wyszukaj obrazki kanałów w"_, całość wygląda tak:
[https://lh4.googleusercontent.com/-rccbG6DSxjc/UIvdmFkMVOI/AAAAAAAAA20/Z881nOryGDs/s800/screenshot001.png]
 
==Podlinkowanie kanałów TV Guide z plikami STRM wygenerowanymi przez wtyczke polishtv.live==
We wtyczce w zakladce Weeb.tv wybieramy miejsce do zapisu plików STRM.
[https://lh5.googleusercontent.com/-wq020zzHppI/UKi8bF3gjOI/AAAAAAAAA3g/X6FsNIvI3wM/s800/screenshot003.png]
Odpalamy TV Guide, zaznaczamy np: Polsat wciskamy ENTER => _wybierz plik STRM_.
Następnie ta czynność powtarzamy dla reszty stacji.
 
==Usunięcie powiadomienia "otwieram strumień"==
ściągamy :
[http://jatrn.com/xbmc/wiki/gui.py]
 
Następnie kopiujemy plik do:
||Win XP|| {{{\Dane aplikacji\XBMC\addons\script.tvguide\}}}||
||AppleTV 2|| {{{/private/var/mobile/Library/Preferences/XBMC/addons/script.tvguide/}}}||
 
 
==Poprawne wyświetlanie godziny w TV Guide==
jeśli godzina wyświetla się np.: _1220:20_ zamiast _12:20_, edytujemy plik {{{langinfo.xml}}}, ktory znajduje się w {{{c:\Program Files\XBMC\language\Polish}}}, jest:
{{{
<time symbolAM="" symbolPM="">HH:mm:ss</time>
}}}
zmieniamy na:
{{{
<time symbolAM="" symbolPM="">H:mm:ss</time>
}}}
i godzina wyświetla się normalnie.
 
 
==Automatyczne pobieranie pliku z programem EPG po uruchomieniu komputera==
ściągamy [http://users.ugent.be/~bpuype/cgi-bin/fetch.pl?dl=wget/wget.exe], plik {{{wget.exe}}} wrzucamy do {{{c:\windows}}}, tworzymy plik tekstowy który zawiera:
{{{
cd\
d:
del d:\epgPL.xml
wget http://db.tt/ABX5BUx3
}}}
zapisujemy go jako {{{*.bat}}} i wrzucamy do autostartu. W moim przypadku po każdym uruchomieniu kompa stary plik EPG jest kasowany a na jego miejsce zapisywany jest nowy plik z epg, zapis u mnie następuje na dysku D, potem tylko zmieniamy ścieżkę w TVGuide i zawsze mamy aktualny plik z programem.
 
==Zmiana podświetlenia programu==
U mnie na TV (na PC działa normalnie) podświetlona pozycja w programie zlewa się z reszta, aby to rozwiązać edytujemy plik {{{tvguide-program-grey-focus.png}}}, znajduje się on w:
{{{
\Dane aplikacji\XBMC\addons\script.tvguide\resources\skins\Default\media
}}}
 
Zmieniłem podświetlenie na czerwony wygląda to tak:
[https://lh6.googleusercontent.com/-g6PlKJXNXCQ/UIvuaHT6aiI/AAAAAAAAA3M/xymMdMc_ebc/s800/screenshot002.png]