<commit_before># coding: utf-8
from __future__ import unicode_literals

import re

from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
    ExtractorError,
    int_or_none,
)


class ViuBaseIE(InfoExtractor):
    def _real_initialize(self):
        viu_auth_res = self._request_webpage(
            'https://www.viu.com/api/apps/v2/authenticate', None,
            'Requesting Viu auth', query={
                'acct': 'test',
                'appid': 'viu_desktop',
                'fmt': 'json',
                'iid': 'guest',
                'languageid': 'default',
                'platform': 'desktop',
                'userid': 'guest',
                'useridtype': 'guest',
                'ver': '1.0'
            })
        self._auth_token = viu_auth_res.info()['X-VIU-AUTH']

    def _call_api(self, path, *args, **kwargs):
        headers = self.geo_verification_headers()
        headers.update({<commit_msg>[viu] pass geo verification headers to auth request<commit_after># coding: utf-8
from __future__ import unicode_literals

import re

from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
    ExtractorError,
    int_or_none,
)


class ViuBaseIE(InfoExtractor):
    def _real_initialize(self):
        viu_auth_res = self._request_webpage(
            'https://www.viu.com/api/apps/v2/authenticate', None,
            'Requesting Viu auth', query={
                'acct': 'test',
                'appid': 'viu_desktop',
                'fmt': 'json',
                'iid': 'guest',
                'languageid': 'default',
                'platform': 'desktop',
                'userid': 'guest',
                'useridtype': 'guest',
                'ver': '1.0'
            }, headers=self.geo_verification_headers())
        self._auth_token = viu_auth_res.info()['X-VIU-AUTH']

    def _call_api(self, path, *args, **kwargs):
        headers = self.geo_verification_headers()
        headers.update({
{'fraction_non_alphanumeric': 0.12856428214107055, 'fraction_numerical': 0.00400200100050025, 'mean_word_length': 2.058103975535168, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7030208', 'n_tokens_mistral': 639, 'n_tokens_neox': 604, 'n_words': 131}