mirror of
https://github.com/l1ving/youtube-dl
synced 2025-01-28 01:02:57 +08:00
[dbtv] Relax _VALID_URL a bit
This commit is contained in:
parent
7689413e42
commit
6caccd0fb1
@ -13,8 +13,8 @@ from ..utils import (
|
||||
|
||||
|
||||
class DBTVIE(InfoExtractor):
|
||||
_VALID_URL = r'http://dbtv\.no/(?P<id>[0-9]+)#(?P<display_id>.+)'
|
||||
_TEST = {
|
||||
_VALID_URL = r'http://(www\.)?dbtv\.no/(lazyplayer/|player/)?(?P<id>[0-9]+)(#(?P<display_id>.+))?'
|
||||
_TESTS = [{
|
||||
'url': 'http://dbtv.no/3649835190001#Skulle_teste_ut_fornøyelsespark,_men_kollegaen_var_bare_opptatt_av_bikinikroppen',
|
||||
'md5': 'b89953ed25dacb6edb3ef6c6f430f8bc',
|
||||
'info_dict': {
|
||||
@ -30,12 +30,28 @@ class DBTVIE(InfoExtractor):
|
||||
'view_count': int,
|
||||
'categories': list,
|
||||
}
|
||||
}
|
||||
}, {
|
||||
'url': 'http://www.dbtv.no/lazyplayer/4631135248001',
|
||||
'md5': 'f885f7dbdf85d89cc7c8cc0a552c93a1',
|
||||
'info_dict': {
|
||||
'id': '44885',
|
||||
'display_id': 'dbtv_4631135248001',
|
||||
'ext': 'mp4',
|
||||
'title': 'Det norske mottakssystemet i krise ',
|
||||
'description': 'md5:6355484d8611449e2df801b494699007',
|
||||
'thumbnail': 're:https?://.*\.jpg$',
|
||||
'timestamp': 1448448563.099,
|
||||
'upload_date': '20151125',
|
||||
'duration': 98.667,
|
||||
'view_count': int,
|
||||
'categories': list,
|
||||
}
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
mobj = re.match(self._VALID_URL, url)
|
||||
video_id = mobj.group('id')
|
||||
display_id = mobj.group('display_id')
|
||||
display_id = mobj.group('display_id') or "dbtv_" + video_id
|
||||
|
||||
data = self._download_json(
|
||||
'http://api.dbtv.no/discovery/%s' % video_id, display_id)
|
||||
|
Loading…
Reference in New Issue
Block a user