aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorCkuT <s3cu@hotmail.fr>2014-10-15 18:24:32 +0200
committerCkuT <s3cu@hotmail.fr>2014-10-15 18:24:32 +0200
commit474086450808541954e402dd3d58bad38b75b1d5 (patch)
treea8f26d0a0bdfc01f9e5bbe7c9fe48b6a3193f48a /youtube_dl
parent09a42738fc5a060208cad5fa5579688225e53464 (diff)
[SexyKarma] Add new extractor
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/__init__.py1
-rw-r--r--youtube_dl/extractor/sexykarma.py43
2 files changed, 44 insertions, 0 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py
index 5e38d2663..92f38dcd0 100644
--- a/youtube_dl/extractor/__init__.py
+++ b/youtube_dl/extractor/__init__.py
@@ -316,6 +316,7 @@ from .sbs import SBSIE
from .scivee import SciVeeIE
from .screencast import ScreencastIE
from .servingsys import ServingSysIE
+from .sexykarma import SexyKarmaIE
from .shared import SharedIE
from .sharesix import ShareSixIE
from .sina import SinaIE
diff --git a/youtube_dl/extractor/sexykarma.py b/youtube_dl/extractor/sexykarma.py
new file mode 100644
index 000000000..cd2668872
--- /dev/null
+++ b/youtube_dl/extractor/sexykarma.py
@@ -0,0 +1,43 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class SexyKarmaIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?sexykarma\.com/gonewild/video/(?P<id>[a-zA-Z0-9\-]+)(.html)'
+ _TESTS = [{
+ 'url': 'http://www.sexykarma.com/gonewild/video/taking-a-quick-pee-yHI70cOyIHt.html',
+ 'md5': 'b9798e7d1ef1765116a8f516c8091dbd',
+ 'info_dict': {
+ 'id': 'taking-a-quick-pee-yHI70cOyIHt',
+ 'ext': 'mp4',
+ 'title': 'Taking a quick pee.',
+ 'uploader': 'wildginger7',
+ }
+ }, {
+ 'url': 'http://www.sexykarma.com/gonewild/video/pot-pixie-tribute-8Id6EZPbuHf.html',
+ 'md5': 'dd216c68d29b49b12842b9babe762a5d',
+ 'info_dict': {
+ 'id': 'pot-pixie-tribute-8Id6EZPbuHf',
+ 'ext': 'mp4',
+ 'title': 'pot_pixie tribute',
+ 'uploader': 'banffite',
+ }
+ }]
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+
+ # TODO more code goes here, for example ...
+ webpage = self._download_webpage(url, video_id)
+ title = self._html_search_regex(r'<h2 class="he2"><span>(.*?)</span>', webpage, 'title')
+ uploader = self._html_search_regex(r'class="aupa">\n*(.*?)</a>', webpage, 'uploader')
+ url = self._html_search_regex(r'<p><a href="(.*?)" ?\n*target="_blank"><font color', webpage, 'url')
+
+ return {
+ 'id': video_id,
+ 'title': title,
+ 'uploader': uploader,
+ 'url': url
+ }