aboutsummaryrefslogtreecommitdiff
path: root/youtube_dlc/extractor/wakanim.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2021-02-12 10:04:04 +0530
committerpukkandan <pukkandan@gmail.com>2021-02-12 20:32:49 +0530
commit068693675ef45c6f0b752c53d8810193d33dc712 (patch)
tree9c7093d8610a1be34290fc7f74799ccc36feb590 /youtube_dlc/extractor/wakanim.py
parent1ea241292770c6027b951aa045e00eadd140b9f5 (diff)
Cleanup some code and fix typos
:ci skip dl
Diffstat (limited to 'youtube_dlc/extractor/wakanim.py')
-rw-r--r--youtube_dlc/extractor/wakanim.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/youtube_dlc/extractor/wakanim.py b/youtube_dlc/extractor/wakanim.py
index a8963d769..507a28feb 100644
--- a/youtube_dlc/extractor/wakanim.py
+++ b/youtube_dlc/extractor/wakanim.py
@@ -41,12 +41,13 @@ class WakanimIE(InfoExtractor):
m3u8_url = urljoin(url, self._search_regex(
r'file\s*:\s*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage, 'm3u8 url',
group='url'))
- # https://docs.microsoft.com/en-us/azure/media-services/previous/media-services-content-protection-overview#streaming-urls
- encryption = self._search_regex(
- r'encryption%3D(c(?:enc|bc(?:s-aapl)?))',
- m3u8_url, 'encryption', default=None)
- if not self._downloader.params.get('allow_unplayable_formats') and encryption and encryption in ('cenc', 'cbcs-aapl'):
- raise ExtractorError('This video is DRM protected.', expected=True)
+ if not self._downloader.params.get('allow_unplayable_formats'):
+ # https://docs.microsoft.com/en-us/azure/media-services/previous/media-services-content-protection-overview#streaming-urls
+ encryption = self._search_regex(
+ r'encryption%3D(c(?:enc|bc(?:s-aapl)?))',
+ m3u8_url, 'encryption', default=None)
+ if encryption in ('cenc', 'cbcs-aapl'):
+ raise ExtractorError('This video is DRM protected.', expected=True)
formats = self._extract_m3u8_formats(
m3u8_url, video_id, 'mp4', entry_protocol='m3u8_native',