]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/cinemassacre.py
cf0a7551b7f3df672d20aad7a00d7ced43bf2945
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
7 from ..utils
import ExtractorError
8 from .bliptv
import BlipTVIE
11 class CinemassacreIE(InfoExtractor
):
12 _VALID_URL
= 'https?://(?:www\.)?cinemassacre\.com/(?P<date_y>[0-9]{4})/(?P<date_m>[0-9]{2})/(?P<date_d>[0-9]{2})/(?P<display_id>[^?#/]+)'
15 'url': 'http://cinemassacre.com/2012/11/10/avgn-the-movie-trailer/',
16 'md5': 'fde81fbafaee331785f58cd6c0d46190',
18 'id': 'Cinemassacre-19911',
20 'upload_date': '20121110',
21 'title': '“Angry Video Game Nerd: The Movie” – Trailer',
22 'description': 'md5:fb87405fcb42a331742a0dce2708560b',
26 'url': 'http://cinemassacre.com/2013/10/02/the-mummys-hand-1940',
27 'md5': 'd72f10cd39eac4215048f62ab477a511',
29 'id': 'Cinemassacre-521be8ef82b16',
31 'upload_date': '20131002',
32 'title': 'The Mummy’s Hand (1940)',
36 # blip.tv embedded video
37 'url': 'http://cinemassacre.com/2006/12/07/chronologically-confused-about-bad-movie-and-video-game-sequel-titles/',
38 'md5': 'ca9b3c8dd5a66f9375daeb5135f5a3de',
42 'title': 'AVGN: Chronologically Confused about Bad Movie and Video Game Sequel Titles',
43 'upload_date': '20061207',
44 'uploader': 'cinemassacre',
45 'uploader_id': '250778',
46 'timestamp': 1283233867,
47 'description': 'md5:0a108c78d130676b207d0f6d029ecffd',
51 # Youtube embedded video
52 'url': 'http://cinemassacre.com/2006/09/01/mckids/',
53 'md5': '6eb30961fa795fedc750eac4881ad2e1',
57 'upload_date': '20060901',
58 'uploader': 'Cinemassacre Extras',
59 'description': 'md5:de9b751efa9e45fbaafd9c8a1123ed53',
60 'uploader_id': 'Cinemassacre',
61 'title': 'AVGN: McKids',
66 def _real_extract(self
, url
):
67 mobj
= re
.match(self
._VALID
_URL
, url
)
68 display_id
= mobj
.group('display_id')
69 video_date
= mobj
.group('date_y') + mobj
.group('date_m') + mobj
.group('date_d')
71 webpage
= self
._download
_webpage
(url
, display_id
)
73 playerdata_url
= self
._search
_regex
(
75 r
'src="(http://player\.screenwavemedia\.com/play/[a-zA-Z]+\.php\?[^"]*\bid=.+?)"',
76 r
'<iframe[^>]+src="((?:https?:)?//(?:[^.]+\.)?youtube\.com/.+?)"',
78 webpage
, 'player data URL', default
=None)
79 if not playerdata_url
:
80 playerdata_url
= BlipTVIE
._extract
_url
(webpage
)
81 if not playerdata_url
:
82 raise ExtractorError('Unable to find player data')
84 video_title
= self
._html
_search
_regex
(
85 r
'<title>(?P<title>.+?)\|', webpage
, 'title')
86 video_description
= self
._html
_search
_regex
(
87 r
'<div class="entry-content">(?P<description>.+?)</div>',
88 webpage
, 'description', flags
=re
.DOTALL
, fatal
=False)
89 video_thumbnail
= self
._og
_search
_thumbnail
(webpage
)
92 '_type': 'url_transparent',
93 'display_id': display_id
,
95 'description': video_description
,
96 'upload_date': video_date
,
97 'thumbnail': video_thumbnail
,
98 'url': playerdata_url
,