# -*- coding: utf-8 -*-
# -------------LicenseHeader--------------
# plugin.video.Mediathek - Gives access to most video-platforms from German public service broadcasters
# Copyright (C) 2010 Raptor 2101 [raptor2101@gmx.de]
#
# 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 .
import re
import datetime
import time
import calendar
from mediathek import *
from xml.dom import minidom
class NDRMediathek(Mediathek):
@classmethod
def name(self):
return "NDR"
def isSearchable(self):
return True
def __init__(self, simpleXbmcGui):
self.gui = simpleXbmcGui
self.rootLink = "http://www.ndr.de"
self.searchLink = self.rootLink+"/suche10.html?search_mediathek=1&"
# Hauptmenue
tmp_menu = []
extractBroadcasts = re.compile("(.*?)")
htmlPage = self.loadPage("http://www.ndr.de/mediathek/sendungen_a-z/index.html").decode('utf-8')
x = 0
for menuNode in extractBroadcasts.finditer(htmlPage):
menuId = menuNode.group(1)
menuItem = menuNode.group(2)
menuLink = self.rootLink+"/mediatheksuche105_broadcast-"+menuId+"_format-video_page-1.html"
tmp_menu.append(TreeNode("0."+str(x), menuItem, menuLink, True))
x = x+1
self.menuTree = [
TreeNode("0", "Sendungen von A-Z", "", False, tmp_menu),
TreeNode("1", "Sendung verpasst?", "sendungverpasst", True),
TreeNode("2","Live","livestream",True),#Livestream ruckelt zu stark :-(
]
def buildPageMenuSendungVerpasst(self, action):
htmlPage = self.loadPage("http://www.ndr.de/mediathek/sendung_verpasst/epg1490_display-onlyvideo.html")
regex_verpasstNow = re.compile(
'