【问题标题】:Pytube error: urllib.error.HTTPError: HTTP Error 404: Not FoundPytube 错误:urllib.error.HTTPError:HTTP 错误 404:未找到
【发布时间】:2021-06-30 05:36:17
【问题描述】:

from pytube import YouTube

url = 'https://youtu.be/7hvcJK5-OLI'
my_video = YouTube(url)

print("=================== Video Title ====================")
print(my_video.title)                                             # This prints the title of the youtube video

print("=================== Thumbnail Image ====================")
print(my_video.thumbnail_url)                                     # This prints the thumbnail link in terminal

print("=================== Download Video ====================")

choise = input("Do you want to download mp3 or mp4: ")

if choise.lower() == 'mp4':
    my_video = my_video.streams.get_highest_resolution()          # We set the resolusion of the video

elif choise.lower() == 'mp3':
    my_video = my_video.streams.get_audio_only()                  # To get only audio we set this

else:
    print("Invalid option! ")
    exit()

my_video.download()

这是我的代码。我正在尝试为项目制作简单的 youtube 下载器,但它一直抛出 HTTP 错误:404,尽管我的 url 也是正确的

【问题讨论】:

    标签: python pytube


    【解决方案1】:

    您只需将pytube 更新到最新版本10.8.5

    只需运行pip install --upgrade pytube

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-03
      • 2020-11-21
      • 2017-10-16
      • 1970-01-01
      • 2021-09-30
      • 1970-01-01
      • 2021-04-02
      相关资源
      最近更新 更多