]> jfr.im git - yt-dlp.git/blobdiff - youtube_dl/extractor/turner.py
[tv2] detect DRM protection
[yt-dlp.git] / youtube_dl / extractor / turner.py
index 2b7b0d6e1b046d7184b194b5688af5295e3b8436..4a6cbfbb88d41dbb9d65a98eb4975e49a5ab0809 100644 (file)
@@ -15,6 +15,7 @@
     update_url_query,
     ExtractorError,
     strip_or_none,
+    url_or_none,
 )
 
 
@@ -154,8 +155,8 @@ def _extract_cvp_info(self, data_src, video_id, path_data={}, ap_data={}):
         subtitles = {}
         for source in video_data.findall('closedCaptions/source'):
             for track in source.findall('track'):
-                track_url = track.get('url')
-                if not isinstance(track_url, compat_str) or track_url.endswith('/big'):
+                track_url = url_or_none(track.get('url'))
+                if not track_url or track_url.endswith('/big'):
                     continue
                 lang = track.get('lang') or track.get('label') or 'en'
                 subtitles.setdefault(lang, []).append({