diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index cc8683573..a12281d18 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -134,6 +134,7 @@ from .dropbox import DropboxIE from .eagleplatform import EaglePlatformIE from .ebaumsworld import EbaumsWorldIE from .echomsk import EchoMskIE +from .efukt import EfuktIE from .ehow import EHowIE from .eighttracks import EightTracksIE from .einthusan import EinthusanIE diff --git a/youtube_dl/extractor/efukt.py b/youtube_dl/extractor/efukt.py new file mode 100644 index 000000000..90f0d7f22 --- /dev/null +++ b/youtube_dl/extractor/efukt.py @@ -0,0 +1,51 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor +from ..utils import str_to_int + +import re + + +class EfuktIE(InfoExtractor): + _VALID_URL = r'(?:http://)?(?:www\.)?efukt\.com/(?P[0-9]+)(?:_[^_.]+)+\.html' + _TEST = { + 'url': 'http://efukt.com/21269_Epic_2_Horrible_in_Thirty_Seconds!.html', + 'md5': 'f07f2f58ae29dc01ce7351e4e825797f', + 'info_dict': { + 'id': '21269', + 'ext': 'mp4', + 'thumbnail': 'http://assets.efukt.com/player-preview/21269.mp4.jpg', + 'format': 'mp4', + 'title': 'Epic 2 Horrible in Thirty Seconds!', + 'description': "She pretty much aces the whole 'prostitute on camera' thing except for one small detail: This newbie pornstar's lady cum has a really unique... consistency. LOLOLOLOLOLOLOLOLOLOL. Full Vid HERE." + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + + if(re.match(r'http://', url) is None): + url = 'http://' + url + + webpage = self._download_webpage(url, video_id) + + title = self._html_search_meta('og:title', webpage, 'title') + video_url = self._html_search_regex(r'file:\s?"(?P(?:http://)?(?:www\.)?assets\.efukt\.com/videos/(?:[^.]+)\.(mp4|flv))"', webpage, 'video_url') + thumbnail = self._html_search_meta('og:image', webpage, 'thumbnail', fatal=False) + description = self._html_search_meta('og:description', webpage, 'description', fatal=False) + view_count = self._html_search_regex(r'  (?P(?:[0-9]+,?)+)', webpage, 'view_count', fatal=False) + + if view_count: + view_count = str_to_int(view_count) + + return { + 'id': video_id, + 'url': video_url, + 'title': title, + 'thumbnail': thumbnail, + 'description': description, + 'ext': 'mp4', + 'format': 'mp4', + 'view_count': view_count + }