mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-27 06:10:38 +01:00
[azmedien:showplaylist] Improve (closes #12160)
This commit is contained in:
parent
948519b35d
commit
43b38424a9
|
@ -1,3 +1,4 @@
|
||||||
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
@ -174,11 +175,10 @@ class AZMedienPlaylistIE(AZMedienBaseIE):
|
||||||
|
|
||||||
|
|
||||||
class AZMedienShowPlaylistIE(AZMedienBaseIE):
|
class AZMedienShowPlaylistIE(AZMedienBaseIE):
|
||||||
IE_DESC = 'AZ Medien Show playlists'
|
IE_DESC = 'AZ Medien show playlists'
|
||||||
_VALID_URL = r'''(?x)
|
_VALID_URL = r'''(?x)
|
||||||
https?://
|
https?://
|
||||||
(?:www\.)?
|
(?:www\.)?
|
||||||
(?P<id>
|
|
||||||
(?:
|
(?:
|
||||||
telezueri\.ch|
|
telezueri\.ch|
|
||||||
telebaern\.tv|
|
telebaern\.tv|
|
||||||
|
@ -187,22 +187,18 @@ class AZMedienShowPlaylistIE(AZMedienBaseIE):
|
||||||
(?:
|
(?:
|
||||||
all-episodes|
|
all-episodes|
|
||||||
alle-episoden
|
alle-episoden
|
||||||
)
|
)/
|
||||||
/[^/]+
|
(?P<id>[^/?#&]+)
|
||||||
)
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://www.telezueri.ch/all-episodes/astrotalk',
|
'url': 'http://www.telezueri.ch/all-episodes/astrotalk',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'telezueri.ch/all-episodes/astrotalk',
|
'id': 'astrotalk',
|
||||||
'title': 'TeleZüri: AstroTalk - alle episoden',
|
'title': 'TeleZüri: AstroTalk - alle episoden',
|
||||||
'description': 'md5:4c0f7e7d741d906004266e295ceb4a26',
|
'description': 'md5:4c0f7e7d741d906004266e295ceb4a26',
|
||||||
},
|
},
|
||||||
'playlist_mincount': 13,
|
'playlist_mincount': 13,
|
||||||
'params': {
|
|
||||||
'skip_download': True,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
@ -211,11 +207,7 @@ class AZMedienShowPlaylistIE(AZMedienBaseIE):
|
||||||
episodes = get_element_by_class('search-mobile-box', webpage)
|
episodes = get_element_by_class('search-mobile-box', webpage)
|
||||||
entries = [self.url_result(
|
entries = [self.url_result(
|
||||||
urljoin(url, m.group('url'))) for m in re.finditer(
|
urljoin(url, m.group('url'))) for m in re.finditer(
|
||||||
r'<a[^>]+href=(["\'])(?P<url>.+?)\1', episodes)]
|
r'<a[^>]+href=(["\'])(?P<url>(?:(?!\1).)+)\1', episodes)]
|
||||||
title = self._og_search_title(webpage)
|
title = self._og_search_title(webpage, fatal=False)
|
||||||
description = self._og_search_description(webpage)
|
description = self._og_search_description(webpage)
|
||||||
return self.playlist_result(
|
return self.playlist_result(entries, playlist_id, title, description)
|
||||||
entries,
|
|
||||||
playlist_id=playlist_id,
|
|
||||||
playlist_title=title,
|
|
||||||
playlist_description=description)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user