mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-03-02 04:09:41 +00:00
[ie/spankbang] Fix playlist title extraction (#14132)
Closes #14131 Authored by: blauerdorf
This commit is contained in:
@@ -3,6 +3,7 @@ import re
|
|||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
|
clean_html,
|
||||||
determine_ext,
|
determine_ext,
|
||||||
merge_dicts,
|
merge_dicts,
|
||||||
parse_duration,
|
parse_duration,
|
||||||
@@ -12,6 +13,7 @@ from ..utils import (
|
|||||||
urlencode_postdata,
|
urlencode_postdata,
|
||||||
urljoin,
|
urljoin,
|
||||||
)
|
)
|
||||||
|
from ..utils.traversal import find_element, traverse_obj, trim_str
|
||||||
|
|
||||||
|
|
||||||
class SpankBangIE(InfoExtractor):
|
class SpankBangIE(InfoExtractor):
|
||||||
@@ -189,8 +191,8 @@ class SpankBangPlaylistIE(InfoExtractor):
|
|||||||
r'<a[^>]+\bhref=(["\'])(?P<path>/?[\da-z]+-(?P<id>[\da-z]+)/playlist/[^"\'](?:(?!\1).)*)\1',
|
r'<a[^>]+\bhref=(["\'])(?P<path>/?[\da-z]+-(?P<id>[\da-z]+)/playlist/[^"\'](?:(?!\1).)*)\1',
|
||||||
webpage)]
|
webpage)]
|
||||||
|
|
||||||
title = self._html_search_regex(
|
title = traverse_obj(webpage, (
|
||||||
r'<em>([^<]+)</em>\s+playlist\s*<', webpage, 'playlist title',
|
{find_element(tag='h1', attr='data-testid', value='playlist-title')},
|
||||||
fatal=False)
|
{clean_html}, {trim_str(end=' Playlist')}))
|
||||||
|
|
||||||
return self.playlist_result(entries, playlist_id, title)
|
return self.playlist_result(entries, playlist_id, title)
|
||||||
|
|||||||
Reference in New Issue
Block a user