Exemple #1
0
    def __ignore_cookie_law(self):
        """ Accepts the cookies from UZG in order to have the site available """

        Logger.info("Setting the Cookie-Consent cookie for www.dumpert.nl")

        # Set-Cookie: cpc=10; path=/; domain=www.dumpert.nl; expires=Thu, 11-Jun-2020 18:49:38 GMT
        UriHandler.set_cookie(name='cpc', value='10', domain='.www.dumpert.nl')
        return
Exemple #2
0
    def __ignore_cookie_law(self):
        """ Accepts the cookies from UZG in order to have the site available """

        Logger.info("Setting the Cookie-Consent cookie for www.uitzendinggemist.nl")

        # a second cookie seems to be required
        UriHandler.set_cookie(name='npo_cc', value='tmp', domain='.nos.nl')
        return
    def __ignore_cookie_law(self):
        """ Accepts the cookies from RTL channel in order to have the site available """

        Logger.info(
            "Setting the Cookie-Consent cookie for www.uitzendinggemist.nl")

        # the rfc2109 parameters is not valid in Python 2.4 (Xbox), so we ommit it.
        UriHandler.set_cookie(name='rtlcookieconsent',
                              value='yes',
                              domain='.www.rtl.nl')
        return
Exemple #4
0
    def __init__(self, channel_info):
        """ Initialisation of the class.

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

        :param ChannelInfo channel_info: The channel info object to base this channel on.

        """

        chn_class.Channel.__init__(self, channel_info)

        # ============== Actual channel setup STARTS here and should be overwritten from derived classes ===============
        # setup the urls
        self.baseUrl = "https://www.kijk.nl"
        # Just retrieve a single page with 500 items (should be all)

        use_html = False
        if use_html:
            self.mainListUri = "https://www.kijk.nl/programmas"
        else:
            self.mainListUri = "https://api.kijk.nl/v1/default/sections/programs-abc-0123456789abcdefghijklmnopqrstuvwxyz?limit=350&offset=0"

        self.__channelId = self.channelCode
        if self.channelCode == 'veronica':
            self.noImage = "veronicaimage.png"
            self.__channelId = "veronicatv"

        elif self.channelCode == 'sbs':
            self.noImage = "sbs6image.jpg"
            self.__channelId = "sbs6"

        elif self.channelCode == 'sbs9':
            self.noImage = "sbs9image.png"

        elif self.channelCode == 'net5':
            self.noImage = "net5image.png"

        else:
            self.noImage = "kijkimage.png"

        # setup the main parsing data
        self._add_data_parser(
            "https://api.kijk.nl/v1/default/sections/programs-abc",
            name="Mainlist Json",
            json=True,
            preprocessor=self.add_others,
            parser=[
                "items",
            ],
            creator=self.create_json_episode_item)

        self._add_data_parser("https://www.kijk.nl/programmas",
                              match_type=ParserData.MatchExact,
                              name="Mainlist from HTML",
                              json=True,
                              preprocessor=self.extract_main_list_json)

        self._add_data_parser(
            "https://api.kijk.nl/v2/templates/page/format/",
            name="Videos from the main show format page",
            json=True,
            parser=["components", 3, "data", "items", 2, "data", "items"],
            creator=self.create_json_season_item)

        self._add_data_parser("#lastweek",
                              name="Last week listing",
                              json=True,
                              preprocessor=self.list_dates)

        self._add_data_parsers([
            "https://api.kijk.nl/v2/templates/page/missed/all/",
            "https://api.kijk.nl/v1/default/sections/missed-all-"
        ],
                               name="Day listing",
                               json=True,
                               preprocessor=self.extract_day_items)

        self._add_data_parser(
            "https://api.kijk.nl/v1/default/searchresultsgrouped",
            name="VideoItems Json",
            json=True,
            parser=[],
            creator=self.create_json_search_item)

        self._add_data_parsers([
            "https://api.kijk.nl/v1/default/sections/series",
            "https://api.kijk.nl/v1/default/seasons/"
        ],
                               name="VideoItems Json",
                               json=True,
                               parser=[
                                   "items",
                               ],
                               creator=self.create_json_video_item)

        self._add_data_parser(
            "https://api.kijk.nl/v2/default/sections/popular",
            name="Popular items Json",
            json=True,
            parser=[
                "items",
            ],
            creator=self.create_json_popular_item)

        self._add_data_parser("https://embed.kijk.nl/",
                              updater=self.update_json_video_item)

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

        #===============================================================================================================
        # Test cases:
        #  Piets Weer: no clips
        #  Achter gesloten deuren: seizoenen
        #  Wegmisbruikers: episodes and clips and both pages
        #  Utopia: no clips
        #  Grand Designs has almost all encrypted/non-encrypted/brigthcove streams

        # ====================================== Actual channel setup STOPS here =======================================
        UriHandler.set_cookie(name="OPTOUTMULTI",
                              value="0:0%7Cc5:0%7Cc1:0%7Cc4:0%7Cc3:0%7Cc2:0",
                              domain=".kijk.nl")
        return