Skip to content

Commit

Permalink
Fixed: Missing __typename fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
basrieter committed Nov 5, 2023
1 parent c560db0 commit 90cf6c5
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion channels/channel.se/tv4se/chn_tv4se.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 90cf6c5

Please sign in to comment.