summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-02-10 22:36:26 +0700
committerSergey M․ <dstftw@gmail.com>2018-02-10 22:36:26 +0700
commit9e36fedd00245639a820cb9a502ec680a986dbc7 (patch)
treebd39ace8cfb8536ec2e8bdbe59ceab9587d56664
parentd2b200eef9b3346f2e54ebf150b143253b85cbbd (diff)
downloadyoutube-dl-9e36fedd00245639a820cb9a502ec680a986dbc7.tar.gz
youtube-dl-9e36fedd00245639a820cb9a502ec680a986dbc7.tar.xz
youtube-dl-9e36fedd00245639a820cb9a502ec680a986dbc7.zip
[afreecatv] Fix extraction (closes #15556)
-rw-r--r--youtube_dl/extractor/afreecatv.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/youtube_dl/extractor/afreecatv.py b/youtube_dl/extractor/afreecatv.py
index d8376a1b3..148a0999c 100644
--- a/youtube_dl/extractor/afreecatv.py
+++ b/youtube_dl/extractor/afreecatv.py
@@ -175,12 +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, headers={
                 'Referer': 'http://vod.afreecatv.com/embed.php',
             }, query={
                 'nTitleNo': video_id,
+                'nStationNo': station_id,
+                'nBbsNo': bbs_id,
                 'partialView': 'SKIP_ADULT',
             })