mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-04 07:32:58 +01:00
Testcase added with md5 and the lot
This commit is contained in:
parent
c63cbdb443
commit
0edd71f0b1
@ -22,39 +22,45 @@ class TwentyThreeVideoIE(InfoExtractor):
|
|||||||
'uploader_id': '12258964',
|
'uploader_id': '12258964',
|
||||||
'uploader': 'Rasmus Bysted',
|
'uploader': 'Rasmus Bysted',
|
||||||
}
|
}
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
'url': 'https://bonnier-publications-danmark.23video.com/v.ihtml/player.html?token=f0dc46476e06e13afd5a1f84a29e31e8&source=embed&photo%5fid=36137620',
|
'url': 'https://bonnier-publications-danmark.23video.com/v.ihtml/player.html?token=f0dc46476e06e13afd5a1f84a29e31e8&source=embed&photo%5fid=36137620',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
'url': 'https://video.kglteater.dk/v.ihtml/player.html?source=share&photo%5fid=65098499',
|
'url': 'https://video.kglteater.dk/v.ihtml/player.html?source=share&photo%5fid=65098499',
|
||||||
'only_matching': True,
|
'md5': '4e20a33ce86b13ca114ee44a0a8d8efb',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '65098499',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Askepot',
|
||||||
|
'timestamp': 1605173942,
|
||||||
|
'upload_date': '20201112',
|
||||||
|
'uploader_id': '62151179',
|
||||||
|
'uploader': 'jbny',
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
domain, query, photo_id = re.match(self._VALID_URL, url).groups()
|
domain, query, photo_id = re.match(self._VALID_URL, url).groups()
|
||||||
base_url = 'https://%s' % domain
|
base_url = 'https://%s' % domain
|
||||||
print(base_url + '/api/protection/verify')
|
|
||||||
|
|
||||||
def is_geo_blocked():
|
def is_geo_blocked():
|
||||||
# /api/player/settings
|
# /api/player/settings
|
||||||
playersettings_0 = { 'player_id': 0, 'parameters': 'showDescriptions=0&source=site&photo%5fid=' + photo_id + '&autoPlay=1', '_li': 0, '_bot': 0 }
|
playersettings_0 = {'player_id': 0, 'parameters': 'showDescriptions=0&source=site&photo%5fid=' + photo_id + '&autoPlay=1', '_li': 0, '_bot': 0}
|
||||||
playersettings_0_param = '/api/player/settings?' + compat_urllib_parse_urlencode(playersettings_0)
|
playersettings_0_param = '/api/player/settings?' + compat_urllib_parse_urlencode(playersettings_0)
|
||||||
|
|
||||||
# /api/live/list
|
# /api/live/list
|
||||||
livelist_1 = { 'include_actions_p': 1, 'showDescriptions': 0, 'source': 'site', 'photo_id': photo_id, 'autoPlay': 1, 'upcoming_p' : 1, 'ordering': 'streaming', 'player_id': 0 }
|
livelist_1 = {'include_actions_p': 1, 'showDescriptions': 0, 'source': 'site', 'photo_id': photo_id, 'autoPlay': 1, 'upcoming_p': 1, 'ordering': 'streaming', 'player_id': 0}
|
||||||
livelist_1_param = '/api/live/list?' + compat_urllib_parse_urlencode(livelist_1)
|
livelist_1_param = '/api/live/list?' + compat_urllib_parse_urlencode(livelist_1)
|
||||||
|
|
||||||
# /api/photo/list
|
# /api/photo/list
|
||||||
photolist_2 = { 'size':10, 'include_actions_p': 1, 'showDescriptions': 0, 'source': 'site', 'photo_id': photo_id, 'autoPlay':1,'player_id':0 }
|
photolist_2 = {'size': 10, 'include_actions_p': 1, 'showDescriptions': 0, 'source': 'site', 'photo_id': photo_id, 'autoPlay': 1, 'player_id': 0}
|
||||||
photolist_2_param = '/api/photo/list?' + compat_urllib_parse_urlencode(photolist_2)
|
photolist_2_param = '/api/photo/list?' + compat_urllib_parse_urlencode(photolist_2)
|
||||||
|
|
||||||
new_query = query={ 'format': 'json', 'callback': 'test', 'playersettings_0': playersettings_0_param, 'livelist_1': livelist_1_param, 'photolist_2': photolist_2_param }
|
new_query = {'format': 'json', 'callback': 'test', 'playersettings_0': playersettings_0_param, 'livelist_1': livelist_1_param, 'photolist_2': photolist_2_param}
|
||||||
photolist_result = self._download_json(
|
photolist_result = self._download_json(
|
||||||
base_url + '/api/concatenate',
|
base_url + '/api/concatenate',
|
||||||
photo_id,
|
photo_id,
|
||||||
query = new_query,
|
query=new_query,
|
||||||
transform_source=lambda s: self._search_regex(r'(?s)({.+})', s, 'photolist_2')
|
transform_source=lambda s: self._search_regex(r'(?s)({.+})', s, 'photolist_2')
|
||||||
)["photolist_2"]
|
)["photolist_2"]
|
||||||
|
|
||||||
@ -70,17 +76,17 @@ class TwentyThreeVideoIE(InfoExtractor):
|
|||||||
token = self._download_json(
|
token = self._download_json(
|
||||||
base_url + '/api/protection/verify',
|
base_url + '/api/protection/verify',
|
||||||
photo_id,
|
photo_id,
|
||||||
query={ 'protection_method': 'geoblocking', 'object_id': photo_id, 'object_type': 'photo', 'format': 'json', 'callback': 'visualplatform_1' },
|
query={'protection_method': 'geoblocking', 'object_id': photo_id, 'object_type': 'photo', 'format': 'json', 'callback': 'visualplatform_1'},
|
||||||
transform_source=lambda s: self._search_regex(r'(?s)({.+})', s, 'protectedtoken'))['protectedtoken']['protected_token']
|
transform_source=lambda s: self._search_regex(r'(?s)({.+})', s, 'protectedtoken'))['protectedtoken']['protected_token']
|
||||||
|
|
||||||
return { 'format': 'json', 'token': token}
|
return {'format': 'json', 'token': token}
|
||||||
else:
|
else:
|
||||||
return { 'format': 'json' }
|
return {'format': 'json'}
|
||||||
|
|
||||||
video_query = get_video_query()
|
video_query = get_video_query()
|
||||||
photo_data = self._download_json(
|
photo_data = self._download_json(
|
||||||
base_url + '/api/photo/list?' + query, photo_id,
|
base_url + '/api/photo/list?' + query, photo_id,
|
||||||
query = video_query,
|
query=video_query,
|
||||||
transform_source=lambda s: self._search_regex(r'(?s)({.+})', s, 'photo data'))['photo']
|
transform_source=lambda s: self._search_regex(r'(?s)({.+})', s, 'photo data'))['photo']
|
||||||
|
|
||||||
title = photo_data['title']
|
title = photo_data['title']
|
||||||
|
Loading…
Reference in New Issue
Block a user