Use unique part of xml url as the video id
This commit is contained in:
parent
e0c20193a1
commit
a8ea96d8ed
@ -16,7 +16,7 @@ class BetIE(InfoExtractor):
|
|||||||
{
|
{
|
||||||
'url': 'http://www.bet.com/news/politics/2014/12/08/in-bet-exclusive-obama-talks-race-and-racism.html',
|
'url': 'http://www.bet.com/news/politics/2014/12/08/in-bet-exclusive-obama-talks-race-and-racism.html',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'e0c430e7-14e8-414d-bd9d-c14c55cd406f',
|
'id': 'news/national/2014/a-conversation-with-president-obama',
|
||||||
'display_id': 'in-bet-exclusive-obama-talks-race-and-racism',
|
'display_id': 'in-bet-exclusive-obama-talks-race-and-racism',
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
'title': 'A Conversation With President Obama',
|
'title': 'A Conversation With President Obama',
|
||||||
@ -35,7 +35,7 @@ class BetIE(InfoExtractor):
|
|||||||
{
|
{
|
||||||
'url': 'http://www.bet.com/video/news/national/2014/justice-for-ferguson-a-community-reacts.html',
|
'url': 'http://www.bet.com/video/news/national/2014/justice-for-ferguson-a-community-reacts.html',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '0291d0f7-b8da-4423-9c5a-ebfa0368ef53',
|
'id': 'news/national/2014/justice-for-ferguson-a-community-reacts',
|
||||||
'display_id': 'justice-for-ferguson-a-community-reacts',
|
'display_id': 'justice-for-ferguson-a-community-reacts',
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
'title': 'Justice for Ferguson: A Community Reacts',
|
'title': 'Justice for Ferguson: A Community Reacts',
|
||||||
@ -61,6 +61,9 @@ class BetIE(InfoExtractor):
|
|||||||
[r'mediaURL\s*:\s*"([^"]+)"', r"var\s+mrssMediaUrl\s*=\s*'([^']+)'"],
|
[r'mediaURL\s*:\s*"([^"]+)"', r"var\s+mrssMediaUrl\s*=\s*'([^']+)'"],
|
||||||
webpage, 'media URL'))
|
webpage, 'media URL'))
|
||||||
|
|
||||||
|
video_id = self._search_regex(
|
||||||
|
r'/video/(.*)/_jcr_content/', media_url, 'video id')
|
||||||
|
|
||||||
mrss = self._download_xml(media_url, display_id)
|
mrss = self._download_xml(media_url, display_id)
|
||||||
|
|
||||||
item = mrss.find('./channel/item')
|
item = mrss.find('./channel/item')
|
||||||
@ -75,8 +78,6 @@ class BetIE(InfoExtractor):
|
|||||||
description = xpath_text(
|
description = xpath_text(
|
||||||
item, './description', 'description', fatal=False)
|
item, './description', 'description', fatal=False)
|
||||||
|
|
||||||
video_id = xpath_text(item, './guid', 'video id', fatal=False)
|
|
||||||
|
|
||||||
timestamp = parse_iso8601(xpath_text(
|
timestamp = parse_iso8601(xpath_text(
|
||||||
item, xpath_with_ns('./dc:date', NS_MAP),
|
item, xpath_with_ns('./dc:date', NS_MAP),
|
||||||
'upload date', fatal=False))
|
'upload date', fatal=False))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user