chaturbate streams
authorPC <tioocnt@yandex.com>
Tue, 6 Oct 2015 21:28:58 +0000 (22:28 +0100)
committerSergey M․ <dstftw@gmail.com>
Sun, 11 Oct 2015 14:36:12 +0000 (20:36 +0600)
youtube_dl/extractor/__init__.py
youtube_dl/extractor/chaturbate.py [new file with mode: 0644]

index 3ace1cc2ca7a375820d423f495d57c4e76aae018..75720843ce552850800990f527776f2a7e83c778 100644 (file)
@@ -76,6 +76,7 @@ from .cbssports import CBSSportsIE
 from .ccc import CCCIE
 from .ceskatelevize import CeskaTelevizeIE
 from .channel9 import Channel9IE
+from .chaturbate import ChaturbateIE
 from .chilloutzone import ChilloutzoneIE
 from .chirbit import (
     ChirbitIE,
diff --git a/youtube_dl/extractor/chaturbate.py b/youtube_dl/extractor/chaturbate.py
new file mode 100644 (file)
index 0000000..5e24e1e
--- /dev/null
@@ -0,0 +1,24 @@
+# encoding: utf-8
+
+from .common import InfoExtractor
+
+
+class ChaturbateIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?chaturbate\.com/(?P<id>[^/]+)/?$'
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+        webpage = self._download_webpage(url, video_id)
+
+        m3u8_url = self._search_regex(r"'(https?://.*?\.m3u8)'", webpage, 'playlist')
+
+        formats = self._extract_m3u8_formats(m3u8_url, video_id, ext='mp4')
+
+        return {
+            'id': video_id,
+            'title': self._live_title(video_id),
+            'description': self._html_search_meta('description', webpage, 'description'),
+            'is_live': True,
+            'thumbnail': 'https://cdn-s.highwebmedia.com/uHK3McUtGCG3SMFcd4ZJsRv8/roomimage/%s.jpg' % (video_id,),
+            'formats': formats,
+        }