|
2 | 2 | from __future__ import unicode_literals
|
3 | 3 |
|
4 | 4 | from .common import InfoExtractor
|
| 5 | +from ..utils import unified_timestamp |
5 | 6 |
|
6 | 7 |
|
7 | 8 | class URPlayIE(InfoExtractor):
|
8 | 9 | _VALID_URL = r'https?://(?:www\.)?ur(?:play|skola)\.se/(?:program|Produkter)/(?P<id>[0-9]+)'
|
9 | 10 | _TESTS = [{
|
10 |
| - 'url': 'http://urplay.se/program/190031-tripp-trapp-trad-sovkudde', |
11 |
| - 'md5': 'ad5f0de86f16ca4c8062cd103959a9eb', |
| 11 | + 'url': 'https://urplay.se/program/203704-ur-samtiden-livet-universum-och-rymdens-markliga-musik-om-vetenskap-kritiskt-tankande-och-motstand', |
| 12 | + 'md5': 'ff5b0c89928f8083c74bbd5099c9292d', |
| 13 | + 'info_dict': { |
| 14 | + 'id': '203704', |
| 15 | + 'ext': 'mp4', |
| 16 | + 'title': 'UR Samtiden - Livet, universum och rymdens märkliga musik : Om vetenskap, kritiskt tänkande och motstånd', |
| 17 | + 'description': 'md5:5344508a52aa78c1ced6c1b8b9e44e9a', |
| 18 | + 'timestamp': 1513512768, |
| 19 | + 'upload_date': '20171217', |
| 20 | + }, |
| 21 | + }, { |
| 22 | + 'url': 'https://urskola.se/Produkter/190031-Tripp-Trapp-Trad-Sovkudde', |
12 | 23 | 'info_dict': {
|
13 | 24 | 'id': '190031',
|
14 | 25 | 'ext': 'mp4',
|
15 | 26 | 'title': 'Tripp, Trapp, Träd : Sovkudde',
|
16 | 27 | 'description': 'md5:b86bffdae04a7e9379d1d7e5947df1d1',
|
| 28 | + 'timestamp': 1440093600, |
| 29 | + 'upload_date': '20150820', |
17 | 30 | },
|
18 | 31 | }, {
|
19 | 32 | 'url': 'http://urskola.se/Produkter/155794-Smasagor-meankieli-Grodan-i-vida-varlden',
|
@@ -51,6 +64,7 @@ def _real_extract(self, url):
|
51 | 64 | 'title': urplayer_data['title'],
|
52 | 65 | 'description': self._og_search_description(webpage),
|
53 | 66 | 'thumbnail': urplayer_data.get('image'),
|
| 67 | + 'timestamp': unified_timestamp(self._html_search_meta(('uploadDate', 'schema:uploadDate'), webpage, 'timestamp')), |
54 | 68 | 'series': urplayer_data.get('series_title'),
|
55 | 69 | 'subtitles': subtitles,
|
56 | 70 | 'formats': formats,
|
|
0 commit comments