Skip to content

Commit

Permalink
v.0.4.7a
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Mar 28, 2024
1 parent 4ca1930 commit 5cba222
Show file tree
Hide file tree
Showing 18 changed files with 329 additions and 257 deletions.
3 changes: 2 additions & 1 deletion addons.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addons>
<addon id="plugin.video.pseudotv.live" version="0.4.7" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.4.7a" name="PseudoTV Live" provider-name="Lunatixz">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="pvr.iptvsimple" version="21.8.0"/>
Expand All @@ -12,6 +12,7 @@
<import addon="resource.images.studios.white" version="0.0.1"/>
<import addon="resource.images.musicgenreicons.text" version="0.0.1"/>
<import addon="resource.images.moviegenreicons.transparent" version="0.0.1"/>
<import addon="resource.images.pseudotv.logos" optional="true" version="0.0.1"/>
<import addon="resource.videos.ratings.mpaa.classic" optional="true" version="0.0.4"/>
<import addon="script.module.pil" optional="true" version="5.1.0"/>
</requires>
Expand Down
2 changes: 1 addition & 1 deletion addons.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1c8aa029338001ada05b19be5c204be1
f62c3c1118053cd3a9373804c58ecd63
3 changes: 2 additions & 1 deletion plugin.video.pseudotv.live/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.video.pseudotv.live" version="0.4.7" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.4.7a" name="PseudoTV Live" provider-name="Lunatixz">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="pvr.iptvsimple" version="21.8.0"/>
Expand All @@ -11,6 +11,7 @@
<import addon="resource.images.studios.white" version="0.0.1"/>
<import addon="resource.images.musicgenreicons.text" version="0.0.1"/>
<import addon="resource.images.moviegenreicons.transparent" version="0.0.1"/>
<import addon="resource.images.pseudotv.logos" optional="true" version="0.0.1"/>
<import addon="resource.videos.ratings.mpaa.classic" optional="true" version="0.0.4"/>
<import addon="script.module.pil" optional="true" version="5.1.0"/>
</requires>
Expand Down
8 changes: 8 additions & 0 deletions plugin.video.pseudotv.live/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
v.0.4.8
-Notice The following steps are required!.
- Open PseudoTV Live settings, under Miscellaneous; Click "Utility Menu" and select "Delete M3U/XMLTV".
- Open Kodi settings, under PVR & Live TV; Click "clear data" and select "All".

-Refactored Announcements & Discoveries for server/client multi-room (W.I.P).
-Refactored HTTP server

v.0.4.7
-Notice The following steps are required!.
- Open PseudoTV Live settings, under Miscellaneous; Click "Utility Menu" and select "Delete M3U/XMLTV".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,11 @@ msgid "Client Mode"
msgstr ""

msgctxt "#30101"
msgid "Remote url"
msgid "Remote Server"
msgstr ""

msgctxt "#30102"
msgid "Network Folder"
msgid "Centralized Folder"
msgstr ""

msgctxt "#30103"
Expand Down Expand Up @@ -533,6 +533,13 @@ msgctxt "#30128"
msgid "Searching for %s logo"
msgstr ""

msgctxt "#30129"
msgid "Start Server Announcement"
msgstr ""

msgctxt "#30130"
msgid "Start Client Pairing"
msgstr ""



Expand Down Expand Up @@ -1193,6 +1200,14 @@ msgctxt "#32161"
msgid "[COLOR=yellow][B]- Create Path[/B][/COLOR]"
msgstr ""

msgctxt "#32162"
msgid "Searching your network for %s Server\nTimeout in %s seconds."
msgstr ""

msgctxt "#32163"
msgid "Announcing %s server!\n[B]%s[/B] on your client instance.\nTimeout in %s seconds, cancel when finished."
msgstr ""


# Help - strings 33000 thru 33999 reserved for common strings used in add-ons

Expand Down Expand Up @@ -1300,6 +1315,10 @@ msgctxt "#33046"
msgid "Display emulated static between broadcasts for a retro experience."
msgstr ""

msgctxt "#33048"
msgid "Select from a list of discovered servers."
msgstr ""

msgctxt "#33049"
msgid "Prefer Kodi Library - Use less accurate runtimes from metadata providers.\nPrefer File Metadata - Parse file for accurate runtimes.\nCan impact system performance! *see readme for details."
msgstr ""
Expand Down Expand Up @@ -1377,7 +1396,7 @@ msgid "Only recommend you change port if a conflict exists."
msgstr ""

msgctxt "#33100"
msgid "Denote this instance of PseudoTV Live as a client.\nRemote Path (Auto-Discover) | Network Folder configure under options 'Centralized file location'."
msgid "Denote this instance of PseudoTV Live as a client.\nRemote Server | Centralized Folder."
msgstr ""

msgctxt "#33104"
Expand Down Expand Up @@ -1424,6 +1443,14 @@ msgctxt "#33121"
msgid "Group TV shows in blocks of x. [0 Disabled, Two Shows Default] (Pagination size influences grouping).\nChanges will propagate slowly over time and are not instantaneous."
msgstr ""

msgctxt "#33129"
msgid "Bonjour Announcement over your local network"
msgstr ""

msgctxt "#33130"
msgid "Detect Bonjour Announcement over your local network"
msgstr ""

msgctxt "#33149"
msgid "Override Low-Power background pausing and performance throttling."
msgstr ""
Expand All @@ -1434,4 +1461,4 @@ msgstr ""

msgctxt "#33159"
msgid "Force a complete rebuild of your Autotune library."
msgstr ""
msgstr ""
7 changes: 4 additions & 3 deletions plugin.video.pseudotv.live/resources/lib/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def getFileList(self, citem, now, start):
cacheResponse = self.fillers.injectBCTs(citem, cacheResponse)
cacheResponse = self.addScheduling(citem, cacheResponse, start)
return sorted(cacheResponse, key=lambda k: k['start'])
else: raise Exception('cacheResponse in-valid!\n%s'%(cacheResponse))
return cacheResponse
except Exception as e: self.log("getFileList, failed! %s"%(e), xbmc.LOGERROR)
return False

Expand Down Expand Up @@ -446,8 +446,9 @@ def is3D(self, item):
def addChannelStation(self, citem):
self.log('addChannelStation, id: %s'%(citem['id']))
if citem['catchup']:
citem['url'] = LIVE_URL.format(addon=ADDON_ID,name=quoteString(citem['name']),chid=quoteString(citem['id']),vid='{catchup-id}',duration='{duration}',start='{Y}-{m}-{d} {H}:{M}:{S}')
citem['catchup-source'] = BROADCAST_URL.format(addon=ADDON_ID,name=quoteString(citem['name']),chid=quoteString(citem['id']),vid='{catchup-id}',duration='{duration}',start='{Y}-{m}-{d} {H}:{M}:{S}')
citem['url'] = LIVE_URL.format(addon=ADDON_ID,name=quoteString(citem['name']),chid=quoteString(citem['id']),vid='{catchup-id}',now='{lutc}',start='{utc}',duration='{duration}',stop='{utcend}')
citem['catchup-source'] = BROADCAST_URL.format(addon=ADDON_ID,name=quoteString(citem['name']),chid=quoteString(citem['id']),vid='{catchup-id}',now='{lutc}',start='{utc}',duration='{duration}',stop='{utcend}')

elif citem['radio']:
citem['url'] = RADIO_URL.format(addon=ADDON_ID,name=quoteString(citem['name']),chid=quoteString(citem['id']),radio=str(citem['radio']),vid='{catchup-id}')
else:
Expand Down
4 changes: 2 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
VOD_URL = 'plugin://{addon}/?mode=vod&title={title}&chid={chid}&vid={vid}.pvr'
TV_URL = 'plugin://{addon}/?mode=tv&name={name}&chid={chid}.pvr'
RADIO_URL = 'plugin://{addon}/?mode=radio&name={name}&chid={chid}&radio={radio}&vid={vid}.pvr'
LIVE_URL = 'plugin://{addon}/?mode=live&name={name}&chid={chid}&vid={vid}&duration={duration}&start={start}.pvr'
BROADCAST_URL = 'plugin://{addon}/?mode=broadcast&name={name}&chid={chid}&vid={vid}&duration={duration}&start={start}.pvr'
LIVE_URL = 'plugin://{addon}/?mode=live&name={name}&chid={chid}&vid={vid}&now={now}&start={start}&duration={duration}&stop={stop}.pvr'
BROADCAST_URL = 'plugin://{addon}/?mode=broadcast&name={name}&chid={chid}&vid={vid}&now={now}&start={start}&duration={duration}&stop={stop}.pvr'

PTVL_REPO = 'repository.pseudotv'
PVR_CLIENT_ID = 'pvr.iptvsimple'
Expand Down
55 changes: 21 additions & 34 deletions plugin.video.pseudotv.live/resources/lib/context_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,35 @@
from globals import *

class Info:
def __init__(self, sysARG, plot):
def __init__(self, sysARG, fitem):
with busy_dialog():
log('Info: __init__, sysARG = %s'%(sysARG))
listitem = LISTITEMS.buildItemListItem(plot)
DIALOG.infoDialog(listitem)
DIALOG.infoDialog(LISTITEMS.buildItemListItem(fitem))

class Browse:
def __init__(self, sysARG, plot):
def __init__(self, sysARG, fitem):
log('Browse: __init__, sysARG = %s'%(sysARG))
with busy_dialog():
target = '%ss'%(plot.get('media','video'))
orgpath = plot.get('originalpath','')
citem = Builder().buildProvisional(plot.get('citem',{}))

if '?xsp=' in orgpath:
path, params = orgpath.split('?xsp=')
path = '%s?xsp=%s'%(path,quoteString(unquoteString(params)))
elif citem.get('provisional',None):
#todo build xsp with path rule.
provisional = citem.get('provisional',{})
path = provisional.get('path',[])
else:
path = citem.get('path','')
media = '%ss'%(fitem.get('media','video'))
path = fitem.get('originalpath',fitem.get('citem',{}).get('path'))
if isinstance(path,list): path = path[0]

log('Browse: target = %s, path = %s'%(target,path))
BUILTIN.executebuiltin('ReplaceWindow(%s,%s)'%(target,path))
if '?xsp=' in path:
path, params = path.split('?xsp=')
path = '%s?xsp=%s'%(path,quoteString(unquoteString(params)))
log('Browse: target = %s, path = %s'%(media,path))
BUILTIN.executebuiltin('ReplaceWindow(%s,%s,return)'%(media,path))

class Match:
SEARCH_SCRIPT = None
GLOBAL_SCRIPT = 'script.globalsearch'
SIMILAR_SCRIPT = 'script.embuary.helper'

def __init__(self, sysARG):
def __init__(self, sysARG, fitem):
with busy_dialog():
title = BUILTIN.getInfoLabel('Title')
name = BUILTIN.getInfoLabel('EpisodeName')
plot = decodePlot(BUILTIN.getInfoLabel('Plot'))
dbtype = plot.get('type').replace('episodes','tvshow').replace('tvshows','tvshow').replace('movies','movie')
dbid = (plot.get('tvshowid') or plot.get('movieid'))
dbtype = fitem.get('type').replace('episodes','tvshow').replace('tvshows','tvshow').replace('movies','movie')
dbid = (fitem.get('tvshowid') or fitem.get('movieid'))
log('Match: __init__, sysARG = %s, title = %s, dbtype = %s, dbid = %s'%(sysARG,'%s - %s'%(title,name),dbtype,dbid))

if hasAddon(self.SIMILAR_SCRIPT,install=True) and dbid:
Expand All @@ -75,7 +64,7 @@ def __init__(self, sysARG):
# plugin://script.embuary.helper/?info=getsimilar&dbid=$INFO[ListItem.DBID]&type=tvshow&tag=HDR
# plugin://script.embuary.helper/?info=getsimilar&dbid=$INFO[ListItem.DBID]&type=movie&tag=HDR
# tag = optional, additional filter option to filter by library tag
BUILTIN.executebuiltin('ReplaceWindow(%s,%s)'%('%ss'%(plot.get('media','video')),'plugin://%s/?info=getsimilar&dbid=%d&type=%s'%(self.SEARCH_SCRIPT,dbid,dbtype)))
BUILTIN.executebuiltin('ReplaceWindow(%s,%s,return)'%('%ss'%(fitem.get('media','video')),'plugin://%s/?info=getsimilar&dbid=%d&type=%s'%(self.SEARCH_SCRIPT,dbid,dbtype)))
else:
# - the addon is executed by another addon/skin: RunScript(script.globalsearch,searchstring=foo)
# You can specify which categories should be searched (this overrides the user preferences set in the addon settings):
Expand All @@ -86,14 +75,12 @@ def __init__(self, sysARG):


if __name__ == '__main__':
try: param = sys.argv[1]
except: param = None
param = sys.argv[1]
fitem = decodePlot(BUILTIN.getInfoLabel('Plot'))
log('Info: __main__, param = %s'%(param))
if param == 'info':
Info(sys.argv,plot=decodePlot(BUILTIN.getInfoLabel('Plot')))
elif param == 'browse':
from builder import Builder
Browse(sys.argv,plot=decodePlot(BUILTIN.getInfoLabel('Plot')))
elif param == 'match':
Match(sys.argv)

if param == 'info': Info(sys.argv,fitem)
elif param == 'browse': Browse(sys.argv,fitem)
elif param == 'match': Match(sys.argv,fitem)


10 changes: 2 additions & 8 deletions plugin.video.pseudotv.live/resources/lib/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@
def run(sysARG):
params = dict(urllib.parse.parse_qsl(sysARG[2][1:].replace('.pvr','')))

mode = (params.get("mode",'') or 'guide')
name = (unquoteString(params.get("name",'')) or None)
title = (unquoteString(params.get("title",'')) or None)
chid = (params.get("chid",'') or None)
url = (params.get("url",'') or None)
vid = decodeString(params.get("vid",'') or None)
start = (params.get("start",'') or None)
duration = (params.get("duration",'') or None)
mode = (params.get("mode",'') or 'guide')
radio = (params.get("radio",'') or 'False').lower() == "true"
log("Default: run, params = %s"%(params))

Expand All @@ -56,7 +53,4 @@ def run(sysARG):
elif mode == 'tv':
threadit(Plugin(sysARG).playTV)(name,chid)

if __name__ == '__main__': run(sys.argv)



if __name__ == '__main__': run(sys.argv)
4 changes: 2 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/fillers.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def injectBCTs(self, citem, fileList):
dur = self.jsonRPC.getDuration(file, accurate=True)
if dur > 0:
self.log('injectBCTs, adding ratings %s\n%s - %s'%(fileItem.get('title'),file,dur))
nfileList.append(self.builder.buildCells(citem,dur,entries=1,info={'title':'%s (%s)'%(fileItem.get('title'),mpaa),'genre':['ratings'],'plot':RATING_DESC.get(mpaa,''),'path':file})[0])
# #pre roll - bumpers
nfileList.append(self.builder.buildCells(citem,dur,entries=1,info={'title':fileItem.get('title'),'genre':['ratings'],'plot':'[B]%s (%s)[/B]\n%s'%(fileItem.get('title'),mpaa,RATING_DESC.get(mpaa,'')),'path':file})[0])
# #pre roll - bumpers
# elif fileItem.get('type').startswith(tuple(TV_TYPES)):
# ...
nfileList.append(fileItem)
Expand Down
7 changes: 4 additions & 3 deletions plugin.video.pseudotv.live/resources/lib/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def isRunning(key):
@contextmanager
def suspendActivity(): #suspend/quit running background task.
while not MONITOR.abortRequested():
if MONITOR.waitForAbort(0.001): break
elif not isPendingSuspend(): break
if not isPendingSuspend(): break
elif MONITOR.waitForAbort(0.001): break
setPendingSuspend(True)
try: yield
finally:
Expand Down Expand Up @@ -492,7 +492,8 @@ def isClient():
def setClient(state=False,silent=True):
PROPERTIES.setEXTProperty('%s.isClient'%(ADDON_ID),str(state).lower())
if not silent and state: DIALOG.notificationWait(LANGUAGE(32115))

return state

def getDiscovery():
return loadJSON(PROPERTIES.getEXTProperty('%s.SERVER_DISCOVERY'%(ADDON_ID)))

Expand Down
Loading

0 comments on commit 5cba222

Please sign in to comment.