Sign-Language-Recognition--MediaPipe-DTW icon indicating copy to clipboard operation
Sign-Language-Recognition--MediaPipe-DTW copied to clipboard

Issue: Pulling Video from Youtube

Open ianb445 opened this issue 3 years ago • 2 comments

Hi,

When trying to pull videos from youtube, I receive the following error:

File "C:\Python\Sign-Language-Recognition--MediaPipe-DTW-master\yt_download.py", line 53, in download_video(*row) File "C:\Python\Sign-Language-Recognition--MediaPipe-DTW-master\yt_download.py", line 20, in download_video YouTube(f"https://www.youtube.com/watch?v={video_id}") File "C:\Python\Python38\lib\site-packages\pytube_main_.py", line 292, in streams return StreamQuery(self.fmt_streams) File "C:\Python\Python38\lib\site-packages\pytube_main_.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "C:\Python\Python38\lib\site-packages\pytube\extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "C:\Python\Python38\lib\site-packages\pytube\cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) File "C:\Python\Python38\lib\site-packages\pytube\cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "C:\Python\Python38\lib\site-packages\pytube\cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span'

Any suggestions?

Ian

ianb445 avatar Jan 11 '23 13:01 ianb445

Hi,

When trying to pull videos from youtube, I receive the following error:

File "C:\Python\Sign-Language-Recognition--MediaPipe-DTW-master\yt_download.py", line 53, in download_video(*row) File "C:\Python\Sign-Language-Recognition--MediaPipe-DTW-master\yt_download.py", line 20, in download_video YouTube(f"https://www.youtube.com/watch?v={video_id}") File "C:\Python\Python38\lib\site-packages\pytube__main__.py", line 292, in streams return StreamQuery(self.fmt_streams) File "C:\Python\Python38\lib\site-packages\pytube__main__.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "C:\Python\Python38\lib\site-packages\pytube\extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "C:\Python\Python38\lib\site-packages\pytube\cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) File "C:\Python\Python38\lib\site-packages\pytube\cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "C:\Python\Python38\lib\site-packages\pytube\cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span'

Any suggestions?

Ian

The problematic version was 11.0.1 and now has already been fixed, so you just need to upgrade to the newer version, and will be working fine again: pip install --upgrade pytube

luoxue-star avatar Apr 14 '23 13:04 luoxue-star

its an issue with the newest pytube version, so use mrmechanik 's solution: https://github.com/pytube/pytube/issues/1678

yeva-eva avatar Jun 26 '23 01:06 yeva-eva