theMcSam / YouTube-Video-Downloader

Simple program in python for downloading YouTube videos.
2 stars 0 forks source link

Error during download: Download doesn't occur #3

Open trevenue44 opened 2 years ago

trevenue44 commented 2 years ago

I get the following error moments after I select the quality of video to download

Traceback (most recent call last):
  File "C:\Users\{user_name}\Desktop\McSam Tests\YouTube-Video-Downloader\ytd.py", line 119, in <module>
    main()
  File "C:\Users\{user_name}\Desktop\McSam Tests\YouTube-Video-Downloader\ytd.py", line 82, in main
    download_video(youTubeUrl,path)
  File "C:\Users\{user_name}\Desktop\McSam Tests\YouTube-Video-Downloader\ytd.py", line 89, in download_video
    video = yt.streams.filter(mime_type = "video/mp4", res = videoQuality[quality]).first()
  File "C:\anaconda3\envs\mcsam-tests\lib\site-packages\pytube\__main__.py", line 292, in streams
    return StreamQuery(self.fmt_streams)
  File "C:\anaconda3\envs\mcsam-tests\lib\site-packages\pytube\__main__.py", line 177, in fmt_streams
    extract.apply_signature(stream_manifest, self.vid_info, self.js)
  File "C:\anaconda3\envs\mcsam-tests\lib\site-packages\pytube\extract.py", line 409, in apply_signature
    cipher = Cipher(js=js)
  File "C:\anaconda3\envs\mcsam-tests\lib\site-packages\pytube\cipher.py", line 44, in __init__
    self.throttling_array = get_throttling_function_array(js)
  File "C:\anaconda3\envs\mcsam-tests\lib\site-packages\pytube\cipher.py", line 323, in get_throttling_function_array
    str_array = throttling_array_split(array_raw)
  File "C:\anaconda3\envs\mcsam-tests\lib\site-packages\pytube\parser.py", line 158, in throttling_array_split
    match_start, match_end = match.span()
AttributeError: 'NoneType' object has no attribute 'span'
theMcSam commented 2 years ago

Hello trevenue44,
Issue can be resolved by using installing the fixed version of pytube with the command below.
Command: pip install git+https://github.com/Zeecka/pytube@fix_1060

trevenue44 commented 2 years ago

Oh okay. I will do that and get back to you with feedback.