diff options
author | Matthew <coletdjnz@protonmail.com> | 2022-10-09 18:55:26 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-09 05:55:26 +0000 |
commit | 4c9a1a3ba56c2906f9ef8d768de7f8e5a2361144 (patch) | |
tree | 257a60ee52b2a803875118fdbd2ca8288a5a5585 /yt_dlp/utils.py | |
parent | 1d55ebabc93b8e422a0126fc307f2a8e50fa5a97 (diff) | |
download | hypervideo-pre-4c9a1a3ba56c2906f9ef8d768de7f8e5a2361144.tar.lz hypervideo-pre-4c9a1a3ba56c2906f9ef8d768de7f8e5a2361144.tar.xz hypervideo-pre-4c9a1a3ba56c2906f9ef8d768de7f8e5a2361144.zip |
[extractor/wordpress:mb.miniAudioPlayer] Add embed extractor (#5087)
Closes https://github.com/yt-dlp/yt-dlp/issues/4994
Authored by: coletdjnz
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r-- | yt_dlp/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index cb14908c7..5a88a928d 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -408,7 +408,7 @@ def get_elements_html_by_attribute(*args, **kwargs): return [whole for _, whole in get_elements_text_and_html_by_attribute(*args, **kwargs)] -def get_elements_text_and_html_by_attribute(attribute, value, html, escape_value=True): +def get_elements_text_and_html_by_attribute(attribute, value, html, *, tag=r'[\w:.-]+', escape_value=True): """ Return the text (content) and the html (whole) of the tag with the specified attribute in the passed HTML document @@ -419,7 +419,7 @@ def get_elements_text_and_html_by_attribute(attribute, value, html, escape_value value = re.escape(value) if escape_value else value partial_element_re = rf'''(?x) - <(?P<tag>[a-zA-Z0-9:._-]+) + <(?P<tag>{tag}) (?:\s(?:[^>"']|"[^"]*"|'[^']*')*)? \s{re.escape(attribute)}\s*=\s*(?P<_q>['"]{quote})(?-x:{value})(?P=_q) ''' |