[karaoketv] Update and mark as not _WORKING
authorYen Chi Hsuan <yan12125@gmail.com>
Fri, 15 Apr 2016 13:49:17 +0000 (21:49 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Fri, 15 Apr 2016 13:49:17 +0000 (21:49 +0800)
youtube_dl/extractor/karaoketv.py

index b4c30b7f3145fef78ec107d402c97927f1a8ad2e..dbc83cb6c712a42ddcc1e7bf7632b1d801ffdbff 100644 (file)
@@ -2,20 +2,22 @@
 from __future__ import unicode_literals
 
 from .common import InfoExtractor
-from ..compat import compat_urllib_parse_unquote_plus
-from ..utils import (
-    js_to_json,
-)
 
 
 class KaraoketvIE(InfoExtractor):
-    _VALID_URL = r'https?://karaoketv\.co\.il/\?container=songs&id=(?P<id>[0-9]+)'
+    '''
+    In api_play.php there's a video-cdn.com <iframe>. The latter plays an
+    unencrypted RTMP stream. However I can't download it with rtmpdump.
+    '''
+    _WORKING = False
+
+    _VALID_URL = r'http://www.karaoketv.co.il/[^/]+/(?P<id>\d+)'
     _TEST = {
-        'url': 'http://karaoketv.co.il/?container=songs&id=171568',
+        'url': 'http://www.karaoketv.co.il/%D7%A9%D7%99%D7%A8%D7%99_%D7%A7%D7%A8%D7%99%D7%95%D7%A7%D7%99/58356/%D7%90%D7%99%D7%96%D7%95%D7%9F',
         'info_dict': {
-            'id': '171568',
-            'ext': 'mp4',
-            'title': '×\90×\9c ×\94×¢×\95×\9c×\9d ×©×\9c×\9a - ×¨×\95ת×\9d ×\9b×\94×\9f - ×©×¨×\99×\9d ×§×¨×\99×\95ק×\99',
+            'id': '58356',
+            'ext': 'flv',
+            'title': 'קר×\99×\95ק×\99 ×©×\9c ×\90×\99×\96×\95×\9f',
         }
     }
 
@@ -23,18 +25,13 @@ class KaraoketvIE(InfoExtractor):
         video_id = self._match_id(url)
         webpage = self._download_webpage(url, video_id)
 
-        page_video_url = self._og_search_video_url(webpage, video_id)
-        config_json = compat_urllib_parse_unquote_plus(self._search_regex(
-            r'config=(.*)', page_video_url, 'configuration'))
-
-        urls_info_json = self._download_json(
-            config_json, video_id, 'Downloading configuration',
-            transform_source=js_to_json)
-
-        url = urls_info_json['playlist'][0]['url']
+        api_page_url = self._html_search_regex(
+            r'<iframe[^>]+src="(http://www.karaoke.co.il/api_play.php?[^"]+)"',
+            webpage, 'API play URL')
 
         return {
+            '_type': 'url_transparent',
             'id': video_id,
             'title': self._og_search_title(webpage),
-            'url': url,
+            'url': api_page_url,
         }