Skip to content

Commit d347b52

Browse files
0x9fff00dstftw
authored andcommitted
[urplay] Extract timestamp (#20235)
1 parent 97157c6 commit d347b52

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

youtube_dl/extractor/urplay.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,31 @@
22
from __future__ import unicode_literals
33

44
from .common import InfoExtractor
5+
from ..utils import unified_timestamp
56

67

78
class URPlayIE(InfoExtractor):
89
_VALID_URL = r'https?://(?:www\.)?ur(?:play|skola)\.se/(?:program|Produkter)/(?P<id>[0-9]+)'
910
_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',
1223
'info_dict': {
1324
'id': '190031',
1425
'ext': 'mp4',
1526
'title': 'Tripp, Trapp, Träd : Sovkudde',
1627
'description': 'md5:b86bffdae04a7e9379d1d7e5947df1d1',
28+
'timestamp': 1440093600,
29+
'upload_date': '20150820',
1730
},
1831
}, {
1932
'url': 'http://urskola.se/Produkter/155794-Smasagor-meankieli-Grodan-i-vida-varlden',
@@ -51,6 +64,7 @@ def _real_extract(self, url):
5164
'title': urplayer_data['title'],
5265
'description': self._og_search_description(webpage),
5366
'thumbnail': urplayer_data.get('image'),
67+
'timestamp': unified_timestamp(self._html_search_meta(('uploadDate', 'schema:uploadDate'), webpage, 'timestamp')),
5468
'series': urplayer_data.get('series_title'),
5569
'subtitles': subtitles,
5670
'formats': formats,

0 commit comments

Comments
 (0)