r/pythonhelp • • Feb 22 '22

Issue with URL pasting in Python

Hey there, so recently I've been trying to make a Youtube Video Downloader, and for some reason when I input a FULL url it shows an error that goes something like: File "c:\Users\User\OneDrive\Desktop\The Youtube Video Downloader.py", line 10, in <module> video = YouTube(url)

Anyways Here Is The Script:

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.")

0 Upvotes

13 comments sorted by

View all comments

Show parent comments

1

u/MT1961 Feb 23 '22

Same error. Looks like a bug in the YouTube package.

1

u/ViridianGuy Feb 23 '22

Damn, I'm sorry for maybe being annoying but how would I fix this, I really want this script to work.

1

u/MT1961 Feb 23 '22

I understand, but I don't really know a lot about the YouTube api. Maybe find a different package?