]>
Commit | Line | Data |
---|---|---|
4a684895 RA |
1 | # coding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
4 | import re | |
5 | ||
6 | from .common import InfoExtractor | |
8fbf5d2f RA |
7 | from ..utils import ( |
8 | get_element_by_class, | |
9 | strip_or_none, | |
10 | ) | |
4a684895 RA |
11 | |
12 | ||
13 | class SeekerIE(InfoExtractor): | |
14 | _VALID_URL = r'https?://(?:www\.)?seeker\.com/(?P<display_id>.*)-(?P<article_id>\d+)\.html' | |
15 | _TESTS = [{ | |
4a684895 | 16 | 'url': 'http://www.seeker.com/should-trump-be-required-to-release-his-tax-returns-1833805621.html', |
8fbf5d2f | 17 | 'md5': '897d44bbe0d8986a2ead96de565a92db', |
4a684895 | 18 | 'info_dict': { |
8fbf5d2f RA |
19 | 'id': 'Elrn3gnY', |
20 | 'ext': 'mp4', | |
4a684895 | 21 | 'title': 'Should Trump Be Required To Release His Tax Returns?', |
8fbf5d2f RA |
22 | 'description': 'md5:41efa8cfa8d627841045eec7b018eb45', |
23 | 'timestamp': 1490090165, | |
24 | 'upload_date': '20170321', | |
4a684895 RA |
25 | } |
26 | }, { | |
27 | 'url': 'http://www.seeker.com/changes-expected-at-zoos-following-recent-gorilla-lion-shootings-1834116536.html', | |
28 | 'playlist': [ | |
29 | { | |
8fbf5d2f | 30 | 'md5': '0497b9f20495174be73ae136949707d2', |
4a684895 | 31 | 'info_dict': { |
8fbf5d2f | 32 | 'id': 'FihYQ8AE', |
4a684895 RA |
33 | 'ext': 'mp4', |
34 | 'title': 'The Pros & Cons Of Zoos', | |
8fbf5d2f RA |
35 | 'description': 'md5:d88f99a8ea8e7d25e6ff77f271b1271c', |
36 | 'timestamp': 1490039133, | |
37 | 'upload_date': '20170320', | |
4a684895 RA |
38 | }, |
39 | } | |
40 | ], | |
41 | 'info_dict': { | |
42 | 'id': '1834116536', | |
43 | 'title': 'After Gorilla Killing, Changes Ahead for Zoos', | |
44 | 'description': 'The largest association of zoos and others are hoping to learn from recent incidents that led to the shooting deaths of a gorilla and two lions.', | |
45 | }, | |
46 | }] | |
47 | ||
48 | def _real_extract(self, url): | |
5ad28e7f | 49 | display_id, article_id = self._match_valid_url(url).groups() |
4a684895 | 50 | webpage = self._download_webpage(url, display_id) |
8fbf5d2f RA |
51 | entries = [] |
52 | for jwp_id in re.findall(r'data-video-id="([a-zA-Z0-9]{8})"', webpage): | |
53 | entries.append(self.url_result( | |
54 | 'jwplatform:' + jwp_id, 'JWPlatform', jwp_id)) | |
55 | return self.playlist_result( | |
56 | entries, article_id, | |
57 | self._og_search_title(webpage), | |
58 | strip_or_none(get_element_by_class('subtitle__text', webpage)) or self._og_search_description(webpage)) |