I am trying to create a YouTube video downloader in python using pytube and tkinter. Most of the videos are getting downloaded fine but in some videos I am
The fix is pretty simple, it's there in the GitHub repo, but since this question came up here, this is how I fixed it. It's not due to the way your file works, it's a problem that happened because YouTube changed their search patterns or something from cipher to signatureCipher.
First, say pip install pytube3
in the terminal.
Second, go to the path - C:\Users\<user>\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\pytube
. Keep in mind the path will vary so replace <user>
with your Windows username and python37-32
with your Python version that you install pytube on.
Third, open extract.py
from the above navigated directory and head onto line 301 or search for the line:
cipher_url = [
parse_qs(formats[i]["cipher"]) for i, data in enumerate(formats)
]
cipher_url = [
parse_qs(formats[i]["signatureCipher"]) for i, data in enumerate(formats)
]
In case you damage this file while making changes to it, just say pip uninstall pytube3
and then install it again, and repeat. Keep in mind your imports will still be import pytube
.