【发布时间】:2022-12-28 00:11:26
【问题描述】:
I am getting the error
KeyError: 'content-length'
while downloading videos. Specifically for this one, whenever I try to download this video in 1080p, I get the error.
To Reproduce
Try downloading this video in 1080p resolution with pytube. https://www.youtube.com/watch?v=6PDxyCLaTeU
Code
from pytube import YouTube yt = YouTube("https://www.youtube.com/watch?v=6PDxyCLaTeU") yt.streams.filter(resolution="1080p").first().download()Exception
return int(head(url)["content-length"]) KeyError: 'content-length'System information
- Python version : Python 3.9.2
- Pytube version : 12.0.0
- Command used to install pytube : pip install pytube
【问题讨论】:
-
Looks like a bug in the library you are using. There isn't much we can do to help, you should report the issue to the maintainers of PyTube. Maybe include the full backtrace when you do.
-
@MarcoBonelli, Yes I did create a issue in the repo of PyTube, but no response ... that's why created a question here too ... lets see what happens