Skip to content

Commit

Permalink
Add support for Pasch-TV and Netzprediger, closing issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
phoerious committed Oct 10, 2013
1 parent 98ed759 commit 559cfca
Show file tree
Hide file tree
Showing 9 changed files with 208 additions and 6 deletions.
2 changes: 1 addition & 1 deletion 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.massengeschmack" name="Massengeschmack" version="0.1.1" provider-name="Manko10">
<addon id="plugin.video.massengeschmack" name="Massengeschmack" version="0.2.0" provider-name="Manko10">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
</requires>
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.2.0
- Add support for Pasch-TV
- Add support for Netzprediger

0.1.1
- Fix date parsing issue occurring on some platforms

Expand Down
10 changes: 10 additions & 0 deletions resources/language/English/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
<string id="30232">Germany</string>
<string id="30233">Massengeschmack-TV is the satirical answer to all the scripted reality shows on the major TV networks. Obviously inspired by “The Office” and “Stromberg”, the series depicts the daily routine at the Alsterfilm studio.[CR][CR]Additionally to the comedy series, certain videos and uncategorized extras about the Massengeschmack network are published under the label “Massengeschmack-TV“, too.</string>

<string id="30240">Pasch-TV</string>
<string id="30241">Let's Play, Board Game</string>
<string id="30242">Germany</string>
<string id="30243">Pasch-TV is a magazine in which Holger and guests try one new board game release each episode.</string>

<string id="30250">Netzprediger</string>
<string id="30251">Internet, Media</string>
<string id="30252">Germany</string>
<string id="30253">Netzprediger is an online magazine about the Internet with all its bright and dark sides: fun, fraud, absurdities and much more, uncovered by moderator Nils Beckmann.</string>

<!-- Listings (general) -->
<string id="30300">All</string>
<string id="30301">Episodes</string>
Expand Down
10 changes: 10 additions & 0 deletions resources/language/German/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
<string id="30232">Deutschland</string>
<string id="30233">Massengeschmack-TV ist die satirische Antwort auf all die Scripted-Reality-Formate der großen Fernsehsender. Offensichtlich inspiriert von „The Office“ und „Stromberg“, stellt die Serie den Alltag im Alsterfilm-Studio dar.[CR][CR]Zusätzlich zum Comedy-Format werden diverse Videos und unkategorisierte Extras zum Massengeschmack-Portal ebenfalls unter dem Label „Massengeschmack-TV“ veröffentlicht.</string>

<string id="30240">Pasch-TV</string>
<string id="30241">Let's Play, Brettspiele</string>
<string id="30242">Deutschland</string>
<string id="30243">Pasch-TV ist ein Magazin, in dem Holger zusammen mit Gästen pro Folge eine Brettspiel-Neuerscheinung ausprobiert.</string>

<string id="30250">Netzprediger</string>
<string id="30251">Internet, Medien</string>
<string id="30252">Deutschland</string>
<string id="30253">Netzprediger ist ein Online-Magazin über das Internet mit all seinen hellen und dunklen Seiten: Spaß, Betrug und Absurditäten, aufgedeckt von Moderator Nils Beckmann.</string>

<!-- Listings (general) -->
<string id="30300">Alle</string>
<string id="30301">Folgen</string>
Expand Down
188 changes: 183 additions & 5 deletions resources/lib/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,24 @@ def getListItems(self):
ADDON_BASE_PATH + '/resources/media/fanart-' + MGTVDataSource.module + '.jpg',
MGTVDataSource.showMetaData
),
# Pasch-TV
ListItem(
PaschTVDataSource.id,
ADDON.getLocalizedString(30240),
resources.lib.assembleListURL(PaschTVDataSource.module),
ADDON_BASE_PATH + '/resources/media/banner-' + PaschTVDataSource.module + '.png',
ADDON_BASE_PATH + '/resources/media/fanart-' + PaschTVDataSource.module + '.jpg',
PaschTVDataSource.showMetaData
),
# Netzprediger
ListItem(
NetzpredigerDataSource.id,
ADDON.getLocalizedString(30250),
resources.lib.assembleListURL(NetzpredigerDataSource.module),
ADDON_BASE_PATH + '/resources/media/banner-' + NetzpredigerDataSource.module + '.png',
ADDON_BASE_PATH + '/resources/media/fanart-' + NetzpredigerDataSource.module + '.jpg',
NetzpredigerDataSource.showMetaData
),
]

def getContentMode(self):
Expand Down Expand Up @@ -204,7 +222,7 @@ def getListItems(self):
i['title'],
resources.lib.assemblePlayURL(i['url'], i['title'], iconimage, metaData, streamInfo),
iconimage,
ADDON_BASE_PATH + '/resources/media/fanart-fktv.jpg',
ADDON_BASE_PATH + '/resources/media/fanart-' + self.module + '.jpg',
metaData,
streamInfo,
False
Expand Down Expand Up @@ -375,7 +393,7 @@ def getListItems(self):
i['title'],
resources.lib.assemblePlayURL(i['url'], i['title'], iconimage, metaData, streamInfo),
iconimage,
ADDON_BASE_PATH + '/resources/media/fanart-ptv.jpg',
ADDON_BASE_PATH + '/resources/media/fanart-' + self.module + '.jpg',
metaData,
streamInfo,
False
Expand Down Expand Up @@ -461,7 +479,7 @@ def getListItems(self):
i['title'],
resources.lib.assemblePlayURL(i['url'], i['title'], iconimage, metaData, streamInfo),
iconimage,
ADDON_BASE_PATH + '/resources/media/fanart-ps.jpg',
ADDON_BASE_PATH + '/resources/media/fanart-' + self.module + '.jpg',
metaData,
streamInfo,
False
Expand Down Expand Up @@ -554,7 +572,7 @@ def getListItems(self):
i['title'],
resources.lib.assemblePlayURL(i['url'], i['title'], iconimage, metaData, streamInfo),
iconimage,
ADDON_BASE_PATH + '/resources/media/fanart-mgtv.jpg',
ADDON_BASE_PATH + '/resources/media/fanart-' + self.module + '.jpg',
metaData,
streamInfo,
False
Expand Down Expand Up @@ -615,14 +633,170 @@ def __getBaseList(self):
)
]

class PaschTVDataSource(DataSource):
id = 4
module = 'paschtv'
showMetaData = {
'Title' : ADDON.getLocalizedString(30240),
'Director' :'Holger Kreymeier,',
'Genre' : ADDON.getLocalizedString(30241),
'Premiered':'10.10.2013',
'Country' : ADDON.getLocalizedString(30242),
'Plot' : ADDON.getLocalizedString(30243)
}

def __init__(self):
self.__urls = {
'hd' : {
'all' : DataSource._buildFeedURL(self, [1], 'hd'),
},
'mobile' : {
'all' : DataSource._buildFeedURL(self, [1], 'mobile'),
},
'audio' : {
'all' : DataSource._buildFeedURL(self, [1], 'audio'),
}
}

def getListItems(self):
audioOnly = ADDON.getSetting('content.audioOnly')

quality = None
if 'true' == audioOnly:
quality = 'audio'
else:
if 0 == int(ADDON.getSetting('content.quality')):
quality = 'hd'
else:
quality = 'mobile'

data = resources.lib.parseRSSFeed(self.__urls[quality]['all'], True)
listItems = []

for i in data:
iconimage = self.__getThumbnailURL(i['guid'])
date = resources.lib.parseUTCDateString(i['pubdate']).strftime('%d.%m.%Y')
metaData = {
'Title' : i['title'],
'Genre' : ADDON.getLocalizedString(30241),
'Date' : date,
'Premiered' : date,
'Country' : ADDON.getLocalizedString(30242),
'Plot' : i['description'],
'Duration' : int(i['duration']) / 60
}
streamInfo = {
'duration' : i['duration']
}

listItems.append(
ListItem(
self.id,
i['title'],
resources.lib.assemblePlayURL(i['url'], i['title'], iconimage, metaData, streamInfo),
iconimage,
ADDON_BASE_PATH + '/resources/media/fanart-' + self.module + '.jpg',
metaData,
streamInfo,
False
)
)

return listItems

def getContentMode(self):
return 'episodes'

def __getThumbnailURL(self, guid):
return 'http://massengeschmack.tv/img/mag/' + guid + '.jpg'

class NetzpredigerDataSource(DataSource):
id = 5
module = 'netzprediger'
showMetaData = {
'Title' : ADDON.getLocalizedString(30250),
'Director' :'Holger Kreymeier,',
'Genre' : ADDON.getLocalizedString(30251),
'Premiered':'10.10.2013',
'Country' : ADDON.getLocalizedString(30252),
'Plot' : ADDON.getLocalizedString(30253)
}

def __init__(self):
self.__urls = {
'hd' : {
'all' : DataSource._buildFeedURL(self, [1], 'hd'),
},
'mobile' : {
'all' : DataSource._buildFeedURL(self, [1], 'mobile'),
},
'audio' : {
'all' : DataSource._buildFeedURL(self, [1], 'audio'),
}
}

def getListItems(self):
audioOnly = ADDON.getSetting('content.audioOnly')

quality = None
if 'true' == audioOnly:
quality = 'audio'
else:
if 0 == int(ADDON.getSetting('content.quality')):
quality = 'hd'
else:
quality = 'mobile'

data = resources.lib.parseRSSFeed(self.__urls[quality]['all'], True)
listItems = []

for i in data:
iconimage = self.__getThumbnailURL(i['guid'])
date = resources.lib.parseUTCDateString(i['pubdate']).strftime('%d.%m.%Y')
metaData = {
'Title' : i['title'],
'Genre' : ADDON.getLocalizedString(30251),
'Date' : date,
'Premiered' : date,
'Country' : ADDON.getLocalizedString(30252),
'Plot' : i['description'],
'Duration' : int(i['duration']) / 60
}
streamInfo = {
'duration' : i['duration']
}

listItems.append(
ListItem(
self.id,
i['title'],
resources.lib.assemblePlayURL(i['url'], i['title'], iconimage, metaData, streamInfo),
iconimage,
ADDON_BASE_PATH + '/resources/media/fanart-' + self.module + '.jpg',
metaData,
streamInfo,
False
)
)

return listItems

def getContentMode(self):
return 'episodes'

def __getThumbnailURL(self, guid):
name = guid[:12]
episode = guid[13:]
return 'http://massengeschmack.tv/img/mag/' + name + episode + '.jpg'


def createDataSource(module=''):
"""
Create a data source object based on the magazine name.
If left empty, an overview data source will be generated.
@type module: str
@keyword module: the magazine name (fktv, ptv, ps, mgtv, ...)
@keyword module: the magazine name (fktv, ptv, ps, mgtv, paschtv, netzprediger)
@return: DataSource instance
"""
if 'fktv' == module:
Expand All @@ -633,5 +807,9 @@ def createDataSource(module=''):
return PSDataSource()
elif 'mgtv' == module:
return MGTVDataSource()
elif 'paschtv' == module:
return PaschTVDataSource()
elif 'netzprediger' == module:
return NetzpredigerDataSource()
else:
return DataSource()
Binary file added resources/media/banner-netzprediger.png
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 resources/media/banner-paschtv.png
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 resources/media/fanart-netzprediger.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 resources/media/fanart-paschtv.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 559cfca

Please sign in to comment.