improve regex

This commit is contained in:
grqx_wsl 2024-11-04 14:19:52 +13:00
parent 9a6f9843c0
commit 901e78af62

View file

@ -165,9 +165,7 @@ def _extract_embed_urls(cls, url, webpage):
<a <a
(?:\s(?:[^>"']|"[^"]*"|'[^']*')*)? (?:\s(?:[^>"']|"[^"]*"|'[^']*')*)?
(?<=\s)href\s*=\s*(?P<_q>['"]) (?<=\s)href\s*=\s*(?P<_q>['"])
(?: (?!javascript:)(?P<href>/(?:{media_types})/\d+/?[\-\w=?&#:;@]*)
(?!javascript:)(?P<href>/(?:{media_types})/\d+/?[\-a-zA-Z=?&#:;@]*)
)
(?P=_q) (?P=_q)
(?:\s(?:[^>"']|"[^"]*"|'[^']*')*)? (?:\s(?:[^>"']|"[^"]*"|'[^']*')*)?
>''', webpage): >''', webpage):