]>
Commit | Line | Data |
---|---|---|
dcdb292f | 1 | # coding: utf-8 |
92661c99 JMF |
2 | from __future__ import unicode_literals |
3 | ||
c81a855b | 4 | from .common import InfoExtractor |
89533199 | 5 | from .jwplatform import JWPlatformIE |
c81a855b OP |
6 | |
7 | from ..utils import ( | |
c81a855b OP |
8 | unified_strdate, |
9 | ) | |
10 | ||
92661c99 | 11 | |
c81a855b | 12 | class NormalbootsIE(InfoExtractor): |
5886b38d | 13 | _VALID_URL = r'https?://(?:www\.)?normalboots\.com/video/(?P<id>[0-9a-z-]*)/?$' |
3bf8bc7f | 14 | _TEST = { |
92661c99 | 15 | 'url': 'http://normalboots.com/video/home-alone-games-jontron/', |
92661c99 JMF |
16 | 'info_dict': { |
17 | 'id': 'home-alone-games-jontron', | |
18 | 'ext': 'mp4', | |
19 | 'title': 'Home Alone Games - JonTron - NormalBoots', | |
20 | '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/', | |
21 | 'uploader': 'JonTron', | |
22 | 'upload_date': '20140125', | |
a285b637 JMF |
23 | }, |
24 | 'params': { | |
e3de3d6f | 25 | # m3u8 download |
a285b637 JMF |
26 | 'skip_download': True, |
27 | }, | |
89533199 | 28 | 'add_ie': ['JWPlatform'], |
3bf8bc7f | 29 | } |
92661c99 | 30 | |
c81a855b | 31 | def _real_extract(self, url): |
53157257 | 32 | video_id = self._match_id(url) |
c81a855b | 33 | webpage = self._download_webpage(url, video_id) |
92661c99 | 34 | |
53157257 PH |
35 | video_uploader = self._html_search_regex( |
36 | r'Posted\sby\s<a\shref="[A-Za-z0-9/]*">(?P<uploader>[A-Za-z]*)\s</a>', | |
37 | webpage, 'uploader', fatal=False) | |
38 | video_upload_date = unified_strdate(self._html_search_regex( | |
39 | r'<span style="text-transform:uppercase; font-size:inherit;">[A-Za-z]+, (?P<date>.*)</span>', | |
40 | webpage, 'date', fatal=False)) | |
41 | ||
89533199 | 42 | jwplatform_url = JWPlatformIE._extract_url(webpage) |
92661c99 JMF |
43 | |
44 | return { | |
e3de3d6f | 45 | '_type': 'url_transparent', |
92661c99 | 46 | 'id': video_id, |
89533199 | 47 | 'url': jwplatform_url, |
48 | 'ie_key': JWPlatformIE.ie_key(), | |
92661c99 JMF |
49 | 'title': self._og_search_title(webpage), |
50 | 'description': self._og_search_description(webpage), | |
51 | 'thumbnail': self._og_search_thumbnail(webpage), | |
52 | 'uploader': video_uploader, | |
53 | 'upload_date': video_upload_date, | |
54 | } |