Exemple #1
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)

        self.guid = "A6FF1534-42F3-11DD-8F18-08F555D89593"
        self.mainListUri = "http://www.myvideo.nl/"
        self.baseUrl = "http://www.myvideo.nl"
        self.icon = "myvideoicon.png"
        self.iconLarge = "myvideolarge.png"
        self.noImage = "myvideoimage.png"
        self.channelName = "MyVideo.nl"
        self.channelDescription = "Videos van Myvideo.nl"
        self.moduleName = "chn_myvideo.py"
        self.maxXotVersion = "3.2.0"

        #self.backgroundImage = ""
        #self.backgroundImage16x9 = ""
        self.requiresLogon = False

        self.contextMenuItems = []
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Download Item",
                                        "CtMnDownloadItem",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using Mplayer",
                                        "CtMnPlayMplayer",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using DVDPlayer",
                                        "CtMnPlayDVDPlayer",
                                        itemTypes="video",
                                        completeStatus=True))

        self.episodeItemRegex = "<a class='nArrow' href='([^']+)' title='[^']*'>([^<]+)</a>"
        self.videoItemRegex = "<img id='([^']+)' src='([^']+)' class='vThumb' alt='[^']*'/></a></div></div><div class='sCenter vTitle'><span class='title'><a[^>]+title='([^']+)'"
        self.folderItemRegex = ''
        self.mediaUrlRegex = '<item>\W*<file>\W*([^>]*)\W*</file>\W*<bandwidth>(\d+)</bandwidth>'
        """ 
            The ProcessPageNavigation method will parse the current data using the pageNavigationRegex. It will
            create a pageItem using the CreatePageItem method. If no CreatePageItem method is in the channel,
            a default one will be created with the number present in the resultset location specified in the 
            pageNavigationRegexIndex and the url from the combined resultset. If that url does not contain http://
            the self.baseUrl will be added. 
        """
        # remove the &amp; from the url
        self.pageNavigationRegex = "<a class='pView pnNumbers'  href='([^?]+\?lpage=)(\d+)([^']+)"
        self.pageNavigationRegexIndex = 1

        #==========================================================================
        # non standard items
        self.categoryName = ""

        return True
Exemple #2
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)
        self.guid = "3ac3d6d0-5b2a-11dd-ae16-0800200c9a66"
        self.icon = "southparkicon.png"
        self.iconLarge = "southparklarge.png"
        self.noImage = "southparkimage.png"
        self.channelName = "Southpark"
        self.maxXotVersion = "3.2.0"
        self.channelDescription = "Southpark Epsides."
        self.moduleName = "chn_southpark.py"
        self.mainListUri = "http://www.southparkstudios.com/"
        self.baseUrl = "http://www.southparkstudios.com/"
        self.onUpDownUpdateEnabled = True
        
        self.contextMenuItems = []
#        self.contextMenuItems.append(contextmenu.ContextMenuItem("Update Item", "CtMnUpdateItem", itemTypes="video", completeStatus=None))            
        self.contextMenuItems.append(contextmenu.ContextMenuItem("Initialise", "CtMnInit", itemTypes="video", completeStatus=True))
        self.contextMenuItems.append(contextmenu.ContextMenuItem("Play using Mplayer", "CtMnPlayMplayer", itemTypes="video", completeStatus=True))
        self.contextMenuItems.append(contextmenu.ContextMenuItem("Play using DVDPlayer", "CtMnPlayDVDPlayer", itemTypes="video", completeStatus=True))
                
        self.requiresLogon = False
        
        self.episodeItemRegex = '<li><a href="(/guide/season/[^"]+)">(\d+)</a></li>' # used for the ParseMainList
        self.videoItemRegex = '<div class="image">\W+<a href="([^"]+)"><img src="([^"]+)" alt="[^"]+" /></a>\W+</div>\W[^:]+<span class="epnumber">Episode: \d(\d+)</span>\W+<span[^>]+>([^<]+)</span>\W+<span class="epdate">([^<]+)</span>\W+<span class="epdesc">([^/]+)</span>\W+</a>\W+<div class="more">\W+<a href="/episodes/(\d+)/"'   # used for the CreateVideoItem 
#        self.folderItemRegex = '<a href="\.([^"]*/)(cat/)(\d+)"( style="color:\s*white;"\s*)*>([^>]+)</a><br'  # used for the CreateFolderItem
        self.mediaUrlRegex = '<param name="src" value="([^"]+)" />'    # used for the UpdateVideoItem
        return True
Exemple #3
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)

        self.guid = "9B43CA5A-42F3-11DD-9D91-B6F355D89593"
        self.icon = "lamasicon.png"
        self.iconLarge = "lamasiconlarge.png"
        self.noImage = "lamasimage.png"
        self.channelName = "De Lama's"
        self.channelDescription = "Al de clips en bonus materiaal van De Lama's site"
        self.moduleName = "chn_lamas.py"
        self.maxXotVersion = "3.2.0"
        self.sortOrder = 255

        self.mainListUri = "http://www.delamas.nl"
        self.baseUrl = "http://www.bnn.nl/players/MDPlayerCore/public/xml/"
        self.onUpDownUpdateEnabled = False

        self.contextMenuItems = []
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Update Item",
                                        "CtMnUpdateItem",
                                        itemTypes="video",
                                        completeStatus=False))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Download Item",
                                        "CtMnDownloadItem",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using Mplayer",
                                        "CtMnPlayMplayer",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using DVDPlayer",
                                        "CtMnPlayDVDPlayer",
                                        itemTypes="video",
                                        completeStatus=True))

        self.requiresLogon = False

        self.episodeItemRegex = ''  # used for the ParseMainList
        self.videoItemRegex = '<item>\W+<id>([^<]+)</id>\W+<title>([^<]+)</title>\W+<description>([^<]+)</description>\W+<play_count>[^<]+</play_count>\W+<rate_avg>[^<]+</rate_avg>\W+<rate_count>[^<]+</rate_count>\W+<thumbnail>([^<]+)</thumbnail>'  # used for the CreateVideoItem
        self.folderItemRegex = ''  # used for the CreateFolderItem
        self.mediaUrlRegex = '<source>([^<]+)</source>'  # used for the UpdateVideoItem

        #==========================================================================
        # non standard items
        self.topDescription = ""

        return True
Exemple #4
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)

        self.guid = "320E8790-42F4-11DD-9B2E-660356D89593"
        self.icon = "jooxthumb.png"
        self.iconLarge = "jooxlarge.png"
        self.noImage = "jooximage.png"
        self.channelName = "Joox.Net"
        self.channelDescription = "Archive containing a large number of online Divx clips from Stage6."
        self.moduleName = "chn_joox.py"
        self.maxXotVersion = "3.0.0"

        self.mainListUri = "http://www.joox.net"
        self.baseUrl = "http://www.joox.net"
        self.onUpDownUpdateEnabled = False

        self.contextMenuItems = []
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Update Item",
                                        "CtMnUpdateItem",
                                        itemTypes="video",
                                        completeStatus=None))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Download Item",
                                        "CtMnDownloadItem",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using Mplayer",
                                        "CtMnPlayMplayer",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using DVDPlayer",
                                        "CtMnPlayDVDPlayer",
                                        itemTypes="video",
                                        completeStatus=True))

        self.requiresLogon = False

        self.episodeItemRegex = '<a href="\.([^"]+)">([^>]+)</a><br />'  # used for the ParseMainList
        self.videoItemRegex = '<a href="\.([^"]*/)(id/)(\d+)"( style="color:\s*white;"\s*)*>([^>]+)</a><br'  # used for the CreateVideoItem
        self.folderItemRegex = '<a href="\.([^"]*/)(cat/)(\d+)"( style="color:\s*white;"\s*)*>([^>]+)</a><br'  # used for the CreateFolderItem
        # decrepated. Using url based on ID now
        #self.mediaUrlRegex = '<param name="src" value="([^"]+)" />'    # used for the UpdateVideoItem

        #==========================================================================
        # non standard items
        self.topDescription = ""

        return True
Exemple #5
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)

        self.guid = "80726A74-42F3-11DD-BBA6-A1F055D89593"
        self.icon = "dumperticon.png"
        self.iconLarge = "dumperticonlarge.png"
        self.noImage = "dumpertimage.png"
        self.backgroundImage = ""  # if not specified, the one defined in the skin is used
        self.backgroundImage16x9 = ""  # if not specified, the one defined in the skin is used
        self.channelName = "Dumpert.nl"
        self.channelDescription = "Fimpjes van Dumpert.nl"
        self.moduleName = "chn_dumpert.py"
        self.maxXotVersion = "3.2.0"
        self.sortOrder = 255  #max 255 channels
        self.buttonID = 0
        self.onUpDownUpdateEnabled = True

        self.mainListUri = "http://www.dumpert.nl/filmpjes/%s/"
        self.baseUrl = "http://www.dumpert.nl/mediabase/flv/%s_YTDL_1.flv.flv"
        self.playerUrl = ""

        self.contextMenuItems = []
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Download Item",
                                        "CtMnDownloadItem",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using Mplayer",
                                        "CtMnPlayMplayer",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using DVDPlayer",
                                        "CtMnPlayDVDPlayer",
                                        itemTypes="video",
                                        completeStatus=True))

        self.requiresLogon = False

        self.asxAsfRegex = '<[^\s]*REF href[^"]+"([^"]+)"'  # default regex for parsing ASX/ASF files
        self.episodeSort = True
        self.videoItemRegex = '<a class="item" href="([^"]+)"[^=]+="([^"]+)" alt="([^"]+)[^:]+<div class="date">([^<]+)'
        self.folderItemRegex = ''  # used for the CreateFolderItem

        # Changed on 2008-04-23 self.mediaUrlRegex = "'(http://www.dumpert.nl/mediabase/flv/[^']+)'"    # used for the UpdateVideoItem
        self.mediaUrlRegex = ("addVariable\('file','(http://[^']+)'\);",
                              "var flashurl = '([^']+)'"
                              )  # used for the UpdateVideoItem

        return True
Exemple #6
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)
        
        self.guid = "06DB83A2-42F4-11DD-AAC1-CEFD55D89593"
        self.mainListUri = "http://svt.se/svt/road/Classic/shared/mediacenter/navigation.jsp?d=37591&frameset=true"
        self.baseUrl = "http://svt.se/svt/road/Classic/shared/mediacenter/"
        self.icon = "svticon.png"
        self.iconLarge = "svtlarge.png"
        self.noImage = "svtimage.png"
        self.channelName = "Sveriges Television"
        self.channelDescription = u'Sända från SVT'
        self.moduleName = "chn_svt.py"
        self.maxXotVersion = "3.2.0"
        
        #self.backgroundImage = ""
        #self.backgroundImage16x9 = ""
        self.requiresLogon = False
        
        self.contextMenuItems = []
        self.contextMenuItems.append(contextmenu.ContextMenuItem("Download Item", "CtMnDownloadItem", itemTypes="video", completeStatus=True))
        self.contextMenuItems.append(contextmenu.ContextMenuItem("Play using Mplayer", "CtMnPlayMplayer", itemTypes="video", completeStatus=True))
        self.contextMenuItems.append(contextmenu.ContextMenuItem("Play using DVDPlayer", "CtMnPlayDVDPlayer", itemTypes="video", completeStatus=True))
        
        
        self.episodeItemRegex = '<div class="enddep"><a[^>]+href="([^"]+)"[^>]*>([^<]+)</a>\W*</div>'
        self.videoItemRegex = '(<td class="image"><img src="([^"]+)" [^>]+>\W*</td>\W*<td [^>]+>)*<div class="video"><a [^>]+ href="([^"]+)" [^>]+>([^<]+)</a>'
        self.folderItemRegex = '<div class="enddep"><a[^>]+href="([^"]+)"[^>]*>([^<]+)</a>\W*</div>'
        self.mediaUrlRegex = '<item>\W*<file>\W*([^>]*)\W*</file>\W*<bandwidth>(\d+)</bandwidth>'
        
        """ 
            The ProcessPageNavigation method will parse the current data using the pageNavigationRegex. It will
            create a pageItem using the CreatePageItem method. If no CreatePageItem method is in the channel,
            a default one will be created with the number present in the resultset location specified in the 
            pageNavigationRegexIndex and the url from the combined resultset. If that url does not contain http://
            the self.baseUrl will be added. 
        """
        # remove the &amp; from the url
        self.pageNavigationRegex = "<a class='pView pnNumbers'  href='([^?]+\?lpage=)(\d+)([^']+)"  
        self.pageNavigationRegexIndex = 1

        #========================================================================== 
        # non standard items
        self.categoryName = ""
        
        return True
Exemple #7
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)

        self.guid = "15D92364-42F4-11DD-AF9B-7BFF55D89593"
        self.mainListUri = "http://www.rtl.nl/(vm=/service/miMedia/rtl_gemist.xml/)/system/video/menu/videomenu.xml"
        self.baseUrl = "http://www.rtl.nl"
        self.icon = "rtlthumb.png"
        self.iconLarge = "rtllarge.png"
        self.noImage = "rtlimage.png"
        self.channelName = "RTL 4,5&7"
        self.channelDescription = "Uitzendingen van de zenders RTL 4,5,7 & 8."
        self.moduleName = "chn_rtl.py"
        self.maxXotVersion = "3.2.0"

        self.backgroundImage = "background-rtl.png"
        self.backgroundImage16x9 = "background-rtl-16x9.png"
        self.requiresLogon = False
        self.sortOrder = 5

        self.episodeItemRegex = '<li class="folder" rel="([^"]+)videomenu.xml">([^<]+)</li>'
        self.videoItemRegex = '<li class="video" (thumb="([^"]+)" ){0,1}(thumb_id="([^"]+)" )(ctime="([^"]+)" ){0,1}rel="([^"]*/)([^"]+)" (link="([^"]+)"){0,1}>([^<]+)</li>'
        self.folderItemRegex = '<li class="folder" rel="([^"]*/)([^"]+)">([^<]+)</li>'
        self.mediaUrlRegex = "file:'([^']+_)(\d+)(K[^']+.wmv)'"

        self.contextMenuItems = []
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play lowest bitrate stream",
                                        "CtMnPlayLow",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play highest bitrate stream",
                                        "CtMnPlayHigh",
                                        itemTypes="video",
                                        completeStatus=True))

        #==============================================================================
        # non standard items
        self.PreProcessRegex = '<ul title="([^"]*)" rel="([^"]*)videomenu.xml"'
        self.progTitle = ""
        self.videoMenu = ""
        #self.parseWvx = True

        return True
Exemple #8
0
    def __init__(self, channelInfo):
        """Initialisation of the class.

        Arguments:
        channelInfo: ChannelInfo - The channel info object to base this channel on.

        All class variables should be instantiated here and this method should not
        be overridden by any derived classes.

        """

        chn_class.Channel.__init__(self, channelInfo)

        # ============== Actual channel setup STARTS here and should be overwritten from derived classes ===============
        self.noImage = "hardwareinfoimage.png"

        # set context menu items
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Download Item",
                                        "CtMnDownload",
                                        itemTypes="video"))

        # configure login stuff
        self.passWord = ""
        self.userName = ""
        self.logonUrl = ""
        self.requiresLogon = False

        # setup the urls
        # self.mainListUri = "https://www.youtube.com/feeds/videos.xml?user=hardwareinfovideo"
        self.mainListUri = "http://nl.hardware.info/tv/rss-private/streaming"
        self.baseUrl = "http://www.youtube.com"

        # setup the main parsing data
        # self.episodeItemRegex = '<name>([^-]+) - (\d+)-(\d+)-(\d+)[^<]*</name>'
        # self._AddDataParser(self.mainListUri, preprocessor=self.AddEpisodePaging,
        #                     parser=self.episodeItemRegex, creator=self.CreateEpisodeItem)

        self.videoItemRegex = '<(?:entry|item)>([\w\W]+?)</(?:entry|item)>'
        self._AddDataParser("http://nl.hardware.info/tv/rss-private/streaming",
                            parser=self.videoItemRegex,
                            creator=self.CreateVideoItemHwInfo,
                            updater=self.UpdateVideoItem)
        self._AddDataParser("*",
                            parser=self.videoItemRegex,
                            creator=self.CreateVideoItem,
                            updater=self.UpdateVideoItem)

        self.pageNavigationIndicationRegex = '<page>(\d+)</page>'
        self.pageNavigationRegex = '<page>(\d+)</page>'
        self.pageNavigationRegexIndex = 0
        self._AddDataParser("*",
                            parser=self.pageNavigationRegex,
                            creator=self.CreatePageItem)

        #===============================================================================================================
        # non standard items

        # ====================================== Actual channel setup STOPS here =======================================
        return
Exemple #9
0
    def onActionFromContextMenu(self):
        """ NOT USER EDITABLE
            Using of the ContextMenu. 
        """
        try:
            position = self.getCurrentListPosition()
            item = self.listItems[position]
            contextMenuItems = []

            if item.type == 'folder':
                contextMenuItems.append(
                    contextmenu.ContextMenuItem("Add to favorites",
                                                "CtMnAddToFavorites"))
            elif item.type == 'video':
                pass
            else:
                return None

            logFile.debug(self.contextMenuItems)

            for menuItem in self.contextMenuItems:
                logFile.debug("%s (%s), %s %s", menuItem.label,
                              menuItem.functionName, menuItem.itemTypes,
                              menuItem.completeStatus)
                if menuItem.itemTypes == None or menuItem.itemTypes == item.type:
                    if menuItem.completeStatus == None or menuItem.completeStatus == item.complete:
                        contextMenuItems.append(menuItem)

            if len(contextMenuItems) == 0:
                return None

            # build menuitems
            contextMenu = contextmenu.GUI(config.contextMenuSkin,
                                          config.rootDir,
                                          config.skinFolder,
                                          parent=self.getFocus(),
                                          menuItems=contextMenuItems)
            selectedItem = contextMenu.selectedItem
            del contextMenu

            # handle function from items
            if (selectedItem is not None):
                selectedMenuItem = contextMenuItems[selectedItem]
                functionString = "self.%s(%s)" % (
                    selectedMenuItem.functionName, position)
                logFile.debug("Calling %s", functionString)
                try:
                    exec(functionString)
                except:
                    logFile.error(
                        "onActionFromContextMenu :: Cannot execute '%s'.",
                        functionString,
                        exc_info=True)

            return None
        except:
            logFile.error(
                "onActionFromContextMenu :: Error on contextmenu action",
                exc_info=True)
            return None
Exemple #10
0
    def __init__(self, channelInfo):
        """Initialisation of the class.

        Arguments:
        channelInfo: ChannelInfo - The channel info object to base this channel on.

        All class variables should be instantiated here and this method should not
        be overridden by any derived classes.

        """

        chn_class.Channel.__init__(self, channelInfo)

        # ============== Actual channel setup STARTS here and should be overwritten from derived classes ===============
        self.noImage = "amtimage.png"

        # set context menu items
        self.contextMenuItems.append(contextmenu.ContextMenuItem("Download Item", "CtMnDownloadItem", itemTypes="video"))

        # setup the urls
        self.baseUrl = "http://trailers.apple.com"
        self.mainListUri = "http://trailers.apple.com/trailers/home/feeds/just_added.json"
        # self.mainListUri = "http://trailers.apple.com/ca/home/feeds/most_pop.json"

        # setup the main parsing data
        self._AddDataParser(self.mainListUri, parser=(), json=True, creator=self.CreateEpisodeItem)
        self._AddDataParser("*", json=True, preprocessor=self.GetMovieId,
                            parser=("clips", ), creator=self.CreateVideoItem)

        # ====================================== Actual channel setup STOPS here =======================================
        return
Exemple #11
0
    def __init__(self, channelInfo):
        """Initialisation of the class.

        Arguments:
        channelInfo: ChannelInfo - The channel info object to base this channel on.

        All class variables should be instantiated here and this method should not
        be overridden by any derived classes.

        """

        chn_class.Channel.__init__(self, channelInfo)

        # ============== Actual channel setup STARTS here and should be overwritten from derived classes ===============
        self.noImage = "extremeimage.png"

        # set context menu items
        self.contextMenuItems.append(contextmenu.ContextMenuItem("Download item", "CtMnDownloadItem", itemTypes="video"))

        # setup the urls
        self.mainListUri = "http://extreme.com/"
        self.baseUrl = "http://extreme.com"

        # setup the main parsing data
        self.episodeItemRegex = '<li><a href="([^"]+)" title=[^>]*>([^<]+)</a></li>'
        self.videoItemRegex = '<img src="(?P<thumburl>[^"]+)"[^>]*alt="([^"]+)" /></a>[\w\W]{0,200}<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^"]+)</a></p><p class="description">(?P<description>[^"]+)</p>'
        self.mediaUrlRegex = 'fo.addVariable\("id", "([^"]+)"\)'
        self.pageNavigationRegex = '<a[^>]*href="(/[^"]+page=)(\d+)">\d+</a>'
        self.pageNavigationRegexIndex = 1

        # ====================================== Actual channel setup STOPS here =======================================
        return
Exemple #12
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)

        self.guid = "01EE94CE-42F4-11DD-89C3-51FD55D89593"
        self.icon = "veronicaicon.png"
        self.iconLarge = "veronicalarge.png"
        self.noImage = "veronicaimage.png"
        self.channelName = "Veronica"
        self.channelDescription = "Uitzendingen op www.veronicatv.nl"
        self.moduleName = "chn_veronica.py"
        self.sortOrder = 8
        self.maxXotVersion = "3.2.0"

        self.mainListUri = "http://www.veronicatv.nl/web/show/id=96520/langid=43"
        self.baseUrl = "http://www.veronicatv.nl"
        self.onUpDownUpdateEnabled = True

        self.contextMenuItems = []
        #        self.contextMenuItems.append(contextmenu.ContextMenuItem("Update Item", "CtMnUpdateItem", itemTypes="video", completeStatus=None))
        #        self.contextMenuItems.append(contextmenu.ContextMenuItem("Download Item", "CtMnDownloadItem", itemTypes="video", completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using Mplayer",
                                        "CtMnPlayMplayer",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using DVDPlayer",
                                        "CtMnPlayDVDPlayer",
                                        itemTypes="video",
                                        completeStatus=True))

        self.requiresLogon = False

        self.episodeItemRegex = '<div class="thumb">\W+<a[^>]+href="(/[^"]+)"[^>]*>\W+<img[^>]+alt="([^"]+)"/>'  # used for the ParseMainList
        self.videoItemRegex = '<div class="item[^"]*">(\W+<div class="thumb"><[^<]+<img src="([^"]+)" [^>]+></a></div>)*[\W]+<div class="title"><a +href="([^"]+)" [^>]+><span>([^<]+)</span></a></div>[\W]+<div class="airtime"><[^<]+<span>([^<]+)</span></a></div>\W+()*<div class="text"><[^<]+<span>([^<]*)</span></a></div>'  # used for the CreateVideoItem
        self.pageNavigationRegex = '<a href="([^"]+=)(\d+)"><span>\d+</span></a>'  #self.pageNavigationIndicationRegex
        self.pageNavigationRegexIndex = 1

        # decrepated. Using url based on ID now
        #self.mediaUrlRegex = '<param name="src" value="([^"]+)" />'    # used for the UpdateVideoItem

        return True
Exemple #13
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)

        self.guid = "0B5163FC-42F4-11DD-84D0-5DFE55D89593"
        self.icon = "sbs6icon.png"
        self.iconLarge = "sbs6large.png"
        self.noImage = "sbs6image.png"
        self.backgroundImage = "background-sbs6.png"
        self.backgroundImage16x9 = "background-sbs6-16x9.png"
        self.channelName = "SBS6"
        self.maxXotVersion = "3.2.0"
        self.channelDescription = "Online uitzendingen van www.SBS6.nl"
        self.sortOrder = 7
        self.moduleName = "chn_sbs6nl.py"
        self.mainListUri = "http://www.sbs6.nl/web/show/id=73863/langid=43"
        self.baseUrl = "http://www.sbs6.nl"
        self.onUpDownUpdateEnabled = True

        self.contextMenuItems = []
        #        self.contextMenuItems.append(contextmenu.ContextMenuItem("Update Item", "CtMnUpdateItem", itemTypes="video", completeStatus=None))
        #        self.contextMenuItems.append(contextmenu.ContextMenuItem("Download Item", "CtMnDownloadItem", itemTypes="video", completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using Mplayer",
                                        "CtMnPlayMplayer",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using DVDPlayer",
                                        "CtMnPlayDVDPlayer",
                                        itemTypes="video",
                                        completeStatus=True))

        self.requiresLogon = False

        #self.episodeItemRegex = '<span class="title"><a  href="([^"]+)"[^>]+>([^<]+)</a></span>' # used for the ParseMainList
        self.episodeItemRegex = '<div class="thumb">\W+<a[^>]+href="(/[^"]+)"[^>]*>\W+<img[^>]+alt="([^"]+)"/>'
        self.videoItemRegex = '<div class="item[^"]*">(\W+<div class="thumb"><[^<]+<img src="([^"]+)" [^>]+></a></div>)*[\W]+<div class="title"><a +href="([^"]+)" [^>]+><span>([^<]+)</span></a></div>[\W]+<div class="airtime"><[^<]+<span>([^<]+)</span></a></div>\W+()*<div class="text"><[^<]+<span>([^<]*)</span></a></div>'  # used for the CreateVideoItem
        self.pageNavigationRegex = '<a href="([^"]+=)(\d+)"><span>\d+</span></a>'  #self.pageNavigationIndicationRegex
        self.pageNavigationRegexIndex = 1

        return True
Exemple #14
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)
        self.guid = "52230AF6-FBA9-11DD-87D4-15B656D89593"
        self.icon = "freecastericon.png"
        self.iconLarge = "freecasterlarge.png"
        self.noImage = "freecasterimage.png"
        self.channelName = "Freecaster.tv"
        self.maxXotVersion = "3.2.0"
        self.channelDescription = "Freecaster.tv movies"
        self.moduleName = "chn_freecaster.py"
        self.mainListUri = "http://www.freecaster.com/"
        self.baseUrl = "http://www.freecaster.com"
        self.onUpDownUpdateEnabled = True

        self.contextMenuItems = []
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using Mplayer",
                                        "CtMnPlayMplayer",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using DVDPlayer",
                                        "CtMnPlayDVDPlayer",
                                        itemTypes="video",
                                        completeStatus=True))

        self.requiresLogon = False

        self.folderItemRegex = ''
        self.videoItemRegex = "<img src='([^']+)' alt='[^']+' [^>]+>[^\n]+<a class='clip_link' href='([^']+)'\W*>([^<]+)[^-]+- (\d{1,2}[^<]+)"  # used for the CreateVideoItem
        self.mediaUrlRegex = '<param\W+name="URL"\W+value="([^"]+)"'
        self.pageNavigationRegex = '<pagenav>([^<])<pagenav><pagenavurl>([^<]+)</pagenavurl>'
        self.pageNavigationRegexIndex = 0
        return True
Exemple #15
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)
        self.guid = "3ac3d6d0-5b2a-11dd-ae16-0800200c9a66"
        self.icon = "mtvnlicon.png"
        self.iconLarge = "mtvnllarge.png"
        self.noImage = "mtvnlimage.png"
        self.channelName = "MTV.nl"
        self.maxXotVersion = "3.2.0"
        self.channelDescription = "MTV.nl Episodes"
        self.moduleName = "chn_mtvnl.py"
        self.mainListUri = "http://www.mtv.nl/artikel.php?article=6330"
        self.baseUrl = "http://nl.esperanto.mtvi.com/www/xml"
        self.onUpDownUpdateEnabled = True

        self.contextMenuItems = []
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using Mplayer",
                                        "CtMnPlayMplayer",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using DVDPlayer",
                                        "CtMnPlayDVDPlayer",
                                        itemTypes="video",
                                        completeStatus=True))

        self.requiresLogon = False

        self.episodeItemRegex = '<a href="(http://www.mtv.nl/artikel.php\?article=\d+)"[^<]+><strong>([^<]+)<'  # used for the ParseMainList
        self.videoItemRegex = '<td>(\W{0,1}<a href="javascript:launchOverdrive\([^)]+\'(id=\d+)\'\);">([^<]*)</a>)(\W{0,1}<a [^>]+>([^<]*)</a>){0,1}(\W{0,1}<a [^>]+>([^<]*)</a>){0,1}\W{0,1}</td>[\n\r]'  # used for the CreateVideoItem
        #        self.folderItemRegex = '<a href="\.([^"]*/)(cat/)(\d+)"( style="color:\s*white;"\s*)*>([^>]+)</a><br'  # used for the CreateFolderItem
        self.mediaUrlRegex = '<param name="src" value="([^"]+)" />'  # used for the UpdateVideoItem
        return True
Exemple #16
0
    def __init__(self, channelInfo):
        """Initialisation of the class.

        Arguments:
        channelInfo: ChannelInfo - The channel info object to base this channel on.

        All class variables should be instantiated here and this method should not
        be overridden by any derived classes.

        """

        chn_class.Channel.__init__(self, channelInfo)

        # ============== Actual channel setup STARTS here and should be overwritten from derived classes ===============
        self.noImage = "myvideoimage.png"

        # set context menu items
        self.contextMenuItems.append(contextmenu.ContextMenuItem("Download Item", "CtMnDownloadItem", itemTypes="video"))

        # setup the urls
        self.mainListUri = "http://www.myvideo.nl/"
        self.baseUrl = "http://www.myvideo.nl"

        # setup the main parsing data
        self.episodeItemRegex = "<a class='nArrow' href='([^']+)' title='[^']*'>([^<]+)</a>"
        self._AddDataParser(self.mainListUri, preprocessor=self.AddCategories,
                            parser=self.episodeItemRegex, creator=self.CreateEpisodeItem)

        # Add generic Pre Procesor
        self._AddDataParser("*", preprocessor=self.PreProcessFolderList)

        self.videoItemRegex = "<img id='([^']+)' src='([^']+)' class='vThumb' alt='[^']*' [^>]+></a></div></div><div class='sCenter vTitle'><span class='title'><a[^>]+title='([^']+)'"
        self.mediaUrlRegex = '<item>\W*<file>\W*([^>]*)\W*</file>\W*<bandwidth>(\d+)</bandwidth>'
        self._AddDataParser("*", parser=self.episodeItemRegex, creator=self.CreateEpisodeItem,
                            updater=self.UpdateVideoItem)

        self.pageNavigationRegex = "<a class='pView pnNumbers'  href='([^?]+\?lpage=)(\d+)([^']+)"
        self.pageNavigationRegexIndex = 1
        self._AddDataParser("*", parser=self.pageNavigationRegex, creator=self.CreatePageItem)

        #===============================================================================================================
        # non standard items
        self.categoryName = ""

        #===============================================================================================================
        # Test cases:

        # ====================================== Actual channel setup STOPS here =======================================
        return
    def __init__(self, channelInfo):
        """Initialisation of the class.

        WindowXMLDialog(self, xmlFilename, scriptPath[, defaultSkin, defaultRes]) -- Create a new WindowXMLDialog script.

        xmlFilename     : string - the name of the xml file to look for.
        scriptPath      : string - path to script. used to fallback to if the xml doesn't exist in the current skin. (eg os.getcwd())
        defaultSkin     : [opt] string - name of the folder in the skins path to look in for the xml. (default='Default')
        defaultRes      : [opt] string - default skins resolution. (default='720p')

        *Note, skin folder structure is eg(resources/skins/Default/720p)

        All class variables should be instantiated here and this method should not
        be overridden by any derived classes.

        """

        chn_class.Channel.__init__(self, channelInfo)

        # ============== Actual channel setup STARTS here and should be overwritten from derived classes ===============
        self.noImage = "gelderlandimage.png"

        # set context menu items
        self.contextMenuItems.append(contextmenu.ContextMenuItem("Download Item", "CtMnDownloadItem", itemTypes="video"))

        # setup the urls
        self.mainListUri = "http://www.omroepgelderland.nl/web/Uitzending-gemist-5/TV-1/Programmas/Actuele-programmas.htm"
        self.baseUrl = "http://www.omroepgelderland.nl"
        self.swfUrl = "%s/design/channel/tv/swf/player.swf" % (self.baseUrl, )

        # setup the main parsing data
        self.episodeItemRegex = '<a href="(/web/Uitzending-gemist-5/TV-1/Programmas/Programma.htm\?p=[^"]+)"\W*>\W*' \
                                '<div[^>]+>\W+<img src="([^"]+)"[^>]+>\W+</div>\W+<div[^>]+>([^<]+)'
        self.videoItemRegex = """<div class="videouitzending[^>]+\('([^']+)','[^']+','[^']+','[^']+','([^']+) (\d+) (\w+) (\d+)','([^']+)','([^']+)'"""
        self.mediaUrlRegex = '<param\W+name="URL"\W+value="([^"]+)"'
        self.pageNavigationRegex = '(/web/Uitzending-gemist-5/TV-1/Programmas/Programma.htm\?p=Debuzz&amp;pagenr=)' \
                                   '(\d+)[^>]+><span>'
        self.pageNavigationRegexIndex = 1

        #===============================================================================================================
        # non standard items

        #===============================================================================================================
        # Test cases:

        # ====================================== Actual channel setup STOPS here =======================================
        return
Exemple #18
0
    def __init__(self, channelInfo):
        """Initialisation of the class.

        Arguments:
        channelInfo: ChannelInfo - The channel info object to base this channel on.

        All class variables should be instantiated here and this method should not
        be overridden by any derived classes.

        """

        chn_class.Channel.__init__(self, channelInfo)

        # ============== Actual channel setup STARTS here and should be overwritten from derived classes ===============
        self.noImage = "dumpertimage.png"

        # set context menu items
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Download Item",
                                        "CtMnDownloadItem",
                                        itemTypes="video"))

        # setup the urls
        self.baseUrl = "http://www.dumpert.nl/mediabase/flv/%s_YTDL_1.flv.flv"

        # setup the main parsing data
        self.mainListUri = "#mainlist"
        self._AddDataParser(self.mainListUri,
                            preprocessor=self.GetMainListItems)
        self.videoItemRegex = '<a[^>]+href="([^"]+)"[^>]*>\W+<img src="([^"]+)[\W\w]{0,400}<h\d>([^<]+)</h\d>\W+<[^>]' \
                              '*date"{0,1}>(\d+) (\w+) (\d+) (\d+):(\d+)'
        self._AddDataParser("*",
                            parser=self.videoItemRegex,
                            creator=self.CreateVideoItem,
                            updater=self.UpdateVideoItem)

        self.mediaUrlRegex = '<div class="videoplayer" id="video1" data-files="([^"]+)"'

        # ====================================== Actual channel setup STOPS here =======================================
        self.__IgnoreCookieLaw()
        return
Exemple #19
0
    def __init__(self, channelInfo):
        """Initialisation of the class.

        Arguments:
        channelInfo: ChannelInfo - The channel info object to base this channel on.

        All class variables should be instantiated here and this method should not
        be overridden by any derived classes.

        """

        chn_class.Channel.__init__(self, channelInfo)

        if self.channelCode == "pathejson":
            # we need to add headers and stuff for the API
            # self.UriHandlerOpen = UriHandler.Open
            # UriHandler.Open = self.__JsonHandlerOpen

            self.baseUrl = "https://connect.pathe.nl/v1"
            # set the default headers
            self.httpHeaders = {
                "X-Client-Token": "2d1411a8ec9842988e2700a1e3180dd3",
                "Accept": "application/json"
            }
            self.mainListUri = "https://connect.pathe.nl/v1/cinemas"

            self._AddDataParser("https://connect.pathe.nl/v1/cinemas",
                                json=True,
                                matchType=ParserData.MatchExact,
                                parser=(),
                                creator=self.CreateCinema)
            self._AddDataParser("/movies/nowplaying",
                                json=True,
                                matchType=ParserData.MatchEnd,
                                parser=(),
                                creator=self.CreateMovie)
            self._AddDataParser("https://connect.pathe.nl/v1/movies/",
                                json=True,
                                parser=['trailers'],
                                creator=self.CreateTrailer)
            self._AddDataParser("/schedules?date=",
                                json=True,
                                matchType=ParserData.MatchContains,
                                preprocessor=self.GetScheduleData,
                                parser=['movies'],
                                creator=self.CreateMovie)

        elif self.channelCode == "pathe":
            self.mainListUri = "https://www.pathe.nl"
            self.baseUrl = "https://www.pathe.nl"
            # setup the main parsing data
            self.episodeItemRegex = '<li><a[^>]+href="(https://www.pathe.nl/bioscoop/[^"]+)"[^>]+>([^<]+)</a></li>'
            self.folderItemRegex = '<li class="tab-item[^>]+>\W+<a[^>]+title="\w+ (\d+) (\w+) (\d+)"[^<]+' \
                                   'href="([^#]+)#schedule[^>]*>(\w+)'
            self.videoItemRegex = '<div class="schedule-movie">\W+<a[^>]+href="([^#]+)\#[^>]+"[^>]+' \
                                  'title="([^"]+)"[^>]+>\W+<div[^>]+>\W+<img[^>]+src="([^"]+)"[^>]+>\W+</div>' \
                                  '[\w\W]{0,1500}?<table class="table-schedule">([\w\W]{0,5000}?)</table>'
            self.mediaUrlRegex = 'file: "(http[^"]+)'

        else:
            raise NotImplementedError("Code %s is not implemented" %
                                      (self.channelCode, ))

        # ============== Actual channel setup STARTS here and should be overwritten from derived classes ===============
        self.noImage = "patheimage.png"
        self.scheduleData = None

        # set context menu items
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Download Item",
                                        "CtMnDownloadItem",
                                        itemTypes="video"))

        # ====================================== Actual channel setup STOPS here =======================================
        return
Exemple #20
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)

        self.guid = "743D04B2-42F3-11DD-84F5-6CEF55D89593"
        self.mainListUri = "http://www.123video.nl"
        self.baseUrl = "http://www.123video.nl/"
        self.icon = "123icon.png"
        self.iconLarge = "123large.png"
        self.noImage = "123image.png"
        self.channelName = "123Video.nl"
        self.channelDescription = "Videos van www.123video.nl"
        self.moduleName = "chn_123video.py"
        self.maxXotVersion = "3.2.0"

        self.contextMenuItems = []
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Update Item",
                                        "CtMnUpdateItem",
                                        itemTypes="video",
                                        completeStatus=None))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Download Item",
                                        "CtMnDownloadItem",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using Mplayer",
                                        "CtMnPlayMplayer",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using DVDPlayer",
                                        "CtMnPlayDVDPlayer",
                                        itemTypes="video",
                                        completeStatus=True))

        #self.backgroundImage = ""
        #self.backgroundImage16x9 = ""
        self.requiresLogon = False
        #self.sortOrder = 5

        self.episodeItemRegex = '<option value="(\d+)">([^<]+)</option>'
        self.videoItemRegex = '<a onFocus="this.blur\(\);" href="/playvideos.asp\?MovieID=(\d+)[^"]+" title="([^"]+)" [^>]+><img src="([^"]+)" width="\d+" /></a>[^:]+:[^:]+:[^:]+[^"]+"[^"]+">([^<]+)'
        self.folderItemRegex = ''  # Pages are now seperate items '&nbsp;&nbsp;<a href="(/video.asp\?Page=\d+)[^"]+(&CatID=\d+)&[^"]+" title="Ga naar pagina (\d+)'
        """ 
            The ProcessPageNavigation method will parse the current data using the pageNavigationRegex. It will
            create a pageItem using the CreatePageItem method. If no CreatePageItem method is in the channel,
            a default one will be created with the number present in the resultset location specified in the 
            pageNavigationRegexIndex and the url from the combined resultset. If that url does not contain http://
            the self.baseUrl will be added. 
        """
        self.pageNavigationRegex = '<a href="(/video.asp\?Page=)(\d+)([^"]+)" title="Ga naar pagina'
        self.pageNavigationRegexIndex = 1

        #==============================================================================
        # non standard items
        self.ipVideoServer = "85.17.191.65"
        #http://85.17.191.44/263/263621.flv
        return True
Exemple #21
0
    def __init__(self, channelInfo):
        """Initialisation of the class.

        Arguments:
        channelInfo: ChannelInfo - The channel info object to base this channel on.

        All class variables should be instantiated here and this method should not
        be overridden by any derived classes.

        """

        chn_class.Channel.__init__(self, channelInfo)

        # ============== Actual channel setup STARTS here and should be overwritten from derived classes ===============
        # set context menu items
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Download Item",
                                        "CtMnDownloadItem",
                                        itemTypes="video"))

        # configure login stuff
        # setup the urls
        self.channelBitrate = 850  # : the default bitrate
        self.liveUrl = None  # : the live url if present
        # self.liveSelector = ()     # : what stream keys to use

        if self.channelCode == "rtvutrecht":
            self.noImage = "rtvutrechtimage.png"
            self.mainListUri = "http://app.rtvutrecht.nl/ios-android/v520/gemist_rtvutrecht_programlist.json"
            self.baseUrl = "http://app.rtvutrecht.nl"
            # Uses NPO stream with smshield cookie
            self.liveUrl = "http://app.rtvutrecht.nl/ios-android/v520/live_rtvutrecht.json"
            self.channelBitrate = 780

        elif self.channelCode == "rtvrijnmond":
            self.noImage = "rtvrijnmondimage.png"
            self.mainListUri = "http://rijnmond.api.regiogrid.nl/apps/v520/programs.json"
            self.baseUrl = "http://rijnmond.api.regiogrid.nl"
            self.liveUrl = "http://rijnmond.api.regiogrid.nl/apps/v520/tv.json"
            self.channelBitrate = 900

        elif self.channelCode == "rtvdrenthe":
            self.noImage = "rtvdrentheimage.png"
            self.mainListUri = "http://drenthe.api.regiogrid.nl/apps/v520/programs.json"
            self.baseUrl = "http://drenthe.api.regiogrid.nl"
            self.liveUrl = "http://feeds.rtvdrenthe.nl/app/all/tv.json"
            self.channelBitrate = 1350

        elif self.channelCode == "rtvnoord":
            self.noImage = "rtvnoordimage.png"
            self.mainListUri = "http://noord.storage.regiogrid.nl/apps/v520/programs.json"
            self.baseUrl = "http://noord.storage.regiogrid.nl"
            # Uses NPO stream with smshield cookie
            self.liveUrl = "http://noord.storage.regiogrid.nl/apps/v520/tv-live-kiezer.json"
            self.channelBitrate = 1350

        elif self.channelCode == "rtvoost":
            self.noImage = "rtvoostimage.png"
            self.mainListUri = "http://mobileapp.rtvoost.nl/v520/feeds/programmas.aspx"
            self.baseUrl = "http://mobileapp.rtvoost.nl"
            # self.liveUrl = "http://mobileapp.rtvoost.nl/v500/feeds/tv.aspx"
            self.liveUrl = "http://mobileapp.rtvoost.nl/v520/feeds/tv.aspx"
            # the v500 has http://145.58.83.153:80/tv/live.stream/playlist.m3u8
            # the v520 has rtsp://145.58.83.153:554/tv/live.stream and NPO streams
            self.channelBitrate = 1350

        elif self.channelCode == "rtvnh":
            self.noImage = "rtvnhimage.png"
            # self.mainListUri = "http://www.rtvnh.nl/iphone-app/v500/programmas"
            # self.mainListUri = "http://www.rtvnh.nl/iphone-app/v520/programmas"
            self.baseUrl = "http://www.rtvnh.nl"
            self.liveUrl = "http://www.rtvnh.nl/iphone-app/v520/tvnh"
            self.channelBitrate = 1200

        elif self.channelCode == "omroepwest":
            self.noImage = "omroepwestimage.png"
            self.mainListUri = "http://west.storage.regiogrid.nl/apps/v520/programs.json"
            self.baseUrl = "http://www.omroepwest.nl"
            self.liveUrl = "http://feeds.omroepwest.nl/v520/tv.json"
            self.channelBitrate = 1500

        elif self.channelCode == "omroepgelderland":
            self.noImage = "omroepgelderlandimage.png"
            self.mainListUri = "http://web.omroepgelderland.nl/json/v400/programmas.json"
            self.baseUrl = "http://web.omroepgelderland.nl"
            self.liveUrl = "http://app.gld.nl/data/json/v500/tv_live.json"
            self.channelBitrate = 1500

        elif self.channelCode == "omroepzeeland":
            self.noImage = "omroepzeelandimage.png"
            self.mainListUri = "http://www.omroepzeeland.nl/mobile/v520/ug_programmas.json"
            self.baseUrl = "http://www.omroepzeeland.nl"
            self.liveUrl = "http://www.omroepzeeland.nl/mobile/v520/live-tv.json"
            self.channelBitrate = 1500

        elif self.channelCode == "omroepbrabant":
            self.noImage = "omroepbrabantimage.png"
            self.mainListUri = "http://feed.omroepbrabant.nl/v520/UGSeries.json"
            self.baseUrl = "http://www.omroepbrabant.nl"
            self.liveUrl = "http://feed.omroepbrabant.nl/s520/tv.json"
            self.channelBitrate = 1500

        elif self.channelCode == "omropfryslan":
            self.noImage = "omropfryslanimage.png"
            self.mainListUri = "http://www.omropfryslan.nl/feeds/v520/uitzendinggemist.php"
            self.baseUrl = "http://www.omropfryslan.nl"
            self.liveUrl = "http://www.omropfryslan.nl/feeds/v520/tv.php"
            self.channelBitrate = 1500

        else:
            raise NotImplementedError("Channelcode '%s' not implemented" %
                                      (self.channelCode, ))

        # setup the main parsing data
        self.episodeItemJson = ()
        self.videoItemJson = ("items", )

        self._AddDataParser(self.mainListUri,
                            preprocessor=self.AddLiveItems,
                            matchType=ParserData.MatchExact,
                            parser=self.episodeItemJson,
                            creator=self.CreateEpisodeItem,
                            json=True)

        if self.liveUrl:
            self._AddDataParser(self.liveUrl,
                                preprocessor=self.ProcessLiveItems)

        self._AddDataParser("*",
                            parser=self.videoItemJson,
                            creator=self.CreateVideoItem,
                            updater=self.UpdateVideoItem,
                            json=True)

        #===============================================================================================================
        # non standard items

        #===============================================================================================================
        # Test cases:
        #   Omroep Zeeland: M3u8 playist
        #   Omroep Brabant: Same M3u8 for al streams
        #   RTV Utrecht: Multiple live channels Type #1
        #   Omrop Fryslan: Multiple live channels Type #2

        # ====================================== Actual channel setup STOPS here =======================================
        return
Exemple #22
0
    def onActionFromContextMenu(self, controlID):
        if self.contextMenu is False:
            return None

        contextMenuItems = []

        # determine who called the menu
        if controlID <> controls.CH_LIST:
            selectedIndex = self.getControl(
                controls.PR_LIST).getSelectedPosition()
            parentControl = self.getFocus()
            # determine if favorites are enabled
            if (self.listMode == ProgListModes.Normal):
                contextMenuItems.append(
                    contextmenu.ContextMenuItem("Show Favorites",
                                                "CtMnShowFavorites"))
                contextMenuItems.append(
                    contextmenu.ContextMenuItem("Add to Favorites",
                                                "CtMnAddToFavorites"))
            else:
                contextMenuItems.append(
                    contextmenu.ContextMenuItem("Hide Favorites",
                                                "CtMnHideFavorites"))
                contextMenuItems.append(
                    contextmenu.ContextMenuItem("Remove from Favorites",
                                                "CtMnRemoveFromFavorites"))
            # or not

        elif controlID == controls.CH_LIST:
            selectedIndex = self.getCurrentListPosition(
            )  #getControl(controls.CH_LIST).getSelectedPosition()
            parentControl = self.getControl(controls.CH_LIST_WRAPPER)
            contextMenuItems.append(
                contextmenu.ContextMenuItem("Update channels",
                                            "CtMnUpdateChannels"))
            contextMenuItems.append(
                contextmenu.ContextMenuItem("Check for XOT updates",
                                            "CtMnUpdateXOT"))

        # build menuitems
        selectedItem = None
        contextMenu = contextmenu.GUI(config.contextMenuSkin,
                                      config.rootDir,
                                      config.skinFolder,
                                      parent=parentControl,
                                      menuItems=contextMenuItems)
        selectedItem = contextMenu.selectedItem
        del contextMenu

        # handle function from items
        if (selectedItem is not None):
            selectedMenuItem = contextMenuItems[selectedItem]
            functionString = "self.%s(%s)" % (selectedMenuItem.functionName,
                                              selectedIndex)
            logFile.debug("Calling %s", functionString)
            try:
                exec(functionString)
            except:
                logFile.error(
                    "onActionFromContextMenu :: Cannot execute '%s'.",
                    functionString,
                    exc_info=True)

        return None
Exemple #23
0
    def __init__(self, channelInfo):
        """Initialisation of the class.

        Arguments:
        channelInfo: ChannelInfo - The channel info object to base this channel on.

        All class variables should be instantiated here and this method should not
        be overridden by any derived classes.

        """

        chn_class.Channel.__init__(self, channelInfo)

        # ============== Actual channel setup STARTS here and should be overwritten from derived classes ===============
        self.noImage = "nosimage.png"

        # set context menu items
        self.contextMenuItems.append(contextmenu.ContextMenuItem("Download item", "CtMnDownload", itemTypes='video'))

        # setup the urls
        if self.channelCode == "uzgjson":
            self.baseUrl = "http://apps-api.uitzendinggemist.nl"
            self.mainListUri = "#mainlist"
            # self.mainListUri = "%s/series.json" % (self.baseUrl,)
            self.noImage = "nosimage.png"
        else:
            raise NotImplementedError("Code %s is not implemented" % (self.channelCode,))

        # mainlist stuff
        self._AddDataParser("#mainlist", preprocessor=self.GetInitialFolderItems)

        # Alpha listing and paging for that list
        self._AddDataParser("#alphalisting", preprocessor=self.AlphaListing)

        # Alpha listing based on JSON interface
        self._AddDataParser("%s/series.json" % (self.baseUrl,),
                            parser=(), creator=self.CreateJsonShows,
                            json=True)

        # live stuff
        self.baseUrlLive = "http://www.npo.nl"

        # live radio, the folders and items
        self._AddDataParser("http://radio-app.omroep.nl/player/script/",
                            preprocessor=self.ExtractJsonForLiveRadio, json=True,
                            parser=(), creator=self.CreateLiveRadio)
        self._AddDataParser("http://livestreams.omroep.nl",
                            updater=self.UpdateVideoItemLive)

        self._AddDataParser("/live", matchType=ParserData.MatchEnd, preprocessor=self.GetAdditionalLiveItems,
                            parser='<img[^>]+src="([^"]+)" /></a>[\w\W]{0,400}?<div class=\'item current-item\'>\W+'
                                   '<div class=\'time now\'>Nu</div>\W+<div class=\'description\'>\W+'
                                   '<a href="/live/([^"]+)" class="now">([^<]+)[\w\W]{0,200}?'
                                   '<div class=\'item next-item\'>\W+<div class=\'time next\'>([^<]+)</div>\W+'
                                   '<div class=\'description next\'>\W+<[^>]+>([^<]+)',
                            creator=self.CreateLiveTv, updater=self.UpdateVideoItemLive)

        # and some additional ones that might not appear in the first list
        self._AddDataParser("/live", matchType=ParserData.MatchEnd,
                            parser='<a href="/(live)/([^/"]+)"[^>]*>[\w\W]{0,300}?<div[^>]+'
                                   'style="background-image: url\(&#x27;([^)]+)&#x27;\)"[^>]*></div>',
                            creator=self.CreateLiveTv2)

        # recent and popular stuff and other Json data
        self._AddDataParser(".json",
                            parser=(), creator=self.CreateVideoItemJson,
                            json=True, matchType=ParserData.MatchEnd)

        # json for video's if mobile mode
        self._AddDataParser("apps-api.uitzendinggemist.nl/series/",
                            parser=("episodes",), creator=self.CreateVideoItemJson,
                            json=True, matchType=ParserData.MatchContains)

        # genres
        self._AddDataParser("http://www.npo.nl/uitzending-gemist", matchType=ParserData.MatchExact,
                            parser='<option value="(\d+)"[^>]*>([^<]+)<',
                            creator=self.CreateGenreItem)

        # Set self.nonMobilePageSize to 0 to enable mobile pages
        self.nonMobilePageSize = 50
        self.nonMobileMaxPageSize = 100

        # Non-mobile folders -> indicator if there are more items
        self.nonMobilePageRegex = "<div class=\Wsearch-results\W (?:data-num-found=\W(?<Total>\d+)\W " \
                                  "data-rows=\W(?<PageSize>\d+)\W data-start=\W(?<CurrentStart>\d+)\W|" \
                                  "data-page=\W(?<Page>\d+)\W)".replace("(?<", "(?P<")
        self._AddDataParser("*", parser=self.nonMobilePageRegex, creator=self.CreatePageItemNonMobile)

        # Non-mobile videos: for the old pages
        self.nonMobileVideoItemRegex = 'src="(?<Image>[^"]+)"\W+>(?<Premium><div class="not-' \
                                       'available-image-overlay">)?[\w\W]{0,500}?</a></div>\W*' \
                                       '</div>\W*<div[^>]*>\W*<a href="(?<Url>[^"]+/(?<Day>\d+)-' \
                                       '(?<Month>\d+)-(?<Year>\d+)/(?<WhatsOnId>[^/"]+))"[^>]*>' \
                                       '<h4>(?<Title>[^<]+)<[\W\w]{0,600}?<p[^>]+>(?<Description>' \
                                       '[^<]*)'.replace('(?<', '(?P<')
        self._AddDataParser("*", parser=self.nonMobileVideoItemRegex, creator=self.CreateVideoItemNonMobile,
                            updater=self.UpdateVideoItem)

        # Non-mobile videos: for the new pages
        self.nonMobileVideoItemRege2 = 'src="(?<Image>[^"]+)"[^>]+>\W*</a></div>\W*<div[^>]*>\W*<h3><a href="' \
                                       '(?<Url>[^"]+/(?<Day>\d+)-(?<Month>\d+)-(?<Year>\d+)/(?<WhatsOnId>[^/"]+))"' \
                                       '[^>]*>(?<Title>[^<]+)<[\W\w]{0,600}?<p[^>]*>' \
                                       '(?<Description>[^<]*)'.replace('(?<', '(?P<')
        self._AddDataParser("*", parser=self.nonMobileVideoItemRege2, creator=self.CreateVideoItemNonMobile,
                            updater=self.UpdateVideoItem)

        self._AddDataParser("^http://www.npo.nl/a-z(/[a-z])?\?page=", matchType=ParserData.MatchRegex,
                            parser=self.nonMobilePageRegex, creator=self.CreatePageItemNonMobile)
        programRegex = Regexer.FromExpresso(
            '<a href="(?<Url>[^"]+)/(?<WhatsOnId>[^"]+)">\W*<img[^>]+src="'
            '(?<Image>[^"]+)" />\W*</a>\W*</div>\W*</div>\W*<div[^<]+<a[^>]*><h4>'
            '[\n\r]*(?<Title>[^<]+)\W*<span[^>]*>[^>]+>\W*<span[^>]*>[^>]+>\W*</h4>'
            '\W*<h5>(?:[^>]*>){2}[^<]*(?:<a[^>]*>\w+ (?<Day>\d+) (?<MonthName>\w+) '
            '(?<Year>\d+)[^>]*(?<Hour>\d+):(?<Minutes>\d+)</a></h5>\W*)?<p[^>]*>'
            '(?:<span>)?(?<Description>[^<]*)')
        self._AddDataParser("^http://www.npo.nl/a-z(/[a-z])?\?page=", matchType=ParserData.MatchRegex,
                            parser=programRegex, creator=self.CreateFolderItemAlpha)

        # needs to be here because it will be too late in the script version
        self.__IgnoreCookieLaw()

        # ===============================================================================================================
        # non standard items
        # self.__TokenTest()

        # ====================================== Actual channel setup STOPS here =======================================
        return
Exemple #24
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """
        # call base function first to ensure all variables are there
        chn_class.Channel.InitialiseVariables(self)

        self.guid = "1ABEDEDC-42F4-11DD-86A5-EAFF55D89593"
        self.mainListUri = "http://quicksilverscreen.com/"
        self.baseUrl = "http://quicksilverscreen.com/"
        self.icon = "quicksilverthumb.png"
        self.iconLarge = "quicksilverlarge.png"
        self.noImage = "quicksilverimage.png"
        self.channelName = "Quicksilver Screen"
        self.channelDescription = "Watch TV shows online free"
        self.moduleName = "chn_quicksilver.py"
        self.maxXotVersion = "3.2.0"
        self.onUpDownUpdateEnabled = False

        self.requiresLogon = False

        self.contextMenuItems = []
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Update Item",
                                        "CtMnUpdateItem",
                                        itemTypes="video",
                                        completeStatus=False))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Download Item",
                                        "CtMnDownloadItem",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using Mplayer",
                                        "CtMnPlayMplayer",
                                        itemTypes="video",
                                        completeStatus=True))
        self.contextMenuItems.append(
            contextmenu.ContextMenuItem("Play using DVDPlayer",
                                        "CtMnPlayDVDPlayer",
                                        itemTypes="video",
                                        completeStatus=True))

        self.episodeItemRegex = '<li><a href="(videos\?c=\d+)">([^<]+)</a></li>'
        #self.videoItemRegex = '<a href="(watch\?video=\d+)"><img src="([^"]+)[^;]+[^<]+<a href="(watch\?video=\d+)">([^<]+)</a>'
        self.videoItemRegex = '<a href="(watch\?video=\d+)"><img src="([^"]+)[^;]+[^<]+<a href=["\'](watch\?video=\d+)["\']>(<small>\[[^]]+\]</small> )*([^<]+)</a>'
        self.folderItemRegex = '<a href="(videos\?c=\d+)">([^<]+)</a><br/>[\r\n]'
        self.mediaUrlRegex = '<embed type="video/divx" src="([^"]+)" pluginspage'
        """ 
            The ProcessPageNavigation method will parse the current data using the pageNavigationRegex. It will
            create a pageItem using the CreatePageItem method. If no CreatePageItem method is in the channel,
            a default one will be created with the number present in the resultset location specified in the 
            pageNavigationRegexIndex and the url from the combined resultset. If that url does not contain http://
            the self.baseUrl will be added. 
        """
        self.pageNavigationRegex = '<li><a rel="nofollow" href="(videos\?[^"]+page=)(\d+)">\d+</a></li>'
        self.pageNavigationRegexIndex = 1

        #==============================================================================
        # non standard items
        self.PreProcessRegex = '<ul title="([^"]*)" rel="([^"]*)videomenu.xml"'
        self.progTitle = ""
        self.videoMenu = ""

        return True
Exemple #25
0
    def InitialiseVariables(self):
        """
        Used for the initialisation of user defined parameters. All should be 
        present, but can be adjusted
        """

        try:
            # call base function first to ensure all variables are there
            chn_class.Channel.InitialiseVariables(self)

            self.noImage = "nosimage.png"
            self.baseUrl = "http://www.uitzendinggemist.nl"
            self.baseUrl2 = "http://wmc.uitzendinggemist.nl"
            self.requiresLogon = False
            self.playerUrl = "http://player.omroep.nl/xml/metaplayer.xml.php"
            self.maxXotVersion = "3.2.0"

            if self.channelCode == "ned1":
                self.guid = "CD702550-42F3-11DD-80F9-8FF855D89593"
                self.mainListUri = "http://www.uitzendinggemist.nl/index.php/selectie?searchitem=net_zender&net_zender=1&sort=datum"
                #self.mainListUri = "http://wmc.uitzendinggemist.nl/xmlHTTP/searchZender.php?zenderID=1"
                self.icon = "1icon.png"
                self.iconLarge = "1large.png"
                self.noImage = "nosimage.png"
                self.channelName = "Nederland 1"
                self.moduleName = "chn_nos.py"
                self.sortOrder = 1
                self.channelDescription = "Uitzendingen van de publieke zender Nederland 1"

            elif self.channelCode == "ned2":
                self.guid = "C875C1B8-42F3-11DD-BBC9-E4F755D89593"
                self.mainListUri = "http://www.uitzendinggemist.nl/index.php/selectie?searchitem=net_zender&net_zender=2&sort=datum"
                #self.mainListUri = "http://wmc.uitzendinggemist.nl/xmlHTTP/searchZender.php?zenderID=2"
                self.icon = "2icon.png"
                self.iconLarge = "2large.png"
                self.noImage = "nosimage.png"
                self.channelName = "Nederland 2"
                self.channelDescription = "Uitzendingen van de publieke zender Nederland 2"
                self.moduleName = "chn_nos.py"
                self.sortOrder = 2

            elif self.channelCode == "ned3":
                self.guid = "D0BDAA2A-42F3-11DD-A8C0-D3F855D89593"
                self.mainListUri = "http://www.uitzendinggemist.nl/index.php/selectie?searchitem=net_zender&net_zender=3&sort=datum"
                #self.mainListUri = "http://wmc.uitzendinggemist.nl/xmlHTTP/searchZender.php?zenderID=3"
                self.icon = "3icon.png"
                self.iconLarge = "3large.png"
                self.noImage = "nosimage.png"
                self.channelName = "Nederland 3"
                self.channelDescription = "Uitzendingen van de publieke zender Nederland 3"
                self.moduleName = "chn_nos.py"
                self.sortOrder = 3

            else:
                self.guid = "99fa1469-0a95-413e-b1a7-3f9b0506a67b"
                self.mainListUri = "http://www.uitzendinggemist.nl/index.php/selectie?searchitem=omroep&omroep=47&sort=datum"
                self.icon = "zappicon.png"
                self.iconLarge = "zapplarge.png"
                self.noImage = "nosimage.png"
                self.channelName = "Z@PP"
                self.channelDescription = "Uitzendingen van Z@PP"
                self.moduleName = "chn_nos.py"
                #self.sortOrder = 3

            self.contextMenuItems = []
            self.contextMenuItems.append(
                contextmenu.ContextMenuItem("Play using Mplayer",
                                            "CtMnPlayMplayer",
                                            itemTypes="video",
                                            completeStatus=True))
            self.contextMenuItems.append(
                contextmenu.ContextMenuItem("Play using DVDPlayer",
                                            "CtMnPlayDVDPlayer",
                                            itemTypes="video",
                                            completeStatus=True))

            self.episodeItemRegex = '<a class="title" href="(/index.php/serie\?serID=\d+&amp;md5=[0-9a-f]+)">([^<]+)</a></td>\W+<td[^>]+>([^<]+)'
            #self.episodeItemRegex = '<span[^>]+name="([^"]+)"[^>]+>([^<]+)</span>'
            self.videoItemRegex = ''
            self.folderItemRegex = ''  #not possible, to complex here. ProcessFolderList is used
            """ 
                The ProcessPageNavigation method will parse the current data using the pageNavigationRegex. It will
                create a pageItem using the CreatePageItem method. If no CreatePageItem method is in the channel,
                a default one will be created with the number present in the resultset location specified in the 
                pageNavigationRegexIndex and the url from the combined resultset. If that url does not contain http://
                the self.baseUrl will be added. 
            """
            self.pageNavigationRegex = '<a title="Pagina #\d+" href="(/index.php/serie2\?serID=\d+&)amp;(pgNum=)(\d+)(&)amp;([^"]+)" style="text-decoration:none;">\d+</a>'  #self.pageNavigationIndicationRegex
            self.pageNavigationRegexIndex = 2
        except:
            logFile.debug("Error Initialising Varialbles for NOS",
                          exc_info=True)
        #==============================================================================
        # non standard items
        self.sortAlphabetically = True
        self.maxNumberOfFrontPages = 10

        return True