Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/yt-dlp/yt-dlp into ytdlp
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/yt-dlp/yt-dlp:
  [GlomexEmbed] Avoid large match objects
  • Loading branch information
Lesmiscore committed Jan 30, 2022
2 parents a7100a9 + 19afd9e commit ea0dd9d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions yt_dlp/extractor/glomex.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,13 @@ def _extract_urls(cls, webpage, origin_url):
)+</script>
)''' % {'quot_re': r'["\']', 'url_re': VALID_SRC}

for mobj in re.finditer(EMBED_RE, webpage):
mdict = mobj.groupdict()
for mtup in re.findall(EMBED_RE, webpage):
# re.finditer causes a memory spike. See https://github.com/yt-dlp/yt-dlp/issues/2512
mdict = dict(zip((
'url', '_',
'html_tag', '_', 'integration_html', '_', 'id_html', '_', 'glomex_player',
'script_tag', '_', '_', 'integration_js', '_', 'id_js',
), mtup))
if mdict.get('url'):
url = unescapeHTML(mdict['url'])
if not cls.suitable(url):
Expand Down

0 comments on commit ea0dd9d

Please sign in to comment.