From ed71d6de5f1d96845721d814f274e0339fc55445 Mon Sep 17 00:00:00 2001 From: Dhanush Date: Tue, 4 Oct 2022 23:11:42 +0530 Subject: [PATCH] Revert "Added MusicDownloader.py" --- Music Downloader/MusicDownloader.py | 46 ----------------------------- Music Downloader/README.md | 13 -------- Music Downloader/music-list.txt | 2 -- 3 files changed, 61 deletions(-) delete mode 100644 Music Downloader/MusicDownloader.py delete mode 100644 Music Downloader/README.md delete mode 100644 Music Downloader/music-list.txt diff --git a/Music Downloader/MusicDownloader.py b/Music Downloader/MusicDownloader.py deleted file mode 100644 index 5711a682..00000000 --- a/Music Downloader/MusicDownloader.py +++ /dev/null @@ -1,46 +0,0 @@ -from pytube import YouTube -import os - -def get_song_list(): - music_data = [] - with open('./music-list.txt', 'r') as sl: - music_list = sl.readlines() - for _, music in enumerate(music_list): - music = music.replace('\n', '') - music = music.split(' https:') - music[1] = f'https:{music[1]}' - music_data.append(music) - return music_data - - -def run(): - music_data = get_song_list() - - for _, (title, url) in enumerate(music_data): - # url input from user - yt = YouTube(url) - - # extract only audio - print(f"Extracting audio of: {title}") - video = yt.streams.filter(only_audio=True).first() - - # check for destination to save file - destination = "./music" - - # download the file - print(f"Downloading: {title}") - out_file = video.download(output_path=destination) - - # save the file - new_filename = title + ".mp3" - new_file = os.path.join(destination, new_filename) - os.rename(out_file, new_file) - - # result of success - print(yt.title + " has been successfully downloaded.") - print('-' * 20) - - print("### All music files have been successfully downloaded! ###") - -if __name__ == '__main__': - run() diff --git a/Music Downloader/README.md b/Music Downloader/README.md deleted file mode 100644 index 5e1c2a16..00000000 --- a/Music Downloader/README.md +++ /dev/null @@ -1,13 +0,0 @@ -This repository consists of a list of python scripts to automate few tasks. - -You can contribute by adding more python scripts which can be used to automate things. Some of already done are listed below. -Incase you have anything to be followed while executing the python script mention it as well - - -# Python Script - -## Script - Music Downloader - -Python script to download music automatically from a .txt file. You can insert multiple lines of titles and their YouTube video links. The format for the music-list.txt file is: "music title" "youtube-link". The "music title" is what you rename the music as, it could be anything you'd like. -MusicDownloader.py - diff --git a/Music Downloader/music-list.txt b/Music Downloader/music-list.txt deleted file mode 100644 index 466980f1..00000000 --- a/Music Downloader/music-list.txt +++ /dev/null @@ -1,2 +0,0 @@ -Rick Astley - Never Gonna Give You Up https://youtu.be/dQw4w9WgXcQ -a-ha - Take On Me https://youtu.be/djV11Xbc914 \ No newline at end of file