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

AttributeError: 'NoneType' object has no attribute 'span' pytube [bug] #1220

Open
HsuehFanTsai opened this issue Feb 1, 2022 · 8 comments
Open

Comments

@HsuehFanTsai
Copy link

here's one problem I encountered today, wondering if anyone would please help me fix it :

Traceback (most recent call last):
File "c:\Users\jason\Desktop\python\vscode\test\test_pytube.py", line 4, in
print(yt.streams)
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube_main_.py", line 293, in streams
return StreamQuery(self.fmt_streams)
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube_main_.py", line 178, in fmt_streams
extract.apply_signature(stream_manifest, self.vid_info, self.js)
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\extract.py", line 409, in apply_signature
cipher = Cipher(js=js)
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\cipher.py", line 43, in init
self.throttling_plan = get_throttling_plan(js)
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\cipher.py", line 387, in get_throttling_plan
raw_code = get_throttling_function_code(js)
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\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'

@github-actions
Copy link

github-actions bot commented Feb 1, 2022

Thank you for contributing to PyTube. Please remember to reference Contributing.md

@BraynStorm
Copy link

Duplicate of #1218

@HsuehFanTsai
Copy link
Author

Duplicate of #1218

the solution they offer in #1218 didn't work for me

@HsuehFanTsai HsuehFanTsai changed the title AttributeError: 'NoneType' object has no attribute 'span' pytube AttributeError: 'NoneType' object has no attribute 'span' pytube [bug] Feb 1, 2022
@paavampayyan
Copy link

here's one problem I encountered today, wondering if anyone would please help me fix it :

Traceback (most recent call last):
File "c:\Users\jason\Desktop\python\vscode\test\test_pytube.py", line 4, in
print(yt.streams)
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube__main__.py", line 293, in streams
return StreamQuery(self.fmt_streams)
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube__main__.py", line 178, in fmt_streams
extract.apply_signature(stream_manifest, self.vid_info, self.js)
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\extract.py", line 409, in apply_signature
cipher = Cipher(js=js)
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\cipher.py", line 43, in init
self.throttling_plan = get_throttling_plan(js)
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\cipher.py", line 387, in get_throttling_plan
raw_code = get_throttling_function_code(js)
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\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'

#1218 (comment) this worked

@HsuehFanTsai
Copy link
Author

#1218 (comment) this worked

File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\cipher.py", line 293
name = "iha"
^
IndentationError: unindent does not match any outer indentation level

I don't think so, but thanks.

@Pythonic-Rainbow
Copy link

#1218 (comment) this worked

File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\site-packages\pytube\cipher.py", line 293
name = "iha"
^
IndentationError: unindent does not match any outer indentation level

I don't think so, but thanks.

IndentationError indicates that it is your problem

@FebOne1
Copy link

FebOne1 commented Feb 3, 2022

the solution they offer in #1218 partially works, but not working for all videos.
I still get the issue after replacing the name to 'iha' when downloading "https://www.youtube.com/watch?v=-hLsqlKm-A4".

image

@quantum-hash
Copy link

the solution they offer in #1218 partially works, but not working for all videos. I still get the issue after replacing the name to 'iha' when downloading "https://www.youtube.com/watch?v=-hLsqlKm-A4".

image

Replacing the name to 'iha' did not work for me as well.
This is how i fixed it #1218 (comment)

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

6 participants