@@ -104,21 +104,34 @@ def _set_seek_time(value):
104104 elif channel_id or channel_name :
105105 if channel_name and not channel_id :
106106 result = api .get_user_ids (channel_name )
107- result = result . get ( Keys . DATA , [{}])[ 0 ]
108- channel_id = result . get ( Keys . ID )
107+ if result :
108+ channel_id = result [ 0 ]
109109 if channel_id :
110110 if not quality :
111111 quality = utils .get_default_quality ('stream' , channel_id )
112112 if quality :
113113 quality = quality [str (channel_id )]['quality' ]
114+ id_only = False
114115 result = api .get_channel_stream (channel_id )[Keys .DATA ]
115116 if result :
116117 result = result [0 ]
117118 channel_name = result [Keys .USER_NAME ] \
118119 if result [Keys .USER_NAME ] else result [Keys .USER_LOGIN ]
119120 name = result [Keys .USER_LOGIN ]
121+ else : # rerun
122+ user = api .get_users (user_ids = channel_id )
123+ if user .get (Keys .DATA , [{}]):
124+ user = user [Keys .DATA ][0 ]
125+ id_only = True
126+ name = user .get (Keys .LOGIN )
127+ result = {
128+ Keys .USER_NAME : user .get (Keys .DISPLAY_NAME , Keys .LOGIN ),
129+ Keys .USER_LOGIN : user .get (Keys .LOGIN ),
130+ Keys .USER_ID : user .get (Keys .ID ),
131+ } # make a dummy result to continue with playback
132+ if name :
120133 videos = api .get_live (name )
121- item_dict = converter .stream_to_playitem (result )
134+ item_dict = converter .stream_to_playitem (result , id_only = id_only )
122135 is_live = True
123136 elif slug :
124137 result = api .get_clip_by_slug (slug )
0 commit comments