@@ -530,7 +530,7 @@ def build_menu_from_page(self, url, path):
530530 pass
531531
532532 def build_episode_menu (self , video_id_or_urn , include_segments = True ,
533- segment_option = False , audio = False ):
533+ segment_option = False ):
534534 """
535535 Builds a list entry for a episode by a given video id.
536536 The segment entries for that episode can be included too.
@@ -544,11 +544,9 @@ def build_episode_menu(self, video_id_or_urn, include_segments=True,
544544 (default: True)
545545 segment_option -- Which segment option to use.
546546 (default: False)
547- audio -- boolean value to indicate if the episode is a
548- radio show (default: False)
549547 """
550548 self .log (f'build_episode_menu, video_id_or_urn = { video_id_or_urn } ' )
551- content_type = 'audio' if audio else ' video'
549+ content_type = 'video'
552550 if ':' in video_id_or_urn :
553551 json_url = 'https://il.srgssr.ch/integrationlayer/2.0/' \
554552 f'mediaComposition/byUrn/{ video_id_or_urn } .json'
@@ -606,12 +604,6 @@ def build_episode_menu(self, video_id_or_urn, include_segments=True,
606604 json_chapter , show_image_url = show_image_url ,
607605 show_poster_image_url = show_poster_image_url )
608606
609- if audio and chapter_index == 0 :
610- for aid in json_chapter_list [1 :]:
611- self .build_entry (
612- aid , show_image_url = show_image_url ,
613- show_poster_image_url = show_poster_image_url )
614-
615607 for segment in json_segment_list :
616608 self .build_entry (
617609 segment , show_image_url = show_image_url ,
@@ -733,7 +725,7 @@ def build_menu_by_urn(self, urn):
733725 'initialData' , 'pacPageConfigs' ,
734726 'topicPages' , urn , 'sections' ))
735727
736- def build_entry (self , json_entry , is_folder = False , audio = False ,
728+ def build_entry (self , json_entry , is_folder = False ,
737729 fanart = None , urn = None , show_image_url = None ,
738730 show_poster_image_url = None ):
739731 """
@@ -744,8 +736,6 @@ def build_entry(self, json_entry, is_folder=False, audio=False,
744736 json_entry -- the part of the json describing the video
745737 is_folder -- indicates if the item is a folder
746738 (default: False)
747- audio -- boolean value to indicate if the entry
748- contains audio (default: False)
749739 fanart -- fanart to be used instead of default image
750740 urn -- override urn from json_entry
751741 show_image_url -- url of the image of the show
@@ -801,17 +791,16 @@ def build_entry(self, json_entry, is_folder=False, audio=False,
801791 'banner' : show_image_url or image_url ,
802792 })
803793
804- if not audio :
805- subs = utils .try_get (
806- json_entry , 'subtitleList' , data_type = list , default = [])
807- if subs and self .subtitles :
808- subtitle_list = [
809- utils .try_get (x , 'url' ) for x in subs
810- if utils .try_get (x , 'format' ) == 'VTT' ]
811- if subtitle_list :
812- list_item .setSubtitles (subtitle_list )
813- else :
814- self .log (f'No WEBVTT subtitles found for video id { vid } .' )
794+ subs = utils .try_get (
795+ json_entry , 'subtitleList' , data_type = list , default = [])
796+ if subs and self .subtitles :
797+ subtitle_list = [
798+ utils .try_get (x , 'url' ) for x in subs
799+ if utils .try_get (x , 'format' ) == 'VTT' ]
800+ if subtitle_list :
801+ list_item .setSubtitles (subtitle_list )
802+ else :
803+ self .log (f'No WEBVTT subtitles found for video id { vid } .' )
815804
816805 # TODO:
817806 # Prefer urn over vid as it contains already all data
0 commit comments