]>
Commit | Line | Data |
---|---|---|
92661c99 JMF |
1 | # encoding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
c81a855b OP |
4 | import re |
5 | ||
6 | from .common import InfoExtractor | |
7 | ||
8 | from ..utils import ( | |
c81a855b OP |
9 | unified_strdate, |
10 | ) | |
11 | ||
92661c99 | 12 | |
c81a855b | 13 | class NormalbootsIE(InfoExtractor): |
92661c99 | 14 | _VALID_URL = r'http://(?:www\.)?normalboots\.com/video/(?P<videoid>[0-9a-z-]*)/?$' |
3bf8bc7f | 15 | _TEST = { |
92661c99 JMF |
16 | 'url': 'http://normalboots.com/video/home-alone-games-jontron/', |
17 | 'md5': '8bf6de238915dd501105b44ef5f1e0f6', | |
18 | 'info_dict': { | |
19 | 'id': 'home-alone-games-jontron', | |
20 | 'ext': 'mp4', | |
21 | 'title': 'Home Alone Games - JonTron - NormalBoots', | |
22 | 'description': 'Jon is late for Christmas. Typical. Thanks to: Paul Ritchey for Co-Writing/Filming: http://www.youtube.com/user/ContinueShow Michael Azzi for Christmas Intro Animation: http://michafrar.tumblr.com/ Jerrod Waters for Christmas Intro Music: http://www.youtube.com/user/xXJerryTerryXx Casey Ormond for ‘Tense Battle Theme’:\xa0http://www.youtube.com/Kiamet/', | |
23 | 'uploader': 'JonTron', | |
24 | 'upload_date': '20140125', | |
a285b637 JMF |
25 | }, |
26 | 'params': { | |
27 | # rtmp download | |
28 | 'skip_download': True, | |
29 | }, | |
3bf8bc7f | 30 | } |
92661c99 | 31 | |
c81a855b OP |
32 | def _real_extract(self, url): |
33 | mobj = re.match(self._VALID_URL, url) | |
c81a855b | 34 | video_id = mobj.group('videoid') |
92661c99 | 35 | |
c81a855b | 36 | webpage = self._download_webpage(url, video_id) |
c81a855b | 37 | video_uploader = self._html_search_regex(r'Posted\sby\s<a\shref="[A-Za-z0-9/]*">(?P<uploader>[A-Za-z]*)\s</a>', |
9e1a5b84 | 38 | webpage, 'uploader') |
92661c99 | 39 | raw_upload_date = self._html_search_regex('<span style="text-transform:uppercase; font-size:inherit;">[A-Za-z]+, (?P<date>.*)</span>', |
9e1a5b84 | 40 | webpage, 'date') |
c81a855b | 41 | video_upload_date = unified_strdate(raw_upload_date) |
92661c99 | 42 | |
c81a855b OP |
43 | player_url = self._html_search_regex(r'<iframe\swidth="[0-9]+"\sheight="[0-9]+"\ssrc="(?P<url>[\S]+)"', webpage, 'url') |
44 | player_page = self._download_webpage(player_url, video_id) | |
ffe8fe35 | 45 | video_url = self._html_search_regex(r"file:\s'(?P<file>[^']+\.mp4)'", player_page, 'file') |
92661c99 JMF |
46 | |
47 | return { | |
48 | 'id': video_id, | |
49 | 'url': video_url, | |
50 | 'title': self._og_search_title(webpage), | |
51 | 'description': self._og_search_description(webpage), | |
52 | 'thumbnail': self._og_search_thumbnail(webpage), | |
53 | 'uploader': video_uploader, | |
54 | 'upload_date': video_upload_date, | |
55 | } |