1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-23 16:36:48 +00:00

[afreecatv] Fix extraction (closes #15556)

This commit is contained in:
Sergey M․ 2018-02-10 22:36:26 +07:00
parent d2b200eef9
commit 9e36fedd00
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -175,12 +175,23 @@ class AfreecaTVIE(InfoExtractor):
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
station_id = self._search_regex(
r'nStationNo\s*=\s*(\d+)', webpage, 'station')
bbs_id = self._search_regex(
r'nBbsNo\s*=\s*(\d+)', webpage, 'bbs')
video_id = self._search_regex(
r'nTitleNo\s*=\s*(\d+)', webpage, 'title', default=video_id)
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, headers={ video_id, headers={
'Referer': 'http://vod.afreecatv.com/embed.php', 'Referer': 'http://vod.afreecatv.com/embed.php',
}, query={ }, query={
'nTitleNo': video_id, 'nTitleNo': video_id,
'nStationNo': station_id,
'nBbsNo': bbs_id,
'partialView': 'SKIP_ADULT', 'partialView': 'SKIP_ADULT',
}) })