0
0 Comments

keyword -youtube converter mp4 ,youtube converter mp4 converter
It has to work,but it gives me this error:

<code>File "C:\Users\ХарисВМладенов\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\customtkinter\windows\widgets\ctk_button.py", line 553, in _clicked
    self._command()
TypeError: Download() missing 1 required positional argument: 'url_var'</code>

Here is my code:

import tkinter as tk
import customtkinter as ctk
from pytube import YouTube

def Download(url_var):
try:
ytlink = link.get(url_var)
ytObject = YouTube(ytlink)
video = ytObject.streams.get_highest_resolution(url_var)
video.download(video)
except:
print("Invalid link")
print("Download Compleate")
ctk.set_appearance_mode("System")
ctk.set_default_color_theme("blue")

app = ctk.CTk()
app.geometry("720x480")
app.title("YouTube Download")

url_var = tk.StringVar()
title = ctk.CTkLabel(app, text="Insert a YouTube link")
title.pack(padx=10, pady=10)

link = ctk.CTkEntry(app, width=350, height=40, textvariable=url_var)
link.pack()

download = ctk.CTkButton(app, text="Download", command=Download)
download.pack()

app.mainloop()

I tried without the url_var but then it prints “Invalid link”

youtubedev Asked question July 21, 2023