mirror of
https://github.com/l1ving/youtube-dl
synced 2020-11-18 19:53:54 -08:00
Matched to Daniel Heath's earlier version of ABCIViewShowIE.
This commit is contained in:
parent
5e8d882b19
commit
2b90c649bb
@ -229,8 +229,8 @@ class ABCIViewIE(InfoExtractor):
|
|||||||
is_live=is_live)
|
is_live=is_live)
|
||||||
|
|
||||||
|
|
||||||
class ABCIViewSeriesIE(ABCIViewIE):
|
class ABCIViewShowIE(ABCIViewIE):
|
||||||
IE_NAME = 'abc.net.au:iview:series'
|
IE_NAME = 'abc.net.au:iview:show'
|
||||||
_VALID_URL = r'https?://iview\.abc\.net\.au/(show|programs)/(?P<id>[^/?#]+)/?'
|
_VALID_URL = r'https?://iview\.abc\.net\.au/(show|programs)/(?P<id>[^/?#]+)/?'
|
||||||
|
|
||||||
_TESTS = [
|
_TESTS = [
|
||||||
@ -256,16 +256,19 @@ class ABCIViewSeriesIE(ABCIViewIE):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def suitable(cls, url):
|
def suitable(cls, url):
|
||||||
return False if ABCIViewIE.suitable(url) else super(ABCIViewSeriesIE, cls).suitable(url)
|
return False if ABCIViewIE.suitable(url) else super(ABCIViewShowIE, cls).suitable(url)
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
series_id = self._match_id(url)
|
show_id = self._match_id(url)
|
||||||
series_params = self._download_json(
|
show_data = self._download_json(
|
||||||
'https://iview.abc.net.au/api/series/' + series_id, series_id)
|
'https://iview.abc.net.au/api/series/' + show_id, show_id)
|
||||||
|
|
||||||
|
title = show_data.get('seriesDescription') or show_id
|
||||||
|
description = show_data.get('seriesDescription')
|
||||||
|
|
||||||
# Sometimes the episodes are listed in reverse order, with the most recently uploaded ones first.
|
# Sometimes the episodes are listed in reverse order, with the most recently uploaded ones first.
|
||||||
# This is normally for time-limited series. Others appear oldest to newest
|
# This is normally for time-limited series. Others appear oldest to newest
|
||||||
episodes = series_params.get('episodes')
|
episodes = show_data.get('episodes')
|
||||||
entries = []
|
entries = []
|
||||||
|
|
||||||
for episode in episodes:
|
for episode in episodes:
|
||||||
@ -279,8 +282,9 @@ class ABCIViewSeriesIE(ABCIViewIE):
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
'_type': 'playlist',
|
'_type': 'playlist',
|
||||||
'title': series_params.get('seriesTitle'),
|
'id': show_id,
|
||||||
'description': series_params.get('seriesDescription'),
|
'title': title,
|
||||||
|
'description': description,
|
||||||
'uploader_id': entries[0].get('uploader_id') if entries else None,
|
'uploader_id': entries[0].get('uploader_id') if entries else None,
|
||||||
'entries': entries
|
'entries': entries
|
||||||
}
|
}
|
@ -4,7 +4,7 @@ from __future__ import unicode_literals
|
|||||||
from .abc import (
|
from .abc import (
|
||||||
ABCIE,
|
ABCIE,
|
||||||
ABCIViewIE,
|
ABCIViewIE,
|
||||||
ABCIViewSeriesIE,
|
ABCIViewShowIE,
|
||||||
)
|
)
|
||||||
from .abcnews import (
|
from .abcnews import (
|
||||||
AbcNewsIE,
|
AbcNewsIE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user