Ejemplo n.º 1
0
    def __IgnoreCookieLaw(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

        # the rfc2109 parameters is not valid in Python 2.4 (Xbox), so we ommit it.
        c = cookielib.Cookie(version=0,
                             name='cpc',
                             value='10',
                             port=None,
                             port_specified=False,
                             domain='.www.dumpert.nl',
                             domain_specified=True,
                             domain_initial_dot=False,
                             path='/',
                             path_specified=True,
                             secure=False,
                             expires=2327431273,
                             discard=False,
                             comment=None,
                             comment_url=None,
                             rest={'HttpOnly': None})  # , rfc2109=False)
        UriHandler.Instance().cookieJar.set_cookie(c)
        return
Ejemplo n.º 2
0
    def __IgnoreCookieLaw(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.
        c = cookielib.Cookie(version=0,
                             name='rtlcookieconsent',
                             value='yes',
                             port=None,
                             port_specified=False,
                             domain='.www.rtl.nl',
                             domain_specified=True,
                             domain_initial_dot=False,
                             path='/',
                             path_specified=True,
                             secure=False,
                             expires=2327431273,
                             discard=False,
                             comment=None,
                             comment_url=None,
                             rest={'HttpOnly': None})  # , rfc2109=False)
        UriHandler.Instance().cookieJar.set_cookie(c)
        return
Ejemplo n.º 3
0
    def __IgnoreCookieLaw(self):
        """ Accepts the cookies from UZG 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.
        c = cookielib.Cookie(version=0, name='site_cookie_consent', value='yes', port=None, port_specified=False,
                             domain='.www.uitzendinggemist.nl', domain_specified=True, domain_initial_dot=False,
                             path='/', path_specified=True, secure=False, expires=2327431273, discard=False,
                             comment=None, comment_url=None, rest={'HttpOnly': None})  # , rfc2109=False)
        UriHandler.Instance().cookieJar.set_cookie(c)

        # a second cookie seems to be required
        c = cookielib.Cookie(version=0, name='npo_cc', value='tmp', port=None, port_specified=False,
                             domain='.www.uitzendinggemist.nl', domain_specified=True, domain_initial_dot=False,
                             path='/', path_specified=True, secure=False, expires=2327431273, discard=False,
                             comment=None, comment_url=None, rest={'HttpOnly': None})  # , rfc2109=False)
        UriHandler.Instance().cookieJar.set_cookie(c)

        # the rfc2109 parameters is not valid in Python 2.4 (Xbox), so we ommit it.
        c = cookielib.Cookie(version=0, name='site_cookie_consent', value='yes', port=None, port_specified=False,
                             domain='.www.npo.nl', domain_specified=True, domain_initial_dot=False, path='/',
                             path_specified=True, secure=False, expires=2327431273, discard=False, comment=None,
                             comment_url=None, rest={'HttpOnly': None})  # , rfc2109=False)
        UriHandler.Instance().cookieJar.set_cookie(c)

        # Set-Cookie: npo_cc=30; path=/; domain=www.npo.nl; expires=Tue, 09-Aug-2044 21:55:39 GMT
        c = cookielib.Cookie(version=0, name='npo_cc', value='30', port=None, port_specified=False,
                             domain='.www.npo.nl', domain_specified=True, domain_initial_dot=False, path='/',
                             path_specified=True, secure=False, expires=2327431273, discard=False, comment=None,
                             comment_url=None, rest={'HttpOnly': None})  # , rfc2109=False)
        UriHandler.Instance().cookieJar.set_cookie(c)

        # http://pilot.odcontent.omroep.nl/codem/h264/1/nps/rest/2013/NPS_1220255/NPS_1220255.ism/NPS_1220255.m3u8
        # balancer://sapi2cluster=balancer.sapi2a

        # c = cookielib.Cookie(version=0, name='balancer://sapi2cluster', value='balancer.sapi2a', port=None, port_specified=False, domain='.pilot.odcontent.omroep.nl', domain_specified=True, domain_initial_dot=False, path='/', path_specified=True, secure=False, expires=2327431273, discard=False, comment=None, comment_url=None, rest={'HttpOnly': None})  # , rfc2109=False)
        # UriHandler.Instance().cookieJar.set_cookie(c)
        # c = cookielib.Cookie(version=0, name='balancer://sapi1cluster', value='balancer.sapi1a', port=None, port_specified=False, domain='.pilot.odcontent.omroep.nl', domain_specified=True, domain_initial_dot=False, path='/', path_specified=True, secure=False, expires=2327431273, discard=False, comment=None, comment_url=None, rest={'HttpOnly': None})  # , rfc2109=False)
        # UriHandler.Instance().cookieJar.set_cookie(c)
        return
Ejemplo n.º 4
0
def RunPlugin():
    """ Runs Retrospect as a Video Add-On """

    logFile = None

    try:
        from config import Config
        from helpers.sessionhelper import SessionHelper

        # get a logger up and running
        from logger import Logger

        # only append if there are no active sessions
        if not SessionHelper.IsSessionActive():
            # first call in the session, so do not append the log
            appendLogFile = False
        else:
            appendLogFile = True

        logFile = Logger.CreateLogger(os.path.join(Config.profileDir,
                                                   Config.logFileNameAddon),
                                      Config.appName,
                                      append=appendLogFile,
                                      dualLogger=lambda x, y=4: xbmc.log(x, y))

        from urihandler import UriHandler
        from addonsettings import AddonSettings
        from textures import TextureHandler

        # update the loglevel
        Logger.Instance().minLogLevel = AddonSettings.GetLogLevel()

        useCaching = AddonSettings.CacheHttpResponses()
        cacheDir = None
        if useCaching:
            cacheDir = Config.cacheDir

        # determine the platform
        from envcontroller import EnvController
        from environments import Environments
        maxFileNameLength = None
        if EnvController.IsPlatform(Environments.Xbox):
            maxFileNameLength = 42

        ignoreSslErrors = AddonSettings.IgnoreSslErrors()
        UriHandler.CreateUriHandler(cacheDir=cacheDir,
                                    maxFileNameLength=maxFileNameLength,
                                    cookieJar=os.path.join(
                                        Config.profileDir, "cookiejar.dat"),
                                    ignoreSslErrors=ignoreSslErrors)

        # start texture handler
        TextureHandler.SetTextureHandler(Config, Logger.Instance(),
                                         UriHandler.Instance())

        # run the plugin
        import plugin
        plugin.Plugin(sys.argv[0], sys.argv[2], sys.argv[1])

        # close the log to prevent locking on next call
        Logger.Instance().CloseLog()
        logFile = None

        # make sure we leave no references behind
        AddonSettings.ClearCachedAddonSettingsObject()
    except:
        if logFile:
            logFile.Critical("Error running plugin", exc_info=True)
        raise