aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP-reducible <P-reducible@users.noreply.github.com>2022-03-08 20:42:00 +0100
committerGitHub <noreply@github.com>2022-03-08 11:42:00 -0800
commit9461cb586a07f06cd51dba1fe9d743dd7f5cff84 (patch)
treefb219f49c98d0033509a11b21913d27a40fd6d3c
parenta405b38f204fa1988e2d6930943525e42dd3d8d3 (diff)
downloadhypervideo-pre-9461cb586a07f06cd51dba1fe9d743dd7f5cff84.tar.lz
hypervideo-pre-9461cb586a07f06cd51dba1fe9d743dd7f5cff84.tar.xz
hypervideo-pre-9461cb586a07f06cd51dba1fe9d743dd7f5cff84.zip
[Rokfin] Fix `availability` (#1534)
Authored by: P-reducible
-rw-r--r--yt_dlp/extractor/rokfin.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/yt_dlp/extractor/rokfin.py b/yt_dlp/extractor/rokfin.py
index 79a5b2336..0fd65db4b 100644
--- a/yt_dlp/extractor/rokfin.py
+++ b/yt_dlp/extractor/rokfin.py
@@ -100,7 +100,7 @@ class RokfinIE(InfoExtractor):
video_url, video_id, fatal=False, live=live_status == 'is_live')
if not formats:
- if metadata.get('premiumPlan'):
+ if traverse_obj(metadata, 'premiumPlan', 'premium'):
self.raise_login_required('This video is only available to premium users', True, method='cookies')
elif scheduled:
self.raise_no_formats(
@@ -129,7 +129,7 @@ class RokfinIE(InfoExtractor):
'tags': traverse_obj(metadata, ('tags', ..., 'title'), expected_type=str_or_none),
'live_status': live_status,
'availability': self._availability(
- needs_premium=bool(metadata.get('premiumPlan')),
+ needs_premium=bool(traverse_obj(metadata, 'premiumPlan', 'premium')),
is_private=False, needs_subscription=False, needs_auth=False, is_unlisted=False),
# 'comment_count': metadata.get('numComments'), # Data provided by website is wrong
'__post_extractor': self.extract_comments(video_id) if video_type == 'post' else None,