modified url building logic to handle different extensions and videos without and HD format
This commit is contained in:
parent
079c311df3
commit
86ee847411
@ -34,31 +34,48 @@ class ComingSoonITIE(InfoExtractor):
|
|||||||
'params': {
|
'params': {
|
||||||
'format': 'hd',
|
'format': 'hd',
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url': 'http://www.comingsoon.it/film/il-passato-e-una-terra-straniera/39912/video/?vid=1564',
|
||||||
|
'md5': '9c8db6b04d4c3858ad31857ce1c82350',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '1564',
|
||||||
|
'ext': 'flv',
|
||||||
|
'title': 'Il passato è una terra straniera, Trailer del film diretto da Daniele Vicari, con Elio Germano - Film (2008)',
|
||||||
|
'url': 'http://video.comingsoon.it/1564.flv',
|
||||||
|
'description': 'Trailer del film diretto da Daniele Vicari, con Elio Germano - Il passato è una terra straniera'
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
'format': 'sd',
|
||||||
|
},
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id, 'downloading webpage with metadata')
|
||||||
|
|
||||||
title = self._og_search_title(webpage)
|
title = self._og_search_title(webpage)
|
||||||
description = self._og_search_description(webpage)
|
description = self._og_search_description(webpage)
|
||||||
|
|
||||||
|
embedPage = self._download_webpage('http://www.comingsoon.it/videoplayer/embed/?idv=' + video_id, video_id, 'downloading webpage with video urls')
|
||||||
|
lowRes = self._search_regex(r'vLwRes: "(.*)"', embedPage, 'Low resolution filename', default=None)
|
||||||
|
highRes = self._search_regex(r'vHiRes: "(.*)"', embedPage, 'High ressolution filename', default=None)
|
||||||
|
formats = []
|
||||||
|
formats.append(
|
||||||
|
{
|
||||||
|
'url': 'http://video.comingsoon.it/' + lowRes,
|
||||||
|
'format': 'Standard Definition',
|
||||||
|
'format_id': 'sd'
|
||||||
|
})
|
||||||
|
if(lowRes != highRes):
|
||||||
|
formats.append(
|
||||||
|
{
|
||||||
|
'url': 'http://video.comingsoon.it/' + highRes,
|
||||||
|
'format': 'High Definition',
|
||||||
|
'format_id': 'hd'
|
||||||
|
})
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': description,
|
'description': description,
|
||||||
|
'formats': formats,
|
||||||
'formats': [
|
|
||||||
{
|
|
||||||
'url': 'http://video.comingsoon.it/MP4/' + video_id + '.mp4',
|
|
||||||
'format': 'Standard Definition',
|
|
||||||
'format_id': 'sd'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'url': 'http://video.comingsoon.it/MP4/' + video_id + 'HD.mp4',
|
|
||||||
'format': 'High Definition',
|
|
||||||
'format_id': 'hd'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'ext': 'mp4'
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user