From 90cf6c52cd328052189bbb8164b405c995494bfa Mon Sep 17 00:00:00 2001 From: Bas Rieter Date: Sun, 5 Nov 2023 11:55:17 +0100 Subject: [PATCH] Fixed: Missing __typename fields. --- channels/channel.se/tv4se/chn_tv4se.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/channels/channel.se/tv4se/chn_tv4se.py b/channels/channel.se/tv4se/chn_tv4se.py index 52d9d755..7995a387 100644 --- a/channels/channel.se/tv4se/chn_tv4se.py +++ b/channels/channel.se/tv4se/chn_tv4se.py @@ -791,7 +791,22 @@ def __get_api_query(self, operation: str, variables: dict, use_get: bool = False query ContentDetailsPage($mediaId: ID!, $panelsInput: CdpPanelsInput!) { media(id: $mediaId) { ... on SportEvent { __typename id slug title league arena commentators country round season inStudio isLiveContent isStartOverEnabled humanCallToAction editorialInfoText synopsis { brief long } trailers { ...TrailerFields } playableFrom { humanDateTime isoString readableDate } playableUntil { readableDate } liveEventEnd { isoString } images { poster2x3 { ...ImageFieldsFull } main16x9 { ...ImageFieldsFull } logo { ...ImageFieldsLight } brandLogo { ...ImageFieldsLight } } upsell { tierId } } ... on Movie { __typename id slug title genres humanCallToAction isPollFeatureEnabled productionYear isLiveContent isStartOverEnabled liveEventEnd { isoString } productionCountries { countryCode name } playableFrom { isoString readableDate humanDateTime readableDistance } playableUntil { isoString readableDate } video { ...VideoFields } parentalRating { ...ParentalRatingFields } credits { ...MovieCreditsFields } images { poster2x3 { ...ImageFieldsFull } main16x9 { ...ImageFieldsFull } logo { ...ImageFieldsLight } brandLogo { ...ImageFieldsLight } } synopsis { brief long } trailers { ...TrailerFields } label { ...LabelFields } panels(input: $panelsInput) { ...CdpPanelsFields } hasPanels editorialInfoText upsell { tierId } } - ... on Series { __typename id slug title numberOfAvailableSeasons genres isPollFeatureEnabled upcomingEpisode { ...UpcomingEpisodeFields } trailers { ...TrailerFields } parentalRating { ...ParentalRatingFields } credits { ...SeriesCreditsFields } images { poster2x3 { ...ImageFieldsFull } main16x9 { ...ImageFieldsFull } logo { ...ImageFieldsLight } brandLogo { ...ImageFieldsLight } } synopsis { brief long } allSeasonLinks { seasonId title numberOfEpisodes } label { ...LabelFields } panels(input: $panelsInput) { ...CdpPanelsFields } hasPanels editorialInfoText upsell { tierId } } } + ... on Series { __typename id slug title numberOfAvailableSeasons genres isPollFeatureEnabled + upcomingEpisode { ...UpcomingEpisodeFields } + trailers { ...TrailerFields } + parentalRating { ...ParentalRatingFields } + credits { ...SeriesCreditsFields } + images { + poster2x3 { ...ImageFieldsFull } + main16x9 { ...ImageFieldsFull } + logo { ...ImageFieldsLight } + brandLogo { ...ImageFieldsLight } } + synopsis { brief long } + allSeasonLinks { __typename seasonId title numberOfEpisodes } + label { ...LabelFields } + panels(input: $panelsInput) { ...CdpPanelsFields } + hasPanels editorialInfoText upsell { tierId } } + } } %(TrailerFields)s %(ImageFieldsFull)s %(ImageFieldsLight)s %(VideoFields)s %(ParentalRatingFields)s %(MovieCreditsFields)s %(LabelFields)s %(CdpPanelsFields)s %(UpcomingEpisodeFields)s %(SeriesCreditsFields)s @@ -842,6 +857,10 @@ def __get_api_query(self, operation: str, variables: dict, use_get: bool = False query_lines = [l.strip() for l in query_lines] query = " ".join(query_lines) + # Perhaps add __typename to everything? + # query = query.replace("__typename ", "") + # query = query.replace("}", " __typename }") + if not use_get: data = { "operationName": operation,