mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-03-09 12:50:23 -05:00
use re.sub
instead in description extraction
Co-authored-by: dirkf <fieldhouse@gmx.net>
This commit is contained in:
parent
28a1163010
commit
38383ea313
1 changed files with 4 additions and 6 deletions
|
@ -110,12 +110,10 @@ def _extract_formats(self, _id, item_type='MUSIC', **kwargs):
|
||||||
def _extract_page_metadata(self, webpage, _id, playlist=False):
|
def _extract_page_metadata(self, webpage, _id, playlist=False):
|
||||||
metadata_div = self._get_element_by_class_and_tag('summary', 'div', webpage) or ''
|
metadata_div = self._get_element_by_class_and_tag('summary', 'div', webpage) or ''
|
||||||
metadata_entries = re.findall(r'(?si)<strong>(?P<entry>.*?)</strong>', metadata_div) or []
|
metadata_entries = re.findall(r'(?si)<strong>(?P<entry>.*?)</strong>', metadata_div) or []
|
||||||
description = (
|
description = re.sub(
|
||||||
self._get_element_by_class_and_tag('description_content', 'span', webpage)
|
'(?i)Listen and download music for free on Boomplay!', '',
|
||||||
or 'Listen and download music for free on Boomplay!')
|
clean_html(self._get_element_by_class_and_tag(
|
||||||
description = clean_html(description.strip())
|
'description_content', 'span', webpage)) or '') or None
|
||||||
if description == 'Listen and download music for free on Boomplay!':
|
|
||||||
description = None
|
|
||||||
|
|
||||||
details_section = self._get_element_by_class_and_tag('songDetailInfo', 'section', webpage) or ''
|
details_section = self._get_element_by_class_and_tag('songDetailInfo', 'section', webpage) or ''
|
||||||
metadata_entries.extend(re.findall(r'(?si)<li>(?P<entry>.*?)</li>', details_section) or [])
|
metadata_entries.extend(re.findall(r'(?si)<li>(?P<entry>.*?)</li>', details_section) or [])
|
||||||
|
|
Loading…
Reference in a new issue