Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
674 changes: 674 additions & 0 deletions plugin.video.montreal.greek-tv/LICENSE.txt

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions plugin.video.montreal.greek-tv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## plugin.video.montreal.greek-tv

# Montreal Greek TV

A Kodi addon featuring streams from Montreal Greek TV & Radio Stations

Artwork provided by Montreal Greek TV webmaster
26 changes: 26 additions & 0 deletions plugin.video.montreal.greek-tv/addon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-

"""
Montreal Greek TV Add-on
Author: greektimes

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""

import xbmc
from resources.lib.default import index

xbmc.executebuiltin("InhibitScreensaver(true)")
xbmc.executebuiltin("InhibitIdleShutdown(true)")
index()
26 changes: 26 additions & 0 deletions plugin.video.montreal.greek-tv/addon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.montreal.greek-tv" name="Montreal Greek TV" version="5.0.0" provider-name="Greektimes.ca">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.routing" version="0.2.3"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>video audio</provides>
</extension>
<extension point="xbmc.addon.metadata">
<platform>all</platform>
<summary lang="en_GB">Montreal Greek TV addon</summary>
<description lang="en_GB">Montreal Greek TV add-on for Kodi featuring Live TV, Radio and Video on demand streams from Montreal, Quebec, Canada. Montreal Greek Television is broadcasting in-house locally-produced Canadian programming in the Greek language from the Greek Community of Greater Montreal.</description>
<summary lang="el_GR">Πρόσθετο Montreal Greek TV</summary>
<description lang="el_GR">Το πρόσθετο Montreal Greek TV για το σύστημα πολυμέσων Kodi προσφέρει ζωντανή τηλεόραση, ραδιόφωνο και ροές κατ' απαίτηση από το Μόντρεαλ, Κεμπέκ, Καναδά. Η Ελληνική Τηλεόραση του Μόντρεαλ (Montreal Greek TV) εκπέμπει περιεχόμενο τοπικής παραγωγής εις την Ελληνική γλώσσα από την Ελληνική παροικία της ευρύτερης περιοχής του Μόντρεαλ.</description>
<language>en el</language>
<license>GPL-3.0-or-later</license>
<website>http://greektimes.ca</website>
<email>info@greektimes.ca</email>
<source>https://github.com/greektimes/plugin.video.montreal.greek-tv/</source>
<assets>
<icon>icon.png</icon>
<fanart>fanart.jpg</fanart>
</assets>
</extension>
</addon>
Binary file added plugin.video.montreal.greek-tv/fanart.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugin.video.montreal.greek-tv/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions plugin.video.montreal.greek-tv/resources/lib/default.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# -*- coding: utf-8 -*-

import os, routing, sys
import xbmc, xbmcvfs, xbmcgui, xbmcplugin, xbmcaddon
import urllib.request,urllib.parse,urllib.error

addon_id = 'plugin.video.montreal.greek-tv'
Home = xbmcvfs.translatePath(xbmcaddon.Addon().getAddonInfo('path'))
icon = os.path.join(Home, 'icon.png')
fanart = os.path.join(Home, 'fanart.jpg')
tv_icon = os.path.join(Home, "resources", "art", 'montreal_tv.png')
radio_icon = os.path.join(Home, "resources", "art", 'montreal_radio.png')
radio_fanart = os.path.join(Home, "resources", "art", 'montreal_background.jpg')


TV_URL = 'http://live.greektv.ca/hls1/greektv.m3u8'
RADIO_URL = 'http://live.greekradio.ca:8000/live'

def get_params():
param=[]
paramstring=sys.argv[2]
if len(paramstring)>=2:
params=sys.argv[2]
cleanedparams=params.replace('?','')
if (params[len(params)-1]=='/'):
params=params[0:len(params)-2]
pairsofparams=cleanedparams.split('&')
param={}
for i in range(len(pairsofparams)):
splitparams={}
splitparams=pairsofparams[i].split('=')
if (len(splitparams))==2:
param[splitparams[0]]=splitparams[1]

return param


#@plugin.route('/')
def index():
addLink("Montreal Greek TV", TV_URL, 5,tv_icon, fanart)
addLink("Montreal Greek Radio", RADIO_URL, 5,radio_icon, fanart)
xbmcplugin.endOfDirectory(handle=int(sys.argv[1]))

def addLink(name, url, mode, iconimage, fanart, description=''):
u=sys.argv[0]+"?url="+urllib.parse.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.parse.quote_plus(name)+"&description="+str(description)+"&fanart="+urllib.parse.quote_plus(fanart)
ok=True
liz = xbmcgui.ListItem(name)
liz.setArt({"icon":"DefaultFolder.png",'thumb': iconimage})
liz.setProperty('fanart_image', fanart)
liz.setProperty("IsPlayable","true")
if 'plugin://' in url:u=url
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=False)
return ok

def addDir(name, url, iconimage, fanart):
liz = xbmcgui.ListItem(name, offscreen=True)
liz.setArt({'thumb': iconimage, "fanart": fanart})
liz.setInfo(type = "Video", infoLabels = {"Title": name, "Plot": "" } )
liz.setProperty('IsPlayable', 'true')
'''
if url == TV_URL :
url = create_temp_playlist(url)
'''
xbmcplugin.addDirectoryItem(name,url,2,iconimage,fanart, isFolder=False)


#@plugin.route('/play/<path:url>')
def playlinks(url):

liz = xbmcgui.ListItem(path=url,offscreen=True)
liz.setProperty('isFolder', 'false')
if url == RADIO_URL :
if xbmc.Player().isPlayingVideo() == True : xbmc.executebuiltin("Action(Stop)")
liz.setArt({'thumb': radio_icon, "fanart": radio_fanart})
else :
liz.setArt({'thumb': tv_icon, "fanart": radio_fanart})

xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)


def addLink(name, url, mode, iconimage, fanart, description=''):
u=sys.argv[0]+"?url="+urllib.parse.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.parse.quote_plus(name)+"&description="+str(description)+"&fanart="+urllib.parse.quote_plus(fanart)
ok=True
liz = xbmcgui.ListItem(name)
liz.setArt({"icon":"DefaultFolder.png",'thumb': iconimage})
liz.setProperty('fanart_image', fanart)
liz.setProperty("IsPlayable","true")
if 'plugin://' in url:u=url
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=False)
return ok

params=get_params(); url=None; name=None; mode=None; site=None; iconimage=None
try: site=urllib.parse.unquote_plus(params["site"])
except: pass
try: url=urllib.parse.unquote_plus(params["url"])
except: pass
try: name=urllib.parse.unquote_plus(params["name"])
except: pass
try: mode=int(params["mode"])
except: pass
try: iconimage=urllib.parse.unquote_plus(params["iconimage"])
except: pass
try: fanart=urllib.parse.unquote_plus(params["fanart"])
except: pass

if mode==None or url==None or len(url)<1:index()
elif mode==5:playlinks(url)

xbmcplugin.endOfDirectory(int(sys.argv[1]))