문제
pytube 사용시 AttributeError: 'NoneType' object has no attribute 'span'이 발생한다.
해결방법
Found this issue, pytube v11.0.1. It's a little late for me, but if no one has submitted a fix tomorrow I'll check it out.
in C:\Python38\lib\site-packages\pytube\parser.py
Change this line:
152: func_regex = re.compile(r"function\([^)]+\)")
to this:
152: func_regex = re.compile(r"function\([^)]?\)")
The issue is that the regex expects a function with an argument, but I guess youtube added some src that includes non-paramterized functions.
현재 문제의 원인이 되고 있는 parser.py를 여셔서 152줄의 코드 중 '+'를 '?'로 변경해주시면 정상 작동합니다.
반응형
'코딩 | 개념 정리 > Python' 카테고리의 다른 글
DevTools listening on ws:.. 오류 해결 (0) | 2022.02.11 |
---|---|
[엑셀자동화with파이썬] Pandas 라이브러리 (0) | 2021.12.25 |
[Python] Jupyter notebook 단축키 정리 (2) | 2021.09.06 |
[Python] C언어와 비교한 변수와 입력 (0) | 2021.07.04 |
[Python] 문자열 (0) | 2021.07.03 |