X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fafreecatv.py;h=148a0999c1e60431a7f933c15ce1645f804ffb42;hb=7d2b4aa04790b51a0b2b717eed618296115061a8;hp=513dd81df5cd8c044eaba800facdf76cca3cc509;hpb=c33de004e13da11f1ae3cad7310b36500cfb9d28;p=youtube-dl diff --git a/youtube_dl/extractor/afreecatv.py b/youtube_dl/extractor/afreecatv.py index 513dd81df..148a0999c 100644 --- a/youtube_dl/extractor/afreecatv.py +++ b/youtube_dl/extractor/afreecatv.py @@ -175,10 +175,23 @@ class AfreecaTVIE(InfoExtractor): def _real_extract(self, 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( 'http://afbbs.afreecatv.com:8080/api/video/get_video_info.php', - video_id, query={ + video_id, headers={ + 'Referer': 'http://vod.afreecatv.com/embed.php', + }, query={ 'nTitleNo': video_id, + 'nStationNo': station_id, + 'nBbsNo': bbs_id, 'partialView': 'SKIP_ADULT', })