使用 PyTube 下载视频的问题
我知道有一些关于这个同一主题的帖子,但所有这些帖子都有点旧,而且没有一个对我有用。所以,我已经尝试了一切,升级了 Pytube,升级了 pip,切换到了 Pytube 和 Pip 的其他版本,重新安装了两者。但什么也没有,即使在脚本级别我也尝试过手动输入 url,并且我尝试过通过脚本传递 url。许多人也在许多不同的平台上尝试帮助我!但是,没有任何效果,什么也没有,我的意思是没有任何效果。基本上问题是,脚本到达视频下载部分,但无论我等多久,它都永远不会下载,甚至更短的视频,它说文件无法播放(因为 Pytube 没有完全获取视频)。请有人帮助我。
from pytube import YouTube
import time
print("The Youtube Video Downloader")
time.sleep(0.2)
print("\nBy: ViridianTelamon.")
time.sleep(0.2)
#url = input("\nInput The Full Url For The Youtube Video That You Want To Download (Shortened Urls Will Not Work): ")
url = input("\nInput The Url For The Video: ")
#print(f"Url Inputted: {url}")
#print(url)
video = YouTube(url)
time.sleep(0.2)
print("\n----------Video Title----------")
time.sleep(0.2)
print(video.title)
time.sleep(0.2)
print("\n----------Video Thumbnail Url----------")
time.sleep(0.2)
print(video.thumbnail_url)
time.sleep(2)
print("\n----------Video Download----------")
time.sleep(0.2)
video = video.streams.get_highest_resolution
video.download()
print("\nVideo Successful Downloaded In The Same Directory As This Script.")
I know that there are a few posts on this very same topic, but all of those posts are a bit old and none of them worked for me. So please, I have tried everything, upgraded Pytube, upgrading pip, switched to other versions of Pytube and Pip, reinstalled both. But nothing, even at the script level I have tried typing the url manually, and I have tried passing the url through the script. Many people have tried to help me on many different platforms as well! But, to no avail, NOTHING, and I mean NOTHING has worked. Basically the issue, the script gets up to the Video Download section, but it never downloads no matter how long I wait, even shorter videos, it says that the file can not be played (because of Pytube not fully getting the video). Someone please help me.
from pytube import YouTube
import time
print("The Youtube Video Downloader")
time.sleep(0.2)
print("\nBy: ViridianTelamon.")
time.sleep(0.2)
#url = input("\nInput The Full Url For The Youtube Video That You Want To Download (Shortened Urls Will Not Work): ")
url = input("\nInput The Url For The Video: ")
#print(f"Url Inputted: {url}")
#print(url)
video = YouTube(url)
time.sleep(0.2)
print("\n----------Video Title----------")
time.sleep(0.2)
print(video.title)
time.sleep(0.2)
print("\n----------Video Thumbnail Url----------")
time.sleep(0.2)
print(video.thumbnail_url)
time.sleep(2)
print("\n----------Video Download----------")
time.sleep(0.2)
video = video.streams.get_highest_resolution
video.download()
print("\nVideo Successful Downloaded In The Same Directory As This Script.")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您忘记了
()
For 函数You forgot the
()
For function