mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-05 02:55:53 +00:00
[aenetworks] fix extraction for shows with single season
This commit is contained in:
parent
bf2a5555c0
commit
20783b8b50
@ -101,10 +101,14 @@ class AENetworksIE(AENetworksBaseIE):
|
|||||||
for season_url_path in re.findall(r'(?s)<li[^>]+data-href="(/shows/%s/season-\d+)"' % url_parts[0], webpage):
|
for season_url_path in re.findall(r'(?s)<li[^>]+data-href="(/shows/%s/season-\d+)"' % url_parts[0], webpage):
|
||||||
entries.append(self.url_result(
|
entries.append(self.url_result(
|
||||||
compat_urlparse.urljoin(url, season_url_path), 'AENetworks'))
|
compat_urlparse.urljoin(url, season_url_path), 'AENetworks'))
|
||||||
return self.playlist_result(
|
if entries:
|
||||||
entries, self._html_search_meta('aetn:SeriesId', webpage),
|
return self.playlist_result(
|
||||||
self._html_search_meta('aetn:SeriesTitle', webpage))
|
entries, self._html_search_meta('aetn:SeriesId', webpage),
|
||||||
elif url_parts_len == 2:
|
self._html_search_meta('aetn:SeriesTitle', webpage))
|
||||||
|
else:
|
||||||
|
# single season
|
||||||
|
url_parts_len = 2
|
||||||
|
if url_parts_len == 2:
|
||||||
entries = []
|
entries = []
|
||||||
for episode_item in re.findall(r'(?s)<[^>]+class="[^"]*(?:episode|program)-item[^"]*"[^>]*>', webpage):
|
for episode_item in re.findall(r'(?s)<[^>]+class="[^"]*(?:episode|program)-item[^"]*"[^>]*>', webpage):
|
||||||
episode_attributes = extract_attributes(episode_item)
|
episode_attributes = extract_attributes(episode_item)
|
||||||
@ -112,7 +116,7 @@ class AENetworksIE(AENetworksBaseIE):
|
|||||||
url, episode_attributes['data-canonical'])
|
url, episode_attributes['data-canonical'])
|
||||||
entries.append(self.url_result(
|
entries.append(self.url_result(
|
||||||
episode_url, 'AENetworks',
|
episode_url, 'AENetworks',
|
||||||
episode_attributes['data-videoid']))
|
episode_attributes.get('data-videoid') or episode_attributes.get('data-video-id')))
|
||||||
return self.playlist_result(
|
return self.playlist_result(
|
||||||
entries, self._html_search_meta('aetn:SeasonId', webpage))
|
entries, self._html_search_meta('aetn:SeasonId', webpage))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user