mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[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
This commit is contained in:
parent
b8773e63f0
commit
875cfb8cbc
1 changed files with 6 additions and 0 deletions
|
@ -237,6 +237,7 @@ def _real_extract(self, url):
|
||||||
r'nTitleNo\s*=\s*(\d+)', webpage, 'title', default=video_id)
|
r'nTitleNo\s*=\s*(\d+)', webpage, 'title', default=video_id)
|
||||||
|
|
||||||
partial_view = False
|
partial_view = False
|
||||||
|
adult_view = False
|
||||||
for _ in range(2):
|
for _ in range(2):
|
||||||
query = {
|
query = {
|
||||||
'nTitleNo': video_id,
|
'nTitleNo': video_id,
|
||||||
|
@ -245,6 +246,8 @@ def _real_extract(self, url):
|
||||||
}
|
}
|
||||||
if partial_view:
|
if partial_view:
|
||||||
query['partialView'] = 'SKIP_ADULT'
|
query['partialView'] = 'SKIP_ADULT'
|
||||||
|
if adult_view:
|
||||||
|
query['adultView'] = 'ADULT_VIEW'
|
||||||
video_xml = self._download_xml(
|
video_xml = self._download_xml(
|
||||||
'http://afbbs.afreecatv.com:8080/api/video/get_video_info.php',
|
'http://afbbs.afreecatv.com:8080/api/video/get_video_info.php',
|
||||||
video_id, 'Downloading video info XML%s'
|
video_id, 'Downloading video info XML%s'
|
||||||
|
@ -264,6 +267,9 @@ def _real_extract(self, url):
|
||||||
partial_view = True
|
partial_view = True
|
||||||
continue
|
continue
|
||||||
elif flag == 'ADULT':
|
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.'
|
error = 'Only users older than 19 are able to watch this video. Provide account credentials to download this content.'
|
||||||
else:
|
else:
|
||||||
error = flag
|
error = flag
|
||||||
|
|
Loading…
Reference in a new issue