X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fwebofstories.py;h=2037d9b3d57cd5876d85e9552ffcc9f387fcc975;hb=5b251628e9f45c89c1becb3f62c4212874eb74ea;hp=d70e30c00a5943eea77b139f6219c0b39fd458f3;hpb=3f19b9b7c111ef0f12b880d8676a346280cc3ef4;p=youtube-dl.git diff --git a/youtube_dl/extractor/webofstories.py b/youtube_dl/extractor/webofstories.py index d70e30c00..2037d9b3d 100644 --- a/youtube_dl/extractor/webofstories.py +++ b/youtube_dl/extractor/webofstories.py @@ -104,7 +104,14 @@ class WebOfStoriesIE(InfoExtractor): class WebOfStoriesPlaylistIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?webofstories\.com/playAll/(?P[^/]+)' - _TESTS = [] + _TEST = { + 'url': 'http://www.webofstories.com/playAll/donald.knuth', + 'info_dict': { + 'id': 'donald.knuth', + 'title': 'Donald Knuth (Scientist)', + }, + 'playlist_mincount': 97, + } def _real_extract(self, url): playlist_id = self._match_id(url) @@ -116,10 +123,19 @@ class WebOfStoriesPlaylistIE(InfoExtractor): for video_number in set(re.findall('href="/playAll/%s\?sId=(\d+)"' % playlist_id, webpage)) ] - title = self._html_search_regex( - r'([^<]+)\s*-\s*Web\sof\sStories', webpage, 'title') - - description = self._html_search_meta( - 'description', webpage, 'description') - - return self.playlist_result(entries, playlist_id, title, description) + title = self._search_regex( + r'
\s*([^<]+)', + webpage, 'speaker', default=None) + if title: + field = self._search_regex( + r'([^<]+)', + webpage, 'field', default=None) + if field: + title += ' (%s)' % field + + if not title: + title = self._search_regex( + r'Play\s+all\s+stories\s*-\s*([^<]+)\s*-\s*Web\s+of\s+Stories', + webpage, 'title') + + return self.playlist_result(entries, playlist_id, title)