]> jfr.im git - yt-dlp.git/commitdiff
[extractor/bravotv] Detect DRM (#7171)
authorbashonly <redacted>
Tue, 30 May 2023 15:43:01 +0000 (10:43 -0500)
committerGitHub <redacted>
Tue, 30 May 2023 15:43:01 +0000 (15:43 +0000)
Authored by: bashonly

yt_dlp/extractor/bravotv.py

index d4bf9b53b72e2f0015f34be5c470863bf7d15f5f..13cc1927f10193c877559aecc2b737f12c02be25 100644 (file)
@@ -1,5 +1,6 @@
 from .adobepass import AdobePassIE
 from ..utils import (
+    HEADRequest,
     extract_attributes,
     float_or_none,
     get_element_html_by_class,
@@ -153,8 +154,11 @@ def _real_extract(self, url):
         if len(chapters) == 1 and not traverse_obj(chapters, (0, 'end_time')):
             chapters = None
 
-        formats, subtitles = self._extract_m3u8_formats_and_subtitles(
-            update_url_query(f'{tp_url}/stream.m3u8', query), video_id, 'mp4', m3u8_id='hls')
+        m3u8_url = self._request_webpage(HEADRequest(
+            update_url_query(f'{tp_url}/stream.m3u8', query)), video_id, 'Checking m3u8 URL').geturl()
+        if 'mpeg_cenc' in m3u8_url:
+            self.report_drm(video_id)
+        formats, subtitles = self._extract_m3u8_formats_and_subtitles(m3u8_url, video_id, 'mp4', m3u8_id='hls')
 
         return {
             'id': video_id,