title: Python error: urllib.error.HTTPError: HTTP Error 404: Not Found
body: <p>I am building a python project for the school (YouTube video downloader), but when I run it, it appears this error: urllib.error.HTTPError: HTTP Error 404: Not Found
  I have already tried other codes from other people and no one worked, I think is my computer. What can I do?</p>
  <p>Here's the code:</p>
  <pre><code>from tkinter import *
  from tkinter import ttk
  from tkinter import filedialog
  from pytube import YouTube #pip install pytube3
  
  Folder_Name = &quot;&quot;
  
  #file location
  def openLocation():
      global Folder_Name
      Folder_Name = filedialog.askdirectory()
      if(len(Folder_Name) &gt; 1):
      locationError.config(text=Folder_Name,fg=&quot;green&quot;)
  
  else:
      locationError.config(text=&quot;Please Choose Folder!!&quot;,fg=&quot;red&quot;)
  
  #donwload video
  def DownloadVideo():
      choice = ytdchoices.get()
      url = ytdEntry.get()
  
  if(len(url)&gt;1):
      ytdError.config(text=&quot;&quot;)
      yt = YouTube(url)
  
      if(choice == choices[0]):
          select = yt.streams.filter(progressive=True).first()
  
      elif(choice == choices[1]):
          select = yt.streams.filter(progressive=True,file_extension='mp4').last()
  
      elif(choice == choices[2]):
          select = yt.streams.filter(only_audio=True).first()
  
      else:
          ytdError.config(text=&quot;Paste Link again!!&quot;,fg=&quot;red&quot;)
  
  
  #download function
  select.download(Folder_Name)
  ytdError.config(text=&quot;Download Completed!!&quot;)
  
  
  
  root = Tk()
  root.title(&quot;YTD Downloader&quot;)
  root.geometry(&quot;350x400&quot;) #set window
  root.columnconfigure(0,weight=1)#set all content in center.
  
  #Ytd Link Label
  ytdLabel = Label(root,text=&quot;Enter the URL of the Video&quot;,font=(&quot;jost&quot;,15))
  ytdLabel.grid()
  
  #Entry Box
  ytdEntryVar = StringVar()
  ytdEntry = Entry(root,width=50,textvariable=ytdEntryVar)
  ytdEntry.grid()
  
  #Error Msg
  ytdError = Label(root,text=&quot;Error Msg&quot;,fg=&quot;red&quot;,font=(&quot;jost&quot;,10))
  ytdError.grid()
  
  #Asking save file label
  saveLabel = Label(root,text=&quot;Save the Video File&quot;,font=(&quot;jost&quot;,15,&quot;bold&quot;))
  saveLabel.grid()
  
  #btn of save file
  saveEntry = Button(root,width=10,bg=&quot;red&quot;,fg=&quot;white&quot;,text=&quot;Choose Path&quot;,command=openLocation)
  saveEntry.grid()
  
  #Error Msg location
  locationError = Label(root,text=&quot;Error Msg of Path&quot;,fg=&quot;red&quot;,font=(&quot;jost&quot;,10))
  locationError.grid()
  
  #Download Quality
  ytdQuality = Label(root,text=&quot;Select Quality&quot;,font=(&quot;jost&quot;,15))
  ytdQuality.grid()
  
  #combobox
  choices = [&quot;720p&quot;,&quot;144p&quot;,&quot;Only Audio&quot;]
  ytdchoices = ttk.Combobox(root,values=choices)
  ytdchoices.grid()
  
  #donwload btn
  downloadbtn = Button(root,text=&quot;Donwload&quot;,width=10,bg=&quot;red&quot;,fg=&quot;white&quot;,command=DownloadVideo)
  downloadbtn.grid()
  
  #developer Label
  developerlabel = Label(root,text=&quot;Dream Developers&quot;,font=(&quot;jost&quot;,15))
  developerlabel.grid()
  root.mainloop()
  </code></pre>
  <p>And here is the terminal:
  <a href="https://i.stack.imgur.com/r71uj.png" rel="nofollow noreferrer">Terminal</a></p>
  <p><a href="https://i.stack.imgur.com/hJ4eK.png" rel="nofollow noreferrer">Terminal</a></p>