Skip to content

CSQ provider

CQS

Used for download stump (TV Streaming) data (RemoteTVInput ServiceChannel on Smartglass)

pythonxbox.api.provider.cqs.CQSProvider(client)

Bases: BaseProvider

Source code in src/pythonxbox/api/provider/baseprovider.py
def __init__(self, client: "XboxLiveClient") -> None:
    """
    Initialize an the BaseProvider

    Args:
        client (:class:`XboxLiveClient`): Instance of XboxLiveClient
    """
    self.client = client

CQS_URL = 'https://cqs.xboxlive.com' class-attribute instance-attribute

HEADERS_CQS = {'Cache-Control': 'no-cache', 'Accept': 'application/json', 'Pragma': 'no-cache', 'x-xbl-client-type': 'Companion', 'x-xbl-client-version': '2.0', 'x-xbl-contract-version': '1.b', 'x-xbl-device-type': 'WindowsPhone', 'x-xbl-isautomated-client': 'true'} class-attribute instance-attribute

get_channel_list(locale_info, headend_id, **kwargs) async

Get stump channel list

Parameters:

Name Type Description Default
locale_info str

Locale string (format: "en-US")

required
headend_id str

Headend id

required

Returns:

Type Description
CqsChannelListResponse

class:CqsChannelListResponse: Channel List Response

Source code in src/pythonxbox/api/provider/cqs/__init__.py
async def get_channel_list(
    self, locale_info: str, headend_id: str, **kwargs
) -> CqsChannelListResponse:
    """
    Get stump channel list

    Args:
        locale_info: Locale string (format: "en-US")
        headend_id: Headend id

    Returns:
        :class:`CqsChannelListResponse`: Channel List Response
    """
    url = self.CQS_URL + f"/epg/{locale_info}/lineups/{headend_id}/channels"
    params = {"desired": "vesper_mobile_lineup"}
    resp = await self.client.session.get(
        url, params=params, headers=self.HEADERS_CQS, **kwargs
    )
    resp.raise_for_status()
    return CqsChannelListResponse.model_validate_json(resp.text)

get_schedule(locale_info, headend_id, start_date, duration_minutes, channel_skip, channel_count, **kwargs) async

Get stump epg data

Parameters:

Name Type Description Default
locale_info str

Locale string (format: "en-US")

required
headend_id str

Headend id

required
start_date str

Start date (format: 2016-07-11T21:50:00.000Z)

required
duration_minutes int

Schedule duration to download

required
channel_skip int

Count of channels to skip

required
channel_count int

Count of channels to get data for

required

Returns:

Type Description
CqsScheduleResponse

class:CqsScheduleResponse: Schedule Response

Source code in src/pythonxbox/api/provider/cqs/__init__.py
async def get_schedule(  # noqa: PLR0913
    self,
    locale_info: str,
    headend_id: str,
    start_date: str,
    duration_minutes: int,
    channel_skip: int,
    channel_count: int,
    **kwargs,
) -> CqsScheduleResponse:
    """
    Get stump epg data

    Args:
        locale_info: Locale string (format: "en-US")
        headend_id: Headend id
        start_date: Start date (format: 2016-07-11T21:50:00.000Z)
        duration_minutes: Schedule duration to download
        channel_skip: Count of channels to skip
        channel_count: Count of channels to get data for

    Returns:
        :class:`CqsScheduleResponse`: Schedule Response
    """
    url = self.CQS_URL + f"/epg/{locale_info}/lineups/{headend_id}/programs"
    params = {
        "startDate": start_date,
        "durationMinutes": duration_minutes,
        "channelSkip": channel_skip,
        "channelCount": channel_count,
        "desired": "vesper_mobile_schedule",
    }
    resp = await self.client.session.get(
        url, params=params, headers=self.HEADERS_CQS, **kwargs
    )
    resp.raise_for_status()
    return CqsScheduleResponse.model_validate_json(resp.text)