1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-23 17:28:03 +00:00
This commit is contained in:
Sergey M․ 2014-07-18 20:29:35 +07:00
commit 61bbddbaa6
2 changed files with 48 additions and 0 deletions

View file

@ -53,6 +53,7 @@ from .cnn import (
from .collegehumor import CollegeHumorIE from .collegehumor import CollegeHumorIE
from .comedycentral import ComedyCentralIE, ComedyCentralShowsIE from .comedycentral import ComedyCentralIE, ComedyCentralShowsIE
from .condenast import CondeNastIE from .condenast import CondeNastIE
from .cracked import CrackedIE
from .criterion import CriterionIE from .criterion import CriterionIE
from .crunchyroll import CrunchyrollIE from .crunchyroll import CrunchyrollIE
from .cspan import CSpanIE from .cspan import CSpanIE
@ -399,6 +400,7 @@ from .youtube import (
YoutubeUserIE, YoutubeUserIE,
YoutubeWatchLaterIE, YoutubeWatchLaterIE,
) )
from .zdf import ZDFIE from .zdf import ZDFIE

View file

@ -0,0 +1,46 @@
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class CrackedIE(InfoExtractor):
_VALID_URL = r'http?://.*?\.cracked\.com/video_+(?P<id>.*)_.*'
_TEST = {
'url': 'http://www.cracked.com/video_18803_4-social-criticisms-hidden-in-sonic-hedgehog-games.html',
'info_dict': {
'id': '18803',
'ext': 'mp4',
'title': "4 Social Criticisms Hidden in 'Sonic the Hedgehog' Games | Cracked.com",
'height': 375,
'width': 666,
}
}
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
webpage = self._download_webpage(url, video_id)
title = self._search_regex(r'<title>(.*?)</title>',webpage,'title')
video_url = self._search_regex(r'var CK_vidSrc = "+(.*)"',webpage,'url')
width = self._search_regex(r'width="(.*?)"',webpage,'width')
height = re.findall(r'height="(.*?)"',webpage)[1]
return {
'url':video_url,
'id': video_id,
'ext':'mp4',
'title':title,
'height':int(height),
'width':int(width)
}