diff --git a/src/YouTubeVideoUrl.py b/src/YouTubeVideoUrl.py index d9ec948..6b078a1 100644 --- a/src/YouTubeVideoUrl.py +++ b/src/YouTubeVideoUrl.py @@ -372,8 +372,10 @@ def _extract_signature_timestamp(self): def _extract_visitor_id(self, video_id): webpage = self._download_webpage('https://www.youtube.com/watch?v=%s&bpctr=9999999999&has_verified=1' % video_id) + print('[YouTubeVideoUrl] extract_visitor_id') if webpage: - ytcfg = search(r'ytcfg\.set\s*\(\s*({[^}]+})\s*\)\s*;', webpage) + print('[YouTubeVideoUrl] search webpage') + ytcfg = search(r'ytcfg\.set\s*\(\s*({.+?})\s*\)\s*;', webpage) if ytcfg: data = loads(ytcfg.group(1)) print('[YouTubeVideoUrl] visitor data0', data.get('VISITOR_DATA'))