Skip to content

Commit

Permalink
[ie/youtube] Remove broken n function extraction fallback (yt-dlp#1…
Browse files Browse the repository at this point in the history
…0396)

Closes yt-dlp#10391
Authored by: pukkandan, seproDev

Co-authored-by: pukkandan <[email protected]>
  • Loading branch information
seproDev and pukkandan authored Jul 9, 2024
1 parent 0b570f2 commit 7ead733
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions yt_dlp/extractor/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -3151,17 +3151,7 @@ def _extract_n_function_code(self, video_id, player_url):

func_name = self._extract_n_function_name(jscode)

# For redundancy
func_code = self._search_regex(
rf'''(?xs){func_name}\s*=\s*function\s*\((?P<var>[\w$]+)\)\s*
# NB: The end of the regex is intentionally kept strict
{{(?P<code>.+?}}\s*return\ [\w$]+.join\(""\))}};''',
jscode, 'nsig function', group=('var', 'code'), default=None)
if func_code:
func_code = ([func_code[0]], func_code[1])
else:
self.write_debug('Extracting nsig function with jsinterp')
func_code = jsi.extract_function_code(func_name)
func_code = jsi.extract_function_code(func_name)

self.cache.store('youtube-nsig', player_id, func_code)
return jsi, player_id, func_code
Expand Down

0 comments on commit 7ead733

Please sign in to comment.