aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorPC <tioocnt@yandex.com>2015-10-06 22:28:58 +0100
committerSergey M․ <dstftw@gmail.com>2015-10-11 20:36:12 +0600
commit1bd390358205728823ff38a51b12ae35f9468929 (patch)
tree0bfbd72baff5bb287402fb863a7a9f4294667448 /youtube_dl
parentda4daed5ef77b4a7219b1786978065a3606b85bc (diff)
chaturbate streams
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/__init__.py1
-rw-r--r--youtube_dl/extractor/chaturbate.py24
2 files changed, 25 insertions, 0 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py
index 3ace1cc2c..75720843c 100644
--- a/youtube_dl/extractor/__init__.py
+++ b/youtube_dl/extractor/__init__.py
@@ -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
index 000000000..5e24e1e4f
--- /dev/null
+++ b/youtube_dl/extractor/chaturbate.py
@@ -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,
+ }