Skip to content

Commit

Permalink
YouTubeVideoUrl: replace use of a reluctant quantifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Taapat committed May 6, 2024
1 parent 8595da8 commit 8009bac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/YouTubeVideoUrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def _extract_web_response(self, video_id):
url = 'https://www.youtube.com/watch?v=%s&bpctr=9999999999&has_verified=1' % video_id
webpage = self._download_webpage(url)
if webpage:
player_response = search(r'ytInitialPlayerResponse\s*=\s*({.+?})\s*;\s*(?:var\s+meta|</script|\n)', webpage)
player_response = search(r'ytInitialPlayerResponse\s*=\s*({[^>]*})\s*;\s*(?:var\s+meta|</script|\n)', webpage)
if player_response:
try:
return loads(player_response.group(1)), self._extract_player_info()
Expand Down

0 comments on commit 8009bac

Please sign in to comment.