-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathard.go
649 lines (610 loc) · 22 KB
/
ard.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
// oerc, alias oer-collector
// Copyright (C) 2021-2024 emschu[aet]mailbox.org
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public
// License along with this program.
// If not, see <https://www.gnu.org/licenses/>.
package main
import (
"encoding/base64"
"encoding/json"
"fmt"
"log"
"math"
"regexp"
"strings"
"sync/atomic"
"time"
)
const (
ardHost = "programm-api.ard.de"
ardHostWithPrefix = "https://" + ardHost
ardMediaThekApiHost = "api.ardmediathek.de"
ardMediaThekApiTvShowPath = "https://" + ardMediaThekApiHost + "/page-gateway/widgets/ard/editorials/"
ardDefaultImageWidth = "600"
)
var (
ardProgramURLMatcher = regexp.MustCompile(`^https:\/\/www\.ardmediathek\.de\/video\/.+`)
ardProgramPageMatcher = regexp.MustCompile(`^https:\/\/programm\-api\.ard\.de\/program\/api\/teaser\?teaserId=.+`)
ardImageLinkMatcher = regexp.MustCompile(`^https:\/\/api\.ardmediathek\.de\/image-service\/image.+`)
ardImageLinkMatcher2 = regexp.MustCompile(`^https:\/\/programm-api.ard.de\/images\/.+`)
ardTvShowCategories = []string{
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
"#",
}
)
// ARDParser struct of ard parser code
type ARDParser struct {
ParserInterface
Parser
}
// method to process a single day of a single channel
func (a *ARDParser) handleDay(channel Channel, day time.Time) {
db := a.db
flattenedProgramItems, done := a.fetchProgramItemsOfDay(channel, day)
if done {
return
}
var programEntryList = &[]ProgramEntry{}
// fill program entry list
for _, item := range flattenedProgramItems {
programEntry := ProgramEntry{}
eid := strings.TrimSpace(item.Id)
programEntry.Hash = buildHash([]string{
eid,
item.NumericId,
fmt.Sprintf("%d", int(channel.ID)),
fmt.Sprintf("%d", int(a.ChannelFamily.ID)),
"program-entry",
})
programEntry.TechnicalID = eid
// if there already is a program entry with this technical_id, use the original record
entry := ProgramEntry{}
db.Model(&entry).Where("hash = ?", programEntry.Hash).Where("channel_id = ?", channel.ID).Preload("ImageLinks").Find(&entry)
if entry.ID != 0 {
if entry.isRecentlyUpdated() {
atomic.AddUint64(&status.TotalSkippedPE, 1)
continue
}
programEntry = entry
}
// else create a new record
var entryTitle = trimAndSanitizeString(item.CoreTitle)
if item.CoreSubline != "" {
entryTitle += " - " + trimAndSanitizeString(item.CoreSubline)
}
programEntry.Title = entryTitle
programEntry.Description = trimAndSanitizeString(item.Synopsis)
var startDate, endDate = item.BroadcastedOn, item.BroadcastEnd
// atm it is not clear which information "BeginNet" contains - sometimes it seems to be the real broadcasting _end_ time.
//if !item.BeginNet.IsZero() {
// startDate = item.BeginNet
//}
if startDate.IsZero() || endDate.IsZero() || startDate.After(endDate) {
appLog(fmt.Sprintf("Invalid start date '%s' or end date '%s' for program entry with hash '%s'", startDate, endDate, programEntry.Hash))
atomic.AddUint64(&status.TotalSkippedPE, 1)
continue
}
programEntry.StartDateTime = &startDate
programEntry.EndDateTime = &endDate
programEntry.DurationMinutes = int16(programEntry.EndDateTime.Sub(*programEntry.StartDateTime).Minutes())
programEntry.URL = trimAndSanitizeString(item.Video.WebUrl)
if programEntry.URL != "" && !ardProgramURLMatcher.Match([]byte(programEntry.URL)) {
appLog(fmt.Sprintf("Invalid url '%s' for program entry with hash '%s'. Skipping.", programEntry.URL, programEntry.Hash))
atomic.AddUint64(&status.TotalSkippedPE, 1)
continue
}
programEntry.Homepage = trimAndSanitizeString(item.Links.Self.Href)
if programEntry.Homepage != "" && !ardProgramPageMatcher.Match([]byte(programEntry.Homepage)) {
appLog(fmt.Sprintf("Invalid home page '%s' for program entry with hash '%s'. Skipping.", programEntry.Homepage, programEntry.Hash))
atomic.AddUint64(&status.TotalSkippedPE, 1)
continue
}
// link channel and channel family
programEntry.ChannelID = channel.ID
programEntry.ChannelFamilyID = a.ChannelFamily.ID
// handle tags
if item.Grouping.Title != "" {
groupingTitle := trimAndSanitizeString(item.Grouping.Title)
programEntry.considerTagExists(&groupingTitle)
}
// image links
if item.Video.ImageUrl != "" && len(item.Video.ImageUrl) > 5 {
programEntry.considerImageLinkExists(item.Video.ImageUrl)
} else {
if item.Images.Aspect16X9.Src != "" && len(item.Images.Aspect16X9.Src) > 5 {
programEntry.considerImageLinkExists(strings.Replace(item.Images.Aspect16X9.Src, "{width}", ardDefaultImageWidth, 1))
} else if item.Images.Aspect1X1.Src != "" && len(item.Images.Aspect1X1.Src) > 5 {
programEntry.considerImageLinkExists(strings.Replace(item.Images.Aspect1X1.Src, "{width}", ardDefaultImageWidth, 1))
} else if item.Images.Aspect16X7.Src != "" && len(item.Images.Aspect16X7.Src) > 5 {
programEntry.considerImageLinkExists(strings.Replace(item.Images.Aspect16X7.Src, "{width}", ardDefaultImageWidth, 1))
}
}
if len(programEntry.ImageLinks) > 0 {
for _, img := range programEntry.ImageLinks {
if !ardImageLinkMatcher.MatchString(img.URL) && !ardImageLinkMatcher2.MatchString(img.URL) {
appLog(fmt.Sprintf("Found invalid image link '%s' for program entry with hash '%s'. Skipping.", img.URL, programEntry.Hash))
atomic.AddUint64(&status.TotalSkippedPE, 1)
continue
}
}
}
programEntry.saveProgramEntryRecord(db)
*programEntryList = append(*programEntryList, programEntry)
}
if verboseGlobal && len(*programEntryList) > 0 {
log.Printf("ard channel program list has %d entries\n", len(*programEntryList))
}
}
func (a *ARDParser) fetchProgramItemsOfDay(channel Channel, day time.Time) ([]ardApiChannelProgramItem, bool) {
formattedDate := day.Format("2006-01-02")
// the following line generated the URL we fetch the program entries of a single channel of a single day
url := fmt.Sprintf("%s/program/api/program?day=%s&channelIds=%s&mode=channel", ardHostWithPrefix, formattedDate, channel.Hash)
response, err := getArdApiResponseForDailyProgramByChannel[ardDailyProgramOfChannelResponse](url)
if err != nil {
appLog(fmt.Sprintf("error in call to ard url '%s': %v", url, err))
return nil, true
}
var flattenedProgramItems []ardApiChannelProgramItem
for _, channel := range response.Channels {
for _, slot := range channel.TimeSlots {
for _, item := range slot {
flattenedProgramItems = append(flattenedProgramItems, item)
}
}
}
if verboseGlobal {
log.Printf("Received response from url '%s': %v", url, response)
}
return flattenedProgramItems, false
}
func getArdApiResponseForDailyProgramByChannel[T any](url string) (*T, error) {
headers := map[string]string{}
resp, err := doGetRequest(url, headers, 3)
if resp == nil || err != nil {
errMsg := fmt.Sprintf("Problem fetching URL '%s' with error '%v'", url, err)
appLog(errMsg)
log.Println(errMsg)
return nil, err
}
var response T
jsonErr := json.Unmarshal([]byte(*resp), &response)
if jsonErr != nil {
errMsg := fmt.Sprintf("Invalid json format in ard api response. url: '%s'", url)
appLog(errMsg)
log.Println(errMsg)
return nil, jsonErr
}
return &response, nil
}
func getArdApiResponseForTvShows[T any](url string) (*T, error) {
headers := map[string]string{
"Host": ardMediaThekApiHost,
}
resp, err := doGetRequest(url, headers, 3)
if resp == nil || err != nil {
errMsg := fmt.Sprintf("Problem fetching URL '%s' with error '%v'", url, err)
appLog(errMsg)
log.Println(errMsg)
return nil, err
}
var response T
jsonErr := json.Unmarshal([]byte(*resp), &response)
if jsonErr != nil {
errMsg := fmt.Sprintf("Invalid json format in ard api response. url: '%s'", url)
appLog(errMsg)
log.Println(errMsg)
return nil, jsonErr
}
return &response, nil
}
// method to fetch all tv show data
func (a *ARDParser) fetchTVShows() {
if !appConf.EnableTVShowCollection || isRecentlyFetched() {
a.logRecentFetch("Skip update of ard tv shows")
return
}
// build set of urls to fetch tv shows from
var tvShowApiURLs = make([]string, 0)
for _, category := range ardTvShowCategories {
categoryString := strings.TrimSuffix(base64.StdEncoding.EncodeToString([]byte("ARD."+category)), "=")
tvShowApiURLs = append(tvShowApiURLs, fmt.Sprintf("%s%s", ardMediaThekApiTvShowPath, categoryString))
}
for _, apiUrl := range tvShowApiURLs {
response, err := getArdApiResponseForTvShows[ardApiTvShowResponse](fmt.Sprintf("%s?pageSize=10", apiUrl))
if err != nil {
appLog(fmt.Sprintf("Problem fetching URL for tv show:'%s'", apiUrl))
continue
}
var totalElementsOfCategory = response.Pagination.TotalElements
var ardApiPageSizeLimit = 200
var pageCount = int(math.Ceil(float64(totalElementsOfCategory / ardApiPageSizeLimit)))
for page := 0; page < pageCount; page++ {
response, err = getArdApiResponseForTvShows[ardApiTvShowResponse](fmt.Sprintf("%s?pageSize=%d&pageNumber=%d", apiUrl, ardApiPageSizeLimit, page))
for _, teaser := range response.Teasers {
var hash = buildHash([]string{
fmt.Sprintf("%d", int(a.ChannelFamily.ID)),
trimAndSanitizeString(teaser.LongTitle),
"tv-show",
})
url := teaser.Links.Self.Href
var tvShow = &TvShow{
ManagedRecord: ManagedRecord{
Title: trimAndSanitizeString(teaser.LongTitle),
URL: url,
Hash: hash,
Homepage: url,
ChannelFamily: a.ChannelFamily,
ChannelFamilyID: a.ChannelFamily.ID,
},
}
show := TvShow{}
a.db.Model(&TvShow{}).Where("hash = ?", hash).Find(&show)
if show.ID != 0 {
tvShow.ID = show.ID
}
tvShow.saveTvShowRecord(a.db)
}
}
}
}
// getTimeOfNextUpdate this function returns the next date time a fetch will take place considering the refresh interval of the configuration
func getTimeOfNextUpdate() time.Time {
now := time.Now()
if !isRecentlyFetched() || GetAppConf().ForceUpdate {
return now
}
// it is recently fetched, return last update + refresh interval
set := getSetting(settingKeyLastFetch)
if set != nil && set.ID != 0 && len(set.Value) > 0 {
lastUpdateTime, err := time.Parse(time.RFC3339, set.Value)
if err != nil {
log.Printf("Could not parse '%s' as date", set.Value)
return now
}
location, _ := time.LoadLocation(GetAppConf().TimeZone)
lastUpdateTime = lastUpdateTime.In(location)
return lastUpdateTime.Add(time.Duration(GetAppConf().TimeToRefreshInMinutes) * time.Minute)
}
return now
}
// method which is called after the program entries and tv shows are fetched
func (a *ARDParser) postProcess() {}
// preProcess implementation
func (a *ARDParser) preProcess() bool {
a.parallelWorkersCount = 10
return true
}
func (a *ARDParser) isDateValidToFetch(day *time.Time) (bool, error) {
if day == nil {
return false, fmt.Errorf("invalid day")
}
if a.isMoreThanXDaysInFuture(day, 8) { // = six weeks in future + today
return false, fmt.Errorf("maximum for days in future for ARD is 8")
}
if a.isMoreThanXDaysInPast(day, 8) {
return false, fmt.Errorf("maximum for days in past for ARD is 8")
}
return true, nil
}
type ardDailyProgramOfChannelResponse struct {
Links struct {
Self struct {
Type string `json:"type"`
Title string `json:"title"`
Href string `json:"href"`
} `json:"self"`
} `json:"links"`
Channels []ardApiChannel `json:"channels"`
TrackingPiano struct {
PageTitle string `json:"page_title"`
PageInstitutionId string `json:"page_institution_id"`
PageInstitution string `json:"page_institution"`
PageChapter2 string `json:"page_chapter2"`
PageChapter1 string `json:"page_chapter1"`
PageId string `json:"page_id"`
} `json:"trackingPiano"`
TimeSlots []struct {
Title string `json:"title"`
HeightUnits int `json:"heightUnits"`
EndDate string `json:"endDate"`
StartDate time.Time `json:"startDate"`
} `json:"timeSlots"`
CreationDate time.Time `json:"creationDate"`
}
type ardApiChannel struct {
Id string `json:"id"`
TrackingPiano struct {
WidgetType string `json:"widget_type"`
WidgetTitle string `json:"widget_title"`
WidgetId string `json:"widget_id"`
} `json:"trackingPiano"`
TimeSlots [][]ardApiChannelProgramItem `json:"timeSlots"`
PublicationService struct {
Name string `json:"name"`
Partner string `json:"partner"`
} `json:"publicationService"`
Crid string `json:"crid"`
LocalChannelList []struct {
Id string `json:"id"`
Name string `json:"name"`
Crid string `json:"crid"`
LocalDefault bool `json:"localDefault,omitempty"`
} `json:"localChannelList"`
}
type ardApiChannelProgramItem struct {
Id string `json:"id"`
Links struct {
Self struct {
Type string `json:"type"`
Title string `json:"title"`
Href string `json:"href"`
} `json:"self"`
Target struct {
Type string `json:"type"`
Title string `json:"title"`
UrlId string `json:"urlId"`
Partner string `json:"partner"`
} `json:"target,omitempty"`
} `json:"links"`
Type string `json:"type"`
Title string `json:"title"`
Duration int `json:"duration"`
Channel struct {
Id string `json:"id"`
Name string `json:"name"`
MainChannelId string `json:"main_channel_id"`
LocalDefault bool `json:"localDefault,omitempty"`
} `json:"channel"`
TrackingPiano struct {
WidgetSection string `json:"widget_section"`
TeaserTitle string `json:"teaser_title"`
TeaserRecommended bool `json:"teaser_recommended"`
TeaserInstitutionId string `json:"teaser_institution_id"`
TeaserInstitution string `json:"teaser_institution"`
TeaserId string `json:"teaser_id"`
TeaserContentType string `json:"teaser_content_type"`
TeaserRegion string `json:"teaser_region,omitempty"`
} `json:"trackingPiano"`
CreationDate time.Time `json:"creationDate"`
HeightUnits int `json:"heightUnits"`
BeginNet time.Time `json:"beginNet"`
BinaryFeatures []string `json:"binaryFeatures,omitempty"`
MaturityContentRating string `json:"maturityContentRating,omitempty"`
BroadcastEnd time.Time `json:"broadcastEnd"`
BroadcastedOn time.Time `json:"broadcastedOn"`
CoreSubline string `json:"coreSubline"`
CoreTitle string `json:"coreTitle"`
LastMod time.Time `json:"lastMod"`
NumericId string `json:"numericId"`
Subline string `json:"subline,omitempty"`
Grouping struct {
Title string `json:"title"`
URL string `json:"url"`
} `json:"grouping,omitempty"`
Images struct {
Aspect16X9 struct {
Title string `json:"title"`
Text string `json:"text"`
Alt string `json:"alt"`
Src string `json:"src"`
ProducerName string `json:"producerName"`
} `json:"aspect16x9"`
Aspect1X1 struct {
Title string `json:"title"`
Text string `json:"text"`
Alt string `json:"alt"`
Src string `json:"src"`
ProducerName string `json:"producerName"`
} `json:"aspect1x1"`
Aspect16X7 struct {
Title string `json:"title"`
Text string `json:"text"`
Alt string `json:"alt"`
Src string `json:"src"`
ProducerName string `json:"producerName"`
} `json:"aspect16x7"`
} `json:"images,omitempty"`
Video struct {
AvailableFrom time.Time `json:"availableFrom"`
AvailableTo time.Time `json:"availableTo"`
BroadcastedOn time.Time `json:"broadcastedOn"`
CreatedAt time.Time `json:"createdAt"`
CreatedBy interface{} `json:"createdBy"`
Duration int `json:"duration"`
EpisodeNumber *int `json:"episodeNumber"`
ExternalMedia []struct {
MediaType string `json:"mediaType"`
Ratio string `json:"ratio"`
Type string `json:"type"`
Url string `json:"url"`
Versions []struct {
Ratio string `json:"ratio"`
Url string `json:"url"`
} `json:"versions"`
} `json:"externalMedia"`
Extras []struct {
Index interface{} `json:"index"`
Text string `json:"text"`
Type string `json:"type"`
} `json:"extras"`
Fsk string `json:"fsk"`
GroupingId string `json:"groupingId,omitempty"`
GroupingTitle *string `json:"groupingTitle"`
GroupingWebUrl string `json:"groupingWebUrl,omitempty"`
Id string `json:"id"`
ImageCredit *string `json:"imageCredit"`
ImageUrl string `json:"imageUrl"`
IsTrailer bool `json:"isTrailer"`
SeasonNumber interface{} `json:"seasonNumber"`
SingleReport bool `json:"singleReport"`
Source string `json:"source"`
SourceId string `json:"sourceId"`
SourceUpdatedAt time.Time `json:"sourceUpdatedAt"`
TagIds []interface{} `json:"tagIds"`
Text struct {
Short string `json:"short"`
} `json:"text"`
Title string `json:"title"`
UpdatedAt time.Time `json:"updatedAt"`
UpdatedBy interface{} `json:"updatedBy"`
WebUrl string `json:"webUrl"`
} `json:"video,omitempty"`
Synopsis string `json:"synopsis,omitempty"`
IsLocal bool `json:"isLocal,omitempty"`
Split bool `json:"split,omitempty"`
Live bool `json:"live,omitempty"`
BlockDuration int `json:"blockDuration,omitempty"`
SplitPart int `json:"splitPart,omitempty"`
TrackingSplit int `json:"trackingSplit,omitempty"`
}
type ardApiTvShowResponse struct {
AZContent bool `json:"aZContent"`
CompilationType string `json:"compilationType"`
Id string `json:"id"`
IsChildContent bool `json:"isChildContent"`
Pagination struct {
PageNumber int `json:"pageNumber"`
PageSize int `json:"pageSize"`
TotalElements int `json:"totalElements"`
} `json:"pagination"`
Personalized bool `json:"personalized"`
Links struct {
Self struct {
Id string `json:"id"`
UrlId string `json:"urlId"`
Title string `json:"title"`
Href string `json:"href"`
Type string `json:"type"`
Partner string `json:"partner"`
} `json:"self"`
} `json:"links"`
Size string `json:"size"`
Swipeable bool `json:"swipeable"`
Teasers []ardApiTvShowTeaser `json:"teasers"`
Title string `json:"title"`
TitleVisible bool `json:"titleVisible"`
TrackingPiano struct {
TeaserRecommended bool `json:"teaser_recommended"`
WidgetId string `json:"widget_id"`
WidgetTitle string `json:"widget_title"`
WidgetTyp string `json:"widget_typ"`
} `json:"trackingPiano"`
Type string `json:"type"`
UserVisibility string `json:"userVisibility"`
}
type ardApiTvShowTeaser struct {
AvailableSeasons []string `json:"availableSeasons,omitempty"`
BinaryFeatures []string `json:"binaryFeatures,omitempty"`
CoreAssetType string `json:"coreAssetType,omitempty"`
Id string `json:"id"`
Images struct {
Aspect16X9 struct {
Alt string `json:"alt"`
ProducerName string `json:"producerName"`
Src string `json:"src"`
Title string `json:"title"`
} `json:"aspect16x9"`
Aspect16X7 struct {
Alt string `json:"alt"`
ProducerName string `json:"producerName"`
Src string `json:"src"`
Title string `json:"title"`
} `json:"aspect16x7,omitempty"`
Aspect1X1 struct {
Alt string `json:"alt"`
ProducerName string `json:"producerName"`
Src string `json:"src"`
Title string `json:"title"`
} `json:"aspect1x1,omitempty"`
Aspect3X4 struct {
Alt string `json:"alt"`
ProducerName string `json:"producerName"`
Src string `json:"src"`
Title string `json:"title"`
} `json:"aspect3x4,omitempty"`
} `json:"images"`
IsChildContent bool `json:"isChildContent"`
IsFamilyFriendly bool `json:"isFamilyFriendly,omitempty"`
LongTitle string `json:"longTitle"`
MediumTitle string `json:"mediumTitle"`
Personalized bool `json:"personalized"`
Playtime interface{} `json:"playtime"`
PublicationService struct {
Name string `json:"name"`
Logo struct {
Title string `json:"title"`
Alt string `json:"alt"`
ProducerName string `json:"producerName"`
Src string `json:"src"`
AspectRatio string `json:"aspectRatio"`
} `json:"logo"`
PublisherType string `json:"publisherType"`
Partner string `json:"partner"`
Id string `json:"id"`
CoreId string `json:"coreId"`
} `json:"publicationService,omitempty"`
Links struct {
Self struct {
Id string `json:"id"`
UrlId string `json:"urlId"`
Title string `json:"title"`
Href string `json:"href"`
Type string `json:"type"`
Partner string `json:"partner"`
} `json:"self"`
Target struct {
Id string `json:"id"`
UrlId string `json:"urlId"`
Title string `json:"title"`
Href string `json:"href"`
Type string `json:"type"`
Partner string `json:"partner"`
} `json:"target"`
} `json:"links"`
ShortTitle string `json:"shortTitle"`
TitleVisible bool `json:"titleVisible"`
TrackingPiano struct {
TeaserContentType string `json:"teaser_content_type"`
TeaserId string `json:"teaser_id"`
TeaserInstitution string `json:"teaser_institution"`
TeaserInstitutionId string `json:"teaser_institution_id"`
TeaserTitle string `json:"teaser_title"`
} `json:"trackingPiano"`
Type string `json:"type"`
}