def __init__(self, http_client, media_type_url, resource_class): if not media_type_url: raise MissingArgumentError('media_type_url must be given') if not resource_class: raise MissingArgumentError('resource_class must be given') self.media_type_url = media_type_url self.resource_class = resource_class super().__init__(http_client=http_client, relative_url=self.BASE_ENDPOINT_URL, class_=self.resource_class) self.CustomTag = MediaCustomTag(http_client=http_client)
def __init__(self, http_client, type_url, resource_class): if not type_url: raise MissingArgumentError('type_url must be given') if not resource_class: raise MissingArgumentError('resource_class must be given') self.type_url = type_url self.resource_class = resource_class super().__init__(http_client=http_client, relative_url=self.BASE_ENDPOINT_URL, class_=self.resource_class)
def _get_endpoint_url(self, encoding_id, stream_id): if not encoding_id: raise MissingArgumentError('encoding_id must be given') if not stream_id: raise MissingArgumentError('stream_id must be given') endpoint_url = self.BASE_ENDPOINT_URL\ .replace('{encoding_id}', encoding_id)\ .replace('{stream_id}', stream_id) return endpoint_url
def _get_endpoint_url(self, encoding_id, muxing_id): if not encoding_id: raise MissingArgumentError('encoding_id must be given') if not muxing_id: raise MissingArgumentError('muxing_id must be given') endpoint_url = self.BASE_ENDPOINT_URL\ .replace('{encoding_id}', encoding_id)\ .replace('{muxing_type}', self.muxing_type_url)\ .replace('{muxing_id}', muxing_id)\ .replace('{drm_type}', self.drm_type_url) return endpoint_url
def __init__(self, http_client, manifest_type, resource_class): if not manifest_type: raise MissingArgumentError('manifest_type must be given') if not resource_class: raise MissingArgumentError('resource_class must be given') self.manifest_type = manifest_type self.resource_class = resource_class self.relative_url = self.BASE_ENDPOINT_URL.replace( '{manifest_type}', manifest_type) super().__init__(http_client=http_client, relative_url=self.relative_url, class_=resource_class)
def check_not_blank(cls, argument): if not argument: raise MissingArgumentError('argument must not be blank') if not isinstance(argument, str): raise InvalidTypeError('argument must be an str') if argument == '': raise InvalidTypeError('argument must not be blank')
def _get_endpoint_url(self, manifest_id): if not manifest_id: raise MissingArgumentError('manifest_id must be given') endpoint_url = self.BASE_ENDPOINT_URL\ .replace('{manifest_id}', manifest_id)\ .replace('{media_type}', self.media_type_url) return endpoint_url
def __init__(self, http_client, muxing_type_url): if not muxing_type_url: raise MissingArgumentError('muxing_type_url must be specified!') super().__init__(http_client=http_client, muxing_type_url=muxing_type_url, drm_type_url='widevine', resource_class=WidevineDRMResource)
def __init__(self, http_client, muxing_type_url): if not muxing_type_url: raise MissingArgumentError('muxing_type_url must be specified!') super().__init__(http_client=http_client, muxing_type_url=muxing_type_url, id3_type_url='plain-text', resource_class=PlainTextID3TagResource)
def __init__(self, http_client, muxing_type_url): if not muxing_type_url: raise MissingArgumentError('muxing_type_url must be specified!') super().__init__(http_client=http_client, muxing_type_url=muxing_type_url, id3_type_url='frame-id', resource_class=FrameIdID3TagResource)
def __init__(self, api_key, base_url=None): super().__init__() if base_url: self.base_url = base_url else: self.base_url = self.API_BASE_URL if not api_key: raise MissingArgumentError( "api_key has to be set when instantiating BitmovinRestClient.") self.http_headers = self.HTTP_HEADERS.copy() self.http_headers.update({self.API_KEY_HTTP_HEADER_NAME: api_key})
def check_not_none(cls, argument): if not argument: raise MissingArgumentError('argument must not be blank') if argument is None: raise MissingArgumentError('argument must not be blank')
def check_arg_valid_uuid(cls, argument): if not argument: raise MissingArgumentError('argument must be an UUID') if not isinstance(argument, str): raise InvalidTypeError('argument must be an UUID')
def _get_endpoint_url(self, encoding_id): if not encoding_id: raise MissingArgumentError('encoding_id must be given') return self.BASE_ENDPOINT_URL.replace('{encoding_id}', encoding_id)
def _get_endpoint_url(self, license_id): if not license_id: raise MissingArgumentError('license_id must be given') endpoint_url = self.BASE_ENDPOINT_URL.replace('{license_id}', license_id) return endpoint_url