mirror of
https://github.com/Ninluc/Dat_Boi.git
synced 2025-08-09 23:26:13 +02:00
29 lines
790 B
Python
29 lines
790 B
Python
# coding: utf-8
|
|
|
|
from pytube import YouTube
|
|
import os
|
|
|
|
#ask for the link from user
|
|
names = []
|
|
links = []
|
|
|
|
|
|
for link in links:
|
|
|
|
yt = YouTube(link)
|
|
#Showing details
|
|
print("Title: ",yt.title)
|
|
print("Number of views: ",yt.views)
|
|
print("Length of video: ",yt.length)
|
|
print("Rating of video: ",yt.rating)
|
|
#Getting the highest resolution possible
|
|
ys = yt.streams.filter(only_audio=True).first()
|
|
|
|
#Starting download
|
|
print("Downloading...")
|
|
ys.download(output_path=f"/home/ninluc/Documents/codage/discord/Dat_Boi/sounds/")
|
|
os.rename(f"/home/ninluc/Documents/codage/discord/Dat_Boi/sounds/{yt.title}.mp4", f"/home/ninluc/Documents/codage/discord/Dat_Boi/sounds/{yt.title}.mp3")
|
|
print("Download completed!!")
|
|
names.append(yt.title)
|
|
|
|
print(names) |