mirror of
https://github.com/Ninluc/Dat_Boi.git
synced 2025-08-09 23:26:13 +02:00
Initial commit
This commit is contained in:
29
misc/scripts/ytDownloader.py
Normal file
29
misc/scripts/ytDownloader.py
Normal file
@ -0,0 +1,29 @@
|
||||
# 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)
|
Reference in New Issue
Block a user