1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-15 22:07:26 +00:00

Revert to _VALID_URL to match video_id and integration

* Retrieve the last instance of said parameters that appears in the
  query string, rather than the first previously
* Resolve the respective comment in #30212
This commit is contained in:
Zenon Mousmoulas 2021-11-11 10:40:33 +02:00
parent abfc16a123
commit 4225c46d3b

View File

@ -6,7 +6,6 @@ import re
from .common import InfoExtractor from .common import InfoExtractor
from ..compat import ( from ..compat import (
compat_str, compat_str,
compat_parse_qs,
compat_urllib_parse_urlparse, compat_urllib_parse_urlparse,
compat_urllib_parse_urlencode, compat_urllib_parse_urlencode,
) )
@ -263,11 +262,13 @@ class GlomexEmbedIE(GlomexBaseIE):
def _real_extract(self, url): def _real_extract(self, url):
url, origin_url = self._unsmuggle_origin_url(url) url, origin_url = self._unsmuggle_origin_url(url)
embed_id = self._match_id(url) # must return a valid match since it was already tested when selecting the IE
query = compat_parse_qs(compat_urllib_parse_urlparse(url).query) try:
video_id = query['playlistId'][0] matches = self._VALID_URL_RE.match(url).groupdict()
# perhaps redundant except AttributeError:
assert embed_id == video_id matches = re.match(self._VALID_URL, url).groupdict()
integration = query['integrationId'][0] # id is not enforced in the pattern, so do it now; ditto integration
video_id = matches['id']
integration = matches['integration']
return self._download_and_extract_api_data(video_id, integration, return self._download_and_extract_api_data(video_id, integration,
origin_url) origin_url)