aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Ritchie <luc.ritchie@gmail.com>2021-08-30 11:35:48 -0400
committerGitHub <noreply@github.com>2021-08-30 21:05:48 +0530
commit875cfb8cbc4c14f204d636760134400d3cea20a0 (patch)
tree98dafe1e261c0a17558fe4204ff1c93cef51cc52
parentb8773e63f01510a254a40b8d4d3018414b52eda7 (diff)
downloadhypervideo-pre-875cfb8cbc4c14f204d636760134400d3cea20a0.tar.lz
hypervideo-pre-875cfb8cbc4c14f204d636760134400d3cea20a0.tar.xz
hypervideo-pre-875cfb8cbc4c14f204d636760134400d3cea20a0.zip
[afreecatv] Fix adult VODs (#831)
Original PR: https://github.com/ytdl-org/youtube-dl/pull/28405 Fixes https://github.com/ytdl-org/youtube-dl/issues/26622, https://github.com/ytdl-org/youtube-dl/issues/26926 Authored by: wlritchi
-rw-r--r--yt_dlp/extractor/afreecatv.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/yt_dlp/extractor/afreecatv.py b/yt_dlp/extractor/afreecatv.py
index 648f1122d..d45bcb762 100644
--- a/yt_dlp/extractor/afreecatv.py
+++ b/yt_dlp/extractor/afreecatv.py
@@ -237,6 +237,7 @@ class AfreecaTVIE(InfoExtractor):
r'nTitleNo\s*=\s*(\d+)', webpage, 'title', default=video_id)
partial_view = False
+ adult_view = False
for _ in range(2):
query = {
'nTitleNo': video_id,
@@ -245,6 +246,8 @@ class AfreecaTVIE(InfoExtractor):
}
if partial_view:
query['partialView'] = 'SKIP_ADULT'
+ if adult_view:
+ query['adultView'] = 'ADULT_VIEW'
video_xml = self._download_xml(
'http://afbbs.afreecatv.com:8080/api/video/get_video_info.php',
video_id, 'Downloading video info XML%s'
@@ -264,6 +267,9 @@ class AfreecaTVIE(InfoExtractor):
partial_view = True
continue
elif flag == 'ADULT':
+ if not adult_view:
+ adult_view = True
+ continue
error = 'Only users older than 19 are able to watch this video. Provide account credentials to download this content.'
else:
error = flag