pytube: [BUG]
Before creating an issue
Please confirm that you are on the latest version of pytube by installing from the source.
You can do this by running python -m pip install git+https://github.com/pytube/pytube
.
Sometimes, the pypi library repository is not up to date, and your issue may have been fixed already!
Describe the bug A clear and concise description of what the bug is.
cannot download the youtube video. Worked last night no changes on PC, restarted.
To Reproduce Please provide the following information:
- The video or playlist url that is causing the error.
- The code where the problem is occurring.
import os from pytube import YouTube
Specify the URL of the YouTube video to download
url = input('Enter the URL of the YouTube video: ')
Destination directory for downloaded video
destination = ‘D:/youtube video/FNF’
yt = YouTube(url)
Filter the available video streams by file type and progressive download
video_streams = yt.streams.filter(progressive=True, file_extension=‘mp4’)
Get the highest resolution stream with both video and audio
video_stream = video_streams.get_highest_resolution()
Download the video stream to the specified destination directory
video_stream.download(destination)
print('The video has been downloaded to ’ + os.path.join(destination, video_stream.default_filename))
Expected behavior A clear and concise description of what you expected to happen.
Output If pytube raises an exception, please provide the full traceback for the exception.
I get this error:
File “d:\youtube video\FNF\high qulaity download.py”, line 13, in <module>
video_streams = yt.streams.filter(progressive=True, file_extension=‘mp4’)
^^^^^^^^^^
File “C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytube_main_.py”, line 296, in streams
return StreamQuery(self.fmt_streams)
^^^^^^^^^^^^^^^^
File “C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytube_main_.py”, line 176, in fmt_streams
stream_manifest = extract.apply_descrambler(self.streaming_data)
^^^^^^^^^^^^^^^^^^^
File “C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytube_main_.py”, line 161, in streaming_data return self.vid_info[‘streamingData’]
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: ‘streamingData’
System information Please provide the following information:
- Python version (run
python --version
) - Pytube version (run
print(pytube.__version__)
in python) - Command used to install pytube
windows 10, python 3.11, latest pytube versoin
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 31
This works well for me now…
Also, I put ‘ANDROID_EMBED’ to (about 80 line):
def __init__(self, client='ANDROID_EMBED', use_oauth=False, allow_cache=True):
These settings (innertube line 41 and 60) work for me. No other changes are needed.
But another issue (for some of the video): … is age restricted, and can’t be accessed without logging in.
Unfortunately, any changing of API Key leads to
urllib.error.HTTPError: HTTP Error 403: Forbidden
…If you install both pytube3 and pytube with pip, certain files get overwritten in unintended ways. You should be able to fix this problem if you do the following: Follow step by step