Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: Pulling Video from Youtube #22

Open
ianb445 opened this issue Jan 11, 2023 · 2 comments
Open

Issue: Pulling Video from Youtube #22

ianb445 opened this issue Jan 11, 2023 · 2 comments

Comments

@ianb445
Copy link

ianb445 commented Jan 11, 2023

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

@luoxue-star
Copy link

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

@yeva-eva
Copy link

its an issue with the newest pytube version, so use mrmechanik 's solution: pytube/pytube#1678

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants