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

'NoneType' object has no attribute 'span' #9

Closed
amirhosk opened this issue Nov 23, 2021 · 9 comments
Closed

'NoneType' object has no attribute 'span' #9

amirhosk opened this issue Nov 23, 2021 · 9 comments

Comments

@amirhosk
Copy link

When I run any of demos, I get an error. Any suggestions?

(kapao) Me:~/kapao$ python demos/squash.py --display --fps
Traceback (most recent call last):
File "demos/squash.py", line 83, in
stream = [s for s in yt.streams if s.itag == 137][0] # 1080p, 25 fps
File "/home/media/miniconda3/envs/kapao/lib/python3.6/site-packages/pytube/main.py", line 292, in streams
return StreamQuery(self.fmt_streams)
File "/home/media/miniconda3/envs/kapao/lib/python3.6/site-packages/pytube/main.py", line 177, in fmt_streams
extract.apply_signature(stream_manifest, self.vid_info, self.js)
File "/home/media/miniconda3/envs/kapao/lib/python3.6/site-packages/pytube/extract.py", line 409, in apply_signature
cipher = Cipher(js=js)
File "/home/media/miniconda3/envs/kapao/lib/python3.6/site-packages/pytube/cipher.py", line 44, in init
self.throttling_array = get_throttling_function_array(js)
File "/home/media/miniconda3/envs/kapao/lib/python3.6/site-packages/pytube/cipher.py", line 323, in get_throttling_function_array
str_array = throttling_array_split(array_raw)
File "/home/media/miniconda3/envs/kapao/lib/python3.6/site-packages/pytube/parser.py", line 158, in throttling_array_split
match_start, match_end = match.span()
AttributeError: 'NoneType' object has no attribute 'span'

@wmcnally
Copy link
Owner

wmcnally commented Nov 23, 2021

Are you connected to the internet? The demos download YouTube videos via the pytube package.

@amirhosk
Copy link
Author

Yes, do I need to update my pytube lib?

@wmcnally
Copy link
Owner

Perhaps. Please use this one, which has a recent patch: $ pip install git+https://github.com/baxterisme/pytube

@amirhosk
Copy link
Author

Still doesn't work. How can I run it on an image in my pc to make sure the issue isn't relevant to pytube?

@wmcnally
Copy link
Owner

It's not working for me either. I can assure you it's a pytube issue. YouTube must have changed their formatting and therefore pytube requires a new patch. This must have happened today. I will look into a fix and additionally provide a general script to process a local video.

@wmcnally
Copy link
Owner

It worked for me today. Can you try again? Maybe youtube was down...

@amirhosk
Copy link
Author

It's working for me as well, thanks

@wmcnally
Copy link
Owner

@amirhosk FYI I uploaded a static image demo

@amirhosk
Copy link
Author

I just found it. sounds great. thanks!

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

2 participants