mirror of
https://github.com/blackjack4494/yt-dlc.git
synced 2024-11-10 04:52:29 +01:00
[firstpost] Fix title extraction and add description
This commit is contained in:
parent
18061bbab0
commit
d2824416aa
@ -15,6 +15,7 @@ class FirstpostIE(InfoExtractor):
|
|||||||
'id': '1025403',
|
'id': '1025403',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'India to launch indigenous aircraft carrier INS Vikrant today',
|
'title': 'India to launch indigenous aircraft carrier INS Vikrant today',
|
||||||
|
'description': 'md5:feef3041cb09724e0bdc02843348f5f4',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,13 +23,16 @@ class FirstpostIE(InfoExtractor):
|
|||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
video_id = mobj.group('id')
|
video_id = mobj.group('id')
|
||||||
|
|
||||||
|
page = self._download_webpage(url, video_id)
|
||||||
|
title = self._html_search_meta('twitter:title', page, 'title')
|
||||||
|
description = self._html_search_meta('twitter:description', page, 'title')
|
||||||
|
|
||||||
data = self._download_xml(
|
data = self._download_xml(
|
||||||
'http://www.firstpost.com/getvideoxml-%s.xml' % video_id, video_id,
|
'http://www.firstpost.com/getvideoxml-%s.xml' % video_id, video_id,
|
||||||
'Downloading video XML')
|
'Downloading video XML')
|
||||||
|
|
||||||
item = data.find('./playlist/item')
|
item = data.find('./playlist/item')
|
||||||
thumbnail = item.find('./image').text
|
thumbnail = item.find('./image').text
|
||||||
title = item.find('./title').text
|
|
||||||
|
|
||||||
formats = [
|
formats = [
|
||||||
{
|
{
|
||||||
@ -42,6 +46,7 @@ class FirstpostIE(InfoExtractor):
|
|||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
|
'description': description,
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user