]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/radiko.py
[cleanup] Misc
[yt-dlp.git] / yt_dlp / extractor / radiko.py
index 43eecba5f6cd6e34aa903fa5dfb2ce944bc34813..7fdf782831815370acab114b82f7f49c03f3c0d2 100644 (file)
@@ -133,9 +133,9 @@ def _extract_formats(self, video_id, station, is_onair, ft, cursor, auth_token,
                     'X-Radiko-AreaId': area_id,
                     'X-Radiko-AuthToken': auth_token,
                 })
-            not_preferred = is_onair and not pcu.startswith(self._HOSTS_FOR_LIVE) or (not is_onair and (pcu.startswith(self._HOSTS_FOR_TIME_FREE_FFMPEG_UNSUPPORTED) or pcu.startswith(self._HOSTS_FOR_LIVE)))
             for sf in subformats:
-                if not_preferred:
+                if (is_onair ^ pcu.startswith(self._HOSTS_FOR_LIVE)) or (
+                        not is_onair and pcu.startswith(self._HOSTS_FOR_TIME_FREE_FFMPEG_UNSUPPORTED)):
                     sf['preference'] = -100
                     sf['format_note'] = 'not preferred'
                 if not is_onair and url_attrib['timefree'] == '1' and time_to_skip: