def __init__(self):
     CBaseHostClass.__init__(self)
     self.MAIN_URL_TV      = 'http://www.canlitvlive.io/'
     self.MAIN_URL_RADIO   = 'http://www.canliradyolive.com/'
     self.MAIN_URL = self.MAIN_URL_TV
     self.DEFAULT_ICON_URL = 'http://www.canlitvlive.io/images/footer_simge.png'
     self.HTTP_HEADER = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36', 'Accept': 'text/html', 'Accept-Encoding':'gzip, deflate'}
     self.AJAX_HEADER = dict(self.HTTP_HEADER)
     self.AJAX_HEADER.update( {'X-Requested-With': 'XMLHttpRequest'} )
     
     self.COOKIE_FILE = GetCookieDir('canlitvlive.io.cookie')
     
     self.defaultParams = {}
     self.defaultParams.update({'header':self.HTTP_HEADER, 'save_cookie': True, 'load_cookie': True, 'cookiefile': self.COOKIE_FILE})
Beispiel #2
0
    def doLogin(self, login, password):
        HTTP_HEADER = dict(self.cm.HEADER)
        HTTP_HEADER.update(
            {'Content-Type': 'application/x-www-form-urlencoded'})

        cookiePath = GetCookieDir('videostar.cookie')
        params = {
            'header': HTTP_HEADER,
            'cookiefile': cookiePath,
            'use_cookie': True,
            'save_cookie': True
        }

        rm(cookiePath)

        if self.proxy_gateway_url_ssl != '':
            HTTP_HEADER['Referer'] = self.proxy_gateway_url
            sts, data = self.cm.getPage(self.proxy_gateway_url_ssl, params)
            self.printPageData(self.proxy_gateway_url_ssl, data)
            if not sts: return False
            params['load_cookie'] = True
            params['proxy_gateway'] = self.proxy_gateway_url

        post_data = {'login': login, 'password': password, 'permanent': '1'}
        url = self._getUrl('login_url')

        sts, data = self.cm.getPage(url, params, post_data)
        if not sts: return False

        self.printPageData(url, data)
        self.cm.HEADER['Cookie'] = self.cm.getCookieHeader(cookiePath)
        if self.proxy_gateway_url != '':
            HTTP_HEADER = dict(self.cm.HEADER)
            HTTP_HEADER['Referer'] = self.proxy_gateway_url.format(
                urllib.quote(HTTP_HEADER['Referer']))
            params = {
                'proxy_gateway': self.proxy_gateway_url,
                'header': HTTP_HEADER
            }
        else:
            params = {}

        url = self._getUrl('subscriptions_url')
        sts, data = self.cm.getPage(url, params)
        if sts:
            self.printPageData(url, data)
            if 'Wyloguj' in data:
                return True

        return False
Beispiel #3
0
 def __init__(self):
     self.up = urlparser.urlparser()
     self.cm = pCommon.common()
     self.sessionEx = MainSessionWrapper()
     self.ytp = YouTubeParser()
     self.ytformats = config.plugins.iptvplayer.ytformat.value
     # Temporary data
     self.currList = []
     self.currItem = {}
     # Login data
     self.COOKIEFILE = GetCookieDir('Diff-anime.cookie')
     self.usePremiumAccount = config.plugins.iptvplayer.diffanime_premium.value
     self.username = config.plugins.iptvplayer.diffanime_login.value
     self.password = config.plugins.iptvplayer.diffanime_password.value
Beispiel #4
0
 def __init__(self):
     CBaseHostClass.__init__(self)
     self.MAIN_URL         = 'https://www.djing.com/'
     self.DEFAULT_ICON_URL = 'https://www.djing.com/newimages/content/c01.jpg'
     self.HTTP_HEADER = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36', 'Accept': 'text/html', 'Accept-Encoding':'gzip, deflate'}
     self.AJAX_HEADER = dict(self.HTTP_HEADER)
     self.AJAX_HEADER.update( {'X-Requested-With': 'XMLHttpRequest'} )
     
     self.COOKIE_FILE = GetCookieDir('viortv.cookie')
     
     self.defaultParams = {}
     self.defaultParams.update({'header':self.HTTP_HEADER, 'cookiefile': self.COOKIE_FILE}) #'save_cookie': True, 'load_cookie': True,
     self.loggedIn = False
     self.accountInfo = ''
Beispiel #5
0
 def __init__(self):
     CBaseHostClass.__init__(self)
     self.MAIN_URL = 'http://bilasport.net/'
     self.DEFAULT_ICON_URL = 'https://projects.fivethirtyeight.com/2016-mlb-predictions/images/logos.png'
     self.HTTP_HEADER = self.cm.getDefaultHeader(browser='chrome')
     self.AJAX_HEADER = dict(self.HTTP_HEADER)
     self.AJAX_HEADER.update({'X-Requested-With': 'XMLHttpRequest'})
     self.COOKIE_FILE = GetCookieDir('bilasport.pw.cookie')
     self.defaultParams = {
         'header': self.HTTP_HEADER,
         'save_cookie': True,
         'load_cookie': True,
         'cookiefile': self.COOKIE_FILE
     }
Beispiel #6
0
    def __init__(self):
        CBaseHostClass.__init__(self)
        self.MAIN_URL = 'https://ustvgo.tv/'
        self.DEFAULT_ICON_URL = 'https://image.winudf.com/v2/image1/dXN0dmdvLmdvdHYudXNfaWNvbl8xNTcyNDU4Nzc3XzAzMg/icon.png?w=170&fakeurl=1'

        self.HTTP_HEADER = MergeDicts(
            self.cm.getDefaultHeader(browser='chrome'),
            {'Referer': self.getMainUrl()})
        self.http_params = {
            'header': self.HTTP_HEADER,
            'use_cookie': True,
            'save_cookie': True,
            'load_cookie': True,
            'cookiefile': GetCookieDir("ustvgo.cookie")
        }
Beispiel #7
0
    def __init__(self, params={}):
        self.sessionEx = MainSessionWrapper() 
        self.up = urlparser()
        
        proxyURL = params.get('proxyURL', '')
        useProxy = params.get('useProxy', False)
        self.cm = common(proxyURL, useProxy)

        self.currList = []
        self.currItem = {}
        if '' != params.get('history', ''):
            self.history = CSearchHistoryHelper(params['history'])
        if '' != params.get('cookie', ''):
            self.COOKIE_FILE = GetCookieDir(params['cookie'])
        self.moreMode = False
Beispiel #8
0
 def __init__(self):
     CBaseHostClass.__init__(self)
     self.MAIN_URL    = 'https://livetvhd.net/'
     self.HEADER = {'User-Agent': 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10', 'Accept': 'text/html'}
     self.AJAX_HEADER = dict(self.HEADER)
     self.AJAX_HEADER.update( {'X-Requested-With': 'XMLHttpRequest'} )
     
     self.COOKIE_FILE = GetCookieDir('livetvhdnet.cookie')
     
     self.http_params = {}
     self.http_params.update({'header':self.HEADER, 'save_cookie': True, 'load_cookie': True, 'cookiefile': self.COOKIE_FILE})
     
     self.cacheList = {}
     
     self.needProxy = None
    def __init__(self, params={}):
        self.TMP_FILE_NAME = '.iptv_subtitles.file'
        self.TMP_DIR_NAME = '/.iptv_subtitles.dir/'
        self.sessionEx = MainSessionWrapper(mainThreadIdx=1)

        proxyURL = params.get('proxyURL', '')
        useProxy = params.get('useProxy', False)
        self.cm = common(proxyURL, useProxy)

        self.currList = []
        self.currItem = {}
        if '' != params.get('cookie', ''):
            self.COOKIE_FILE = GetCookieDir(params['cookie'])
        self.moreMode = False
        self.params = params
Beispiel #10
0
    def __init__(self):
        self.cm = common()
        self.up = urlparser()
        self.sessionEx = MainSessionWrapper()
        self.cookiePath = GetCookieDir('ustvnow.cookie')
        self.token = ''

        HTTP_HEADER = dict(self.HTTP_HEADER)
        HTTP_HEADER.update(
            {'Content-Type': 'application/x-www-form-urlencoded'})
        self.defParams = {
            'header': HTTP_HEADER,
            'cookiefile': self.cookiePath,
            'use_cookie': True,
            'load_cookie': True,
            'save_cookie': True
        }
Beispiel #11
0
 def _unshorten_rapidcrypt(self, uri):
     try:
         COOKIE_FILE = GetCookieDir('rapidcrypt.net')
         params = {'header':HTTP_HEADER, 'use_cookie': True, 'load_cookie': True, 'save_cookie': True, 'cookiefile': COOKIE_FILE}
         params['cloudflare_params'] = { 'cookie_file':COOKIE_FILE, 'User-Agent':HTTP_HEADER['User-Agent']}
         sts, data = self.cm.getPageCFProtection(uri, params)
         uri = self.cm.ph.getDataBeetwenNodes(data, ('<a', '>', 'push_button'), ('</a', '>'))[1]
         printDBG(uri)
         uri = self.cm.ph.getSearchGroups(uri, '''href=([^>^\s]+?)[>\s]''')[0]
         if uri.startswith('"'): uri = self.cm.ph.getSearchGroups(uri, '"([^"]+?)"')[0]
         elif uri.startswith("'"): uri = self.cm.ph.getSearchGroups(uri, "'([^']+?)'")[0]
         
         uri = self.cm.getFullUrl(uri, self.cm.getBaseUrl(self.cm.meta['url']))
         return uri, 'OK'
     except Exception as e:
         printExc()
         return uri, str(e)
Beispiel #12
0
    def __init__(self):
        CBaseHostClass.__init__(self)
        self.sessionEx = MainSessionWrapper()
        self.MAIN_URL = 'http://www.wagasworld.com/'
        self.HTTP_HEADER = {
            'User-Agent':
            'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0',
            'Referer': self.MAIN_URL
        }

        self.COOKIE_FILE = GetCookieDir('wagasworld.cookie')
        self.http_params = {
            'header': dict(self.HTTP_HEADER),
            'save_cookie': True,
            'load_cookie': True,
            'cookiefile': self.COOKIE_FILE
        }
Beispiel #13
0
 def __init__(self):
     self.MAIN_URL = 'http://showsport-tv.com/'
     self.HTTP_HEADER = {
         'User-Agent':
         'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0',
         'Referer': self.MAIN_URL
     }
     self.COOKIE_FILE = GetCookieDir('showsporttvcom.cookie')
     self.sessionEx = MainSessionWrapper()
     self.cm = common()
     self.up = urlparser()
     self.http_params = {}
     self.http_params.update({
         'save_cookie': True,
         'load_cookie': True,
         'cookiefile': self.COOKIE_FILE
     })
     self.cacheList = {}
Beispiel #14
0
    def __init__(self):
        CBaseHostClass.__init__(self)
        self.MAIN_URL = 'http://wizja.tv/'
        self.DEFAULT_ICON_URL = 'http://wizja.tv/logo.png'
        self.HTTP_HEADER = {'User-Agent': 'Mozilla/5.0', 'Accept': 'text/html'}
        self.AJAX_HEADER = dict(self.HTTP_HEADER)
        self.AJAX_HEADER.update({'X-Requested-With': 'XMLHttpRequest'})

        self.COOKIE_FILE = GetCookieDir('wizjatv.cookie')

        self.http_params = {}
        self.http_params.update({
            'header': self.HTTP_HEADER,
            'save_cookie': True,
            'load_cookie': True,
            'cookiefile': self.COOKIE_FILE
        })
        self.loggedIn = False
Beispiel #15
0
    def __init__(self):
        CBaseHostClass.__init__(self)
        self.MAIN_URL = 'https://www.firstonetv.net/'
        self.DEFAULT_ICON_URL = self.getFullIconUrl('/images/logo.png')
        self.HTTP_HEADER = self.cm.getDefaultHeader(browser='chrome')

        self.COOKIE_FILE = GetCookieDir('firstonetv.net.cookie')

        self.http_params = {}
        self.http_params.update({
            'header': self.HTTP_HEADER,
            'save_cookie': True,
            'load_cookie': True,
            'cookiefile': self.COOKIE_FILE
        })
        self.loggedIn = False
        self.login = None
        self.password = None
Beispiel #16
0
 def _unshorten_vcryptnet(self, uri):
     try:
         COOKIE_FILE = GetCookieDir('vcrypt.net')
         params = {'header':HTTP_HEADER, 'use_cookie': True, 'load_cookie': True, 'save_cookie': True, 'cookiefile': COOKIE_FILE}
         params['cloudflare_params'] = { 'cookie_file':COOKIE_FILE, 'User-Agent':HTTP_HEADER['User-Agent']}
         sts, data = self.cm.getPageCFProtection(uri, params)
         uri = self.cm.ph.getDataBeetwenNodes(data, ('<a', '>', 'push_button'), ('</a', '>'))[1]
         
         printDBG("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
         printDBG(self.cm.meta['url'])
         printDBG("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
         uri = self.cm.meta['url']
         
         uri = self.cm.getFullUrl(uri, self.cm.getBaseUrl(self.cm.meta['url']))
         return uri, 'OK'
     except Exception as e:
         printExc()
         return uri, str(e)
Beispiel #17
0
    def __init__(self):
        CBaseHostClass.__init__(self)
        self.MAIN_URL = 'http://karwan.tv/'
        self.DEFAULT_ICON_URL = self.getFullUrl(
            'images/KARWAN_TV_LOGO/www.karwan.tv.png')
        self.HEADER = {'User-Agent': 'Mozilla/5.0', 'Accept': 'text/html'}
        self.AJAX_HEADER = dict(self.HEADER)
        self.AJAX_HEADER.update({'X-Requested-With': 'XMLHttpRequest'})

        self.COOKIE_FILE = GetCookieDir('karwantv.cookie')

        self.http_params = {}
        self.http_params.update({
            'header': self.HEADER,
            'save_cookie': True,
            'load_cookie': True,
            'cookiefile': self.COOKIE_FILE
        })
Beispiel #18
0
    def getCookieItem(self, key, url, params={}, post_data=None):

        cookiePath = GetCookieDir('tmp.cookie')
        params.update({
            'cookiefile': cookiePath,
            'use_cookie': True,
            'save_cookie': True
        })
        sts, data = self.cm.getPage(url, params, post_data)
        itemValue = ''
        if sts:
            # the LWP has problem to read prepared Cookie, so we will manually read them and add to header
            try:
                with open(cookiePath, 'r') as infile:
                    data = infile.read()
                    itemValue = re.search(' (%s=[^;]+?;)' % key, data).group(1)
            except:
                printExc()
        return itemValue
Beispiel #19
0
 def __init__(self):
     CBaseHostClass.__init__(self)
     self.sessionEx = MainSessionWrapper()
     self.MAIN_URL = 'http://www.wagasworld.com/'
     self.HTTP_HEADER = {
         'User-Agent':
         'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0',
         'Referer': self.MAIN_URL
     }
     self.COOKIE_FILE = GetCookieDir('wagasworld.cookie')
     self.http_params = {
         'header': dict(self.HTTP_HEADER),
         'save_cookie': True,
         'load_cookie': True,
         'cookiefile': self.COOKIE_FILE
     }
     self.DEFAULT_URL_ICON = self.getFullIconUrl(
         '/sites/default/files/styles/slideshow_full/public/12_0.jpg?itok=LHobtpyX'
     )
Beispiel #20
0
    def __init__(self, params={}):
        self.sessionEx = MainSessionWrapper()
        self.up = urlparser()

        proxyURL = params.get('proxyURL', '')
        useProxy = params.get('useProxy', False)
        if 'MozillaCookieJar' == params.get('cookie_type', ''):
            self.cm = common(proxyURL, useProxy, True)
        else:
            self.cm = common(proxyURL, useProxy)

        self.currList = []
        self.currItem = {}
        if '' != params.get('history', ''):
            self.history = CSearchHistoryHelper(
                params['history'], params.get('history_store_type', False))
        if '' != params.get('cookie', ''):
            self.COOKIE_FILE = GetCookieDir(params['cookie'])
        self.moreMode = False
        self.minPyVer = params.get('min_py_ver', 0)
Beispiel #21
0
    def __init__(self, params={}):
        self.USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0'
        self.HEADER = {'User-Agent': self.USER_AGENT, 'Connection': 'keep-alive'}
        if '' != params.get('cookie', ''):
            self.COOKIE_FILE = GetCookieDir(params['cookie'])
            self.defaultParams = {'header':self.HEADER, 'use_cookie': True, 'load_cookie': True, 'save_cookie': True, 'cookiefile': self.COOKIE_FILE}
        else:
            self.defaultParams = {'header':self.HEADER}
        self.sessionEx = MainSessionWrapper() 
        self.up = urlparser()
        self.ts_urlpars = ts_urlparser()
        proxyURL = params.get('proxyURL', '')
        useProxy = params.get('useProxy', False)
        self.cm = common(proxyURL, useProxy)

        self.currList = []
        self.currItem = {}
        if '' != params.get('history', ''):
            self.history = CSearchHistoryHelper(params['history'], params.get('history_store_type', False))
        self.moreMode = False
Beispiel #22
0
    def __init__(self):
        CBaseHostClass.__init__(self)
        self.MAIN_URL = 'http://www.bilasport.com/'
        self.DEFAULT_ICON_URL = 'https://turtleboysports.com/wp-content/uploads/2017/10/nhl-logo.jpg'
        self.HTTP_HEADER = {
            'User-Agent':
            'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36',
            'Accept': 'text/html',
            'Accept-Encoding': 'gzip, deflate'
        }
        self.AJAX_HEADER = dict(self.HTTP_HEADER)
        self.AJAX_HEADER.update({'X-Requested-With': 'XMLHttpRequest'})

        self.COOKIE_FILE = GetCookieDir('bilasport.pw.cookie')

        self.defaultParams = {
            'header': self.HTTP_HEADER,
            'save_cookie': True,
            'load_cookie': True,
            'cookiefile': self.COOKIE_FILE
        }
Beispiel #23
0
    def __init__(self):
        self.IE_NAME = 'bbc.co.uk'
        self._ID_REGEX = r'[pb][\da-z]{7}'
        self._VALID_URL = r'''(?x)
                        https?://
                            (?:www\.)?bbc\.co\.uk/
                            (?:
                                programmes/(?!articles/)|
                                iplayer(?:/[^/]+)?/(?:episode/|playlist/)|
                                music/clips[/#]|
                                radio/player/
                            )
                            (?P<id>%s)(?!/(?:episodes|broadcasts|clips))
                        ''' % self._ID_REGEX

        self._MEDIASELECTOR_URLS = [
            'http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/iptv-all/vpid/%s',
            'http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/pc/vpid/%s',
            'http://open.live.bbc.co.uk/mediaselector/4/mtis/stream/%s',
            'http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/journalism-pc/vpid/%s',
        ]

        self._MEDIASELECTOR_URLS_2 = self._MEDIASELECTOR_URLS

        InfoExtractor.__init__(self)
        self.COOKIE_FILE = GetCookieDir('bbciplayer.cookie')
        self.HEADER = {
            'User-Agent': 'Mozilla/5.0',
            'Accept':
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            'Accept-Encoding': 'gzip, deflate'
        }
        self.cm.HEADER = self.HEADER  # default header
        self.defaultParams = {
            'header': self.HEADER,
            'use_cookie': True,
            'load_cookie': True,
            'save_cookie': True,
            'cookiefile': self.COOKIE_FILE
        }
Beispiel #24
0
    def __init__(self):
        CBaseHostClass.__init__(self)
        self.MAIN_URL = 'https://www.webcamera.pl/'
        self.DEFAULT_ICON_URL = 'http://static.webcamera.pl/webcamera/img/loader-min.png'
        self.HEADER = {
            'User-Agent':
            'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:21.0) Gecko/20100101 Firefox/21.0',
            'Referer': self.getMainUrl(),
            'Accept': 'text/html'
        }
        self.AJAX_HEADER = dict(self.HEADER)
        self.AJAX_HEADER.update({'X-Requested-With': 'XMLHttpRequest'})

        self.COOKIE_FILE = GetCookieDir('webcamerapl')
        self.defaultParams = {
            'with_metadata': True,
            'header': self.HEADER,
            'save_cookie': True,
            'load_cookie': True,
            'cookiefile': self.COOKIE_FILE
        }
        self.cacheList = {}
Beispiel #25
0
    def __init__(self):
        CBaseHostClass.__init__(self)
        self.MAIN_URL = 'https://pilot.wp.pl/'
        self.API_BASE_URL = 'https://pilot.wp.pl/api/'
        self.STATIC_BASE_URL = 'https://static-pilot.wp.pl/'

        self.DEFAULT_ICON_URL = 'http://satkurier.pl/uploads/53612.jpg'
        self.USER_AGENT = 'ExoMedia 4.3.0 (43000) / Android 8.0.0 / foster_e'
        self.HTTP_HEADER = {
            'User-Agent': self.USER_AGENT,
            'Accept': 'application/json',
            'x-version': 'pl.videostar|3.53.0-gms|Android|26|foster_e',
            'content-type': 'application/json; charset=UTF-8',
            'Accept-Encoding': 'gzip, deflate'
        }
        self.AJAX_HEADER = dict(self.HTTP_HEADER)
        self.AJAX_HEADER.update({'X-Requested-With': 'XMLHttpRequest'})

        self.COOKIE_FILE = GetCookieDir('pilot.wp.pl.cookie')

        self.defaultParams = {}
        self.defaultParams.update({
            'header':
            self.HTTP_HEADER,
            'ignore_http_code_ranges': [(422, 422), (404, 404), (500, 500)],
            'save_cookie':
            True,
            'load_cookie':
            True,
            'cookiefile':
            self.COOKIE_FILE
        })
        self.loggedIn = False
        self.accountInfo = ''

        self.urlType = ''

        self.cacheChannelList = []
Beispiel #26
0
    def __init__(self):
        CBaseHostClass.__init__(self)
        self.MAIN_URL = 'http://www.livemass.net/'
        self.DEFAULT_ICON_URL = 'http://s3.amazonaws.com/livemass/warrington/images/warrington/iconclr.png'
        self.HTTP_HEADER = {
            'User-Agent':
            'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36',
            'Accept': 'text/html',
            'Accept-Encoding': 'gzip, deflate'
        }
        self.AJAX_HEADER = dict(self.HTTP_HEADER)
        self.AJAX_HEADER.update({'X-Requested-With': 'XMLHttpRequest'})

        self.COOKIE_FILE = GetCookieDir('livemass.net')

        self.defaultParams = {
            'header': self.HTTP_HEADER,
            'with_metadata': True,
            'save_cookie': True,
            'load_cookie': True,
            'cookiefile': self.COOKIE_FILE
        }
        self.linksCache = {}
    def __init__(self):
        printDBG("GroovesharkApi.__init__")
        self.cm = common()
        self.cm.HEADER = GroovesharkApi.JSON_HTTP_HEADER
        self.headerParams = {
            'use_cookie': True,
            'save_cookie': True,
            'load_cookie': True,
            'cookiefile': GetCookieDir('Grooveshark.com'),
            'raw_post_data': True
        }

        self.requestMacro = {}
        self.config = {}
        self.locales = {}
        self.loginData = {}
        self.secretKey = ""
        self.revToken = 'gooeyFlubber'
        self.currentToken = ''
        self.lastRandomizer = ''
        self.tokenExpires = 0
        self.lastApiError = {'code': 0, 'message': ''}

        self.cache = {}
Beispiel #28
0
    def __init__(self):
        CBaseHostClass.__init__(self)
        self.MAIN_URL = 'https://pilot.wp.pl/'
        self.API_BASE_URL = 'https://api-pilot.wp.pl/'
        self.STATIC_BASE_URL = 'https://static-pilot.wp.pl/'

        self.DEFAULT_ICON_URL = 'http://satkurier.pl/uploads/53612.jpg'
        self.USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36'
        self.HTTP_HEADER = {
            'User-Agent': self.USER_AGENT,
            'Accept': 'text/html',
            'Accept-Encoding': 'gzip, deflate'
        }
        self.AJAX_HEADER = dict(self.HTTP_HEADER)
        self.AJAX_HEADER.update({'X-Requested-With': 'XMLHttpRequest'})

        self.COOKIE_FILE = GetCookieDir('pilot.wp.pl.cookie')

        self.defaultParams = {}
        self.defaultParams.update({
            'header':
            self.HTTP_HEADER,
            'ignore_http_code_ranges': [(422, 422), (404, 404), (500, 500)],
            'save_cookie':
            True,
            'load_cookie':
            True,
            'cookiefile':
            self.COOKIE_FILE
        })
        self.loggedIn = False
        self.accountInfo = ''

        self.urlType = ''

        self.cacheChannelList = []
Beispiel #29
0
    def tryTologin(self):
        printDBG('tryTologin start')
        self.selectDomain()

        if None == self.loggedIn or self.login != config.plugins.iptvplayer.filmixco_login.value or\
            self.password != config.plugins.iptvplayer.filmixco_password.value:

            loginCookie = GetCookieDir('filmix.co.login')
            self.login = config.plugins.iptvplayer.filmixco_login.value
            self.password = config.plugins.iptvplayer.filmixco_password.value

            sts, data = self.getPage(self.getMainUrl())
            if sts: self.setMainUrl(self.cm.meta['url'])

            freshSession = False
            if sts and 'action=logout' in data:
                printDBG("Check hash")
                hash = hexlify(md5('%s@***@%s' % (self.login, self.password)).digest())
                prevHash = ReadTextFile(loginCookie)[1].strip()

                printDBG("$hash[%s] $prevHash[%s]" % (hash, prevHash))
                if hash == prevHash:
                    self.loggedIn = True
                    return
                else:
                    freshSession = True

            rm(loginCookie)
            rm(self.COOKIE_FILE)
            if freshSession:
                sts, data = self.getPage(self.getMainUrl(), MergeDicts(self.defaultParams, {'use_new_session':True}))

            self.loggedIn = False
            if '' == self.login.strip() or '' == self.password.strip():
                return False

            msgTab = [_('Login failed.')]
            if sts:
                actionUrl = self.getFullUrl('/engine/ajax/user_auth.php')
                post_data = {'login_name':self.login, 'login_password':self.password, 'login_not_save':'1', 'login':'******'}

                httpParams = dict(self.defaultParams)
                httpParams['header'] = MergeDicts(httpParams['header'], {'Referer':self.cm.meta['url'], 'Accept':'*/*', 'X-Requested-With':'XMLHttpRequest', 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'})

                sts, data = self.getPage(actionUrl, httpParams, post_data)
                printDBG(data)
                if sts: msgTab.append(ph.clean_html(data))
                sts, data = self.getPage(self.getMainUrl())

            if sts and 'action=logout' in data:
                printDBG('tryTologin OK')
                self.loggedIn = True
            else:
                printDBG(data)
                self.sessionEx.waitForFinishOpen(MessageBox, '\n'.join(msgTab), type = MessageBox.TYPE_ERROR, timeout = 10)
                printDBG('tryTologin failed')

            if self.loggedIn:
                hash = hexlify(md5('%s@***@%s' % (self.login, self.password)).digest())
                WriteTextFile(loginCookie, hash)

        return self.loggedIn
 def __init__(self):
     self.COOKIEFILE = GetCookieDir('spryciarze.cookie')
     self.cm = pCommon.common()
     self.catTree = []
     self.currList = []