Example #1
0
 def resolve(self, url, resolverList):
     try:
         logger.debug('ORIGINAL URL [%s]' % url, __name__)
         result = client.request(url, headers=self.headers)
         playdata = 'window.pl_data = (\{.*?"key":.*?\}\})'
         result = re.findall(playdata, result)[0]
         try:
             result = json.loads(result)
             link = result['live']['channel_list'][0]['file']
             key = result['live']['key']
             link = link.decode('base64')
             key = key.decode('base64')
             de = pyaes.new(key, pyaes.MODE_CBC, IV='\0' * 16)
             link = de.decrypt(link).replace('\x00', '').split('\0')[0]
             link = re.sub('[^\s!-~]', '', link)
         except:
             link = client.parseDOM(result,
                                    "source",
                                    attrs={"type": "application/x-mpegurl"},
                                    ret="src")[0]
         logger.debug('URL : [%s]' % link, __name__)
         url = '%s|Referer=%s' % (link.strip(), url)
         result = client.validateUrl(url)
         logger.debug('RESOLVED URL [%s]' % url, __name__)
         return url
     except:
         return False
Example #2
0
 def resolve(self, url, resolverList):
     logger.debug('ORIGINAL URL [%s]' % url, __name__)
     url = '%s%s|User-Agent=%s' % (url, self.getSwiftAuth(url),
                                   self.getSwiftPlayUserAgent())
     result = client.validateUrl(url)
     logger.debug('RESOLVED URL [%s]' % url, __name__)
     return url
Example #3
0
    def resolve(self, url, resolverList):
        logger.debug('ORIGINAL URL [%s]' % url, __name__)
        u = None
        '''
        try :
            #headers = {'User-agent': 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10'}
            agent = cache.get(client.randomagent, 1)
            headers = {'User-agent': agent}
            result = client.request('https://cinefuntv.com/watchnow.php?content=%s' % url, headers=headers, redirect=False)
            u =  re.findall('var cms_url = [\'"](.*?)[\'"]', result)[0]
            u += '|%s' % urllib.urlencode({'User-agent': agent})
            url = u
        except:
            u = None
        '''

        if u == None:
            try:
                headers = {
                    'User-agent':
                    base64.b64decode(
                        'Q0ZVTlRWLzMuMSBDRk5ldHdvcmsvNzU4LjAuMiBEYXJ3aW4vMTUuMC4w'
                    )
                }
                result = client.request(base64.b64decode(
                    'aHR0cHM6Ly9jaW5lZnVudHYuY29tL3NtdGFsbmMvY29udGVudC5waHA/Y21kPWRldGFpbHMmQCZkZXZpY2U9aW9zJnZlcnNpb249MCZjb250ZW50aWQ9JXMmc2lkPSZ1PWMzMjgxOTMwQHRyYnZuLmNvbQ=='
                ) % url,
                                        headers=headers,
                                        redirect=False)
                links = json.loads(result)
                u = links[0]['HLSURL']
                if u == '':
                    u = links[0]['SamsungURL']
                if u == '':
                    u = links[0]['PanasonicURL']
                u += "|%s" % urllib.urlencode({
                    'User-Agent':
                    'AppleCoreMedia/1.0.0.13A452 (iPhone; U; CPU OS 9_0_2 like Mac OS X; en_gb)'
                })
                url = u
            except:
                url = None
        result = client.validateUrl(url)
        logger.debug('RESOLVED URL [%s]' % url, __name__)
        return url
Example #4
0
    def resolve(self, url, resolverList):
        try:
            logger.debug('ORIGINAL URL [%s]' % url, __name__)
            authToken = self.getAuthToken()
            logger.debug('AuthToken %s' % authToken, __name__)
            url += authToken
            if '|' not in url:
                url += '|'

            import random
            useragent = 'User-Agent=AppleCoreMedia/1.0.0.%s (%s; U; CPU OS %s like Mac OS X; en_gb)' % (
                random.choice([
                    '13G35', '13G36', '14A403', '14A456', '14B72', '14B150'
                ]), random.choice(['iPhone', 'iPad', 'iPod']),
                random.choice(['9.3.4', '9.3.5', '10.0.2', '10.1', '10.1.1']))
            url += useragent
            result = client.validateUrl(url)
            logger.debug('RESOLVED URL [%s]' % url, __name__)
            return url
        except Exception as e:
            logger.error(e)
            return False
Example #5
0
 def resolve(self, url, resolverList):
     result = client.validateUrl(url)
     return url