Пример #1
0
    def play(self, account, reference, live):
        self._refresh_token()

        params = {
            'appId': '7plus',
            'deviceType': 'android',
            'platformType': 'app',
            'accountId': account,
            'referenceId': reference,
            'deliveryId': 'csai',
            # 'ppId': '',
            # 'deviceId': '71aa8979-75b0-4393-ad93-239d368ed79d',
            # 'pc': 3350,
            # 'advertid': 'null',
            # 'videoType': 'live',
            # 'tvid': 'null',
            # 'ozid': 'abda324c-31bd-473f-8633-0cdd8bdbf780',
        }

        if live:
            params['videoType'] = 'live'

        data = self._session.get('https://videoservice.swm.digital/playback',
                                 params=params).json()
        if 'media' not in data:
            raise APIError(data[0]['error_code'])

        return process_brightcove(data['media'])
Пример #2
0
    def get_brightcove_src(self, referenceID):
        brightcove_url = BRIGHTCOVE_URL.format(BRIGHTCOVE_ACCOUNT, referenceID)

        resp = self._session.get(brightcove_url,
                                 headers={'BCOV-POLICY': BRIGHTCOVE_KEY})
        data = resp.json()

        return util.process_brightcove(data)
Пример #3
0
    def get_brightcove_src(self, reference):
        if not reference.isdigit():
            reference = 'ref:{}'.format(reference)

        brightcove_url = BRIGHTCOVE_URL.format(BRIGHTCOVE_ACCOUNT, reference)
        resp = self._session.get(brightcove_url,
                                 headers={'BCOV-POLICY': BRIGHTCOVE_KEY})
        return util.process_brightcove(resp.json())
Пример #4
0
    def get_brightcove_src(self, bc_accont, referenceID):
        headers = {
            'User-Agent':
            'Mozilla/5.0 (CrKey armv7l 1.5.16041) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.0 Safari/537.36',
            'Origin': 'https://www.supercars.com',
            'X-Forwarded-For': '18.233.21.73',
            'BCOV-POLICY': BRIGHTCOVE_KEY,
        }

        brightcove_url = BRIGHTCOVE_URL.format(bc_accont, referenceID)
        data = Session().get(brightcove_url, headers=headers).json()
        return util.process_brightcove(data)