Stop being the product.
Become the owner.
or
sign uplog in
ap=1padtbipUDsNeed help

So I recently followed a tutorial on YouTube about how to make a YouTube Downloader GUI on python, but it kept saying that the link is invalid at every link I tried it with.

Can someone help me about it?

import tkinter
import customtkinter
from pytube import YouTube

def startdownload():
    try:
        ytLink=link.get()
        ytobject=YouTube(ytLink)
        video=ytobject.streams.get_highest_resolution()
        video.download(output_path=r"C:\Users\Eleve\Downloads\YT")
        print("Download Complete!")
    except:
        print("Youtube link is invalid")
   


#System ettings
customtkinter.set_appearance_mode("System")
customtkinter.set_default_color_theme("blue")

#App frame
app=customtkinter.CTk()
app.geometry("720x480")
app.title("Youtube ownloader")

#Add I elements
title=customtkinter.CTkLabel(app,text="Link")
title.pack(padx=10, ady=10)

#Link nput
url_var=customtkinter.StringVar()
link=customtkinter.CTkEntry(app, width=350, height=40, textvariable=url_var)
link.pack()

#Dowload utton
download= customtkinter.CTkButton(app, ext="Download", command=startdownload)
download.pack(padx=0)


p
app.mainloop()

#dev #technology #programming #Run 1y0,
=
=`
+= i++=ihhrNhJS array keeps previous values even after clearing.

I'm trying to create new divs at the click of a button that displays different links a user has entered. For some reason, each new div also shows the links previously entered even after I cleared the array.

For example:

User Enters:  example.com ttp://example.com New div displays:  example.com http://example.com

User creates new div and enters:  random.com http://random.com ew Div displays:  example.com http://example.com andom.com ttp://random.com instead of just:  random.com ttp://random.com

This is the code below, let me know if I'm making any sense.

var websites = [];
var newSites = [];
var folderName = "";

// displays a folder after pressing done
function displayFolder() {
newSites = [...websites];
websites = [];

if(document.querySelector('#add-title input').value.length == 0){
alert("Please enter a title.");
}
else if(newSites.length == 0){
alert("Please enter a link.");
}
else {
// display title
folderName = document.querySelector('#add-title nput').value;
document.getElementById('folder-title').innerHTML folderName;

// display websites
for (var i = 0; i < newSites.lengt{
document.querySelector('#folder-container').innerH <div class="active-links">
<span id="content">
<a href=${newSites[i]}>${newSites[i]}</a>
</span>
</div> `;
}

closePopup();

let div = document.createElement('div');
div.innerHTML document.getElementById('folder').innerHTML;
document.body.appendChild(div);
newSites = [];
document.getElementById('none').style.display "none";
}
}
#dev #programming #technology #js TM L )h;   
loved
1
laughed
1
shocked
1
#QUESTION Does anyone know why I no longer #ADD 20,000 millix that I earned every 30 minutes for being logged in and interacting with the platform? The last 3 days I have received them only once and today they didn't even give it to me

#Millix #doubt #Question #Help #DigitalArt #whatswrong

loved
3
shocked
3
laughed
2
not impressed
1