Open jinhang87 opened 4 weeks ago
Hi @jinhang87, could you do a test?
On line 395 of pytubefix's __main__
file, change the client to 'IOS'
and tell us the result.
change this:
self.client = 'WEB'
innertube = InnerTube(
client=self.client,
use_oauth=self.use_oauth,
allow_cache=self.allow_oauth_cache,
token_file=self.token_file,
)
For that:
self.client = 'IOS'
innertube = InnerTube(
client=self.client,
use_oauth=self.use_oauth,
allow_cache=self.allow_oauth_cache,
token_file=self.token_file,
)
Hello, I used this parameter here, and it's the same error
Traceback (most recent call last):
File "D:\code\python\project\examples\pytube\test_pytubefix_issue.py", line 22, in <module>
test_YouTube()
File "D:\code\python\project\examples\pytube\test_pytubefix_issue.py", line 8, in test_YouTube
video_stream = yt.streams.get_highest_resolution()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pytubefix\__main__.py", line 564, in streams
self.check_availability()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pytubefix\__main__.py", line 321, in check_availability
self.age_check()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pytubefix\__main__.py", line 418, in age_check
raise exceptions.AgeCheckRequiredError(self.video_id)
pytubefix.exceptions.AgeCheckRequiredError: 70dcBUFysyo has age restrictions and cannot be accessed without confirmation.
I tested with several accounts and several videos, and they all worked for me.
Could you debug line 410 of __main__
and show us the result of playability_status
.
url = 'https://www.youtube.com/watch?v=z528yJglerI' # has age restrictions and cannot be accessed without confirmation.
playability_status: AGE_CHECK_REQUIRED
I really didn't find anything wrong with the library, maybe this is a local problem. try deleting the __cache__
folder from pytubefix or try opening an age-restricted video on the official YouTube web, confirm your age and use the same account to log in with use_oauth
. Or if you would prefer to investigate the issue, I would be happy to help.
Describe the bug Hello, I found that a small number of videos prompt this error. Please help take a look.
To Reproduce Steps to reproduce the behavior:
def test_YouTube(): url = 'https://www.youtube.com/watch?v=70dcBUFysyo' # has age restrictions and cannot be accessed without confirmation.
def show_download_progress(stream, chunk, bytes_remaining): total_size = stream.filesize bytes_downloaded = total_size - bytes_remaining
if name == 'main': test_YouTube()
Traceback (most recent call last): File "D:\code\python\project\examples\pytube\test_pytubefix.py", line 74, in
if name == 'main':
File "D:\code\python\project\examples\pytube\test_pytubefix.py", line 15, in test_YouTube
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pytubefix__main__.py", line 563, in streams self.check_availability() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pytubefix__main.py", line 321, in check_availability self.age_check() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pytubefix\main__.py", line 417, in age_check raise exceptions.AgeCheckRequiredError(self.video_id) pytubefix.exceptions.AgeCheckRequiredError: 70dcBUFysyo has age restrictions and cannot be accessed without confirmation.