diff --git a/Easy Link Downloader/Download.txt b/Easy Link Downloader/Download.txt new file mode 100644 index 000000000..aa7983090 --- /dev/null +++ b/Easy Link Downloader/Download.txt @@ -0,0 +1,3 @@ +1812 Overture by Tchiavosky +Moonlight Sonata by Beethoven +Cannon in D by Pachebel \ No newline at end of file diff --git a/Easy Link Downloader/EasyLinkDownloader.py b/Easy Link Downloader/EasyLinkDownloader.py new file mode 100644 index 000000000..cfdd83e38 --- /dev/null +++ b/Easy Link Downloader/EasyLinkDownloader.py @@ -0,0 +1,121 @@ +from __future__ import unicode_literals +from pip._vendor.distlib.compat import raw_input +from urllib import request +from unidecode import unidecode +import time +import os +import youtube_dl +import sys +import json +'''This receives a search parameter of type string + Then, it escapes that string, example "Hey Jude" -> "Hey%20Jude" + It makes a URL request to 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q='+search' a google API tool + Then it takes the result from the query (A number of website google has found, takes the first link, and returns the link to be downloaded +''' + +class MyLogger(object): + def debug(self, msg): + pass + + def warning(self, msg): + pass + + def error(self, msg): + print(msg) + + +def my_hook(d): + if d['status'] == 'finished': + print('Done downloading, now converting ...') + +class NotYoutubeLinkError(Exception): + def __init__(self, value): + self.value = value + def __str__(self): + return repr(self.value) + +class NotValidSongError(Exception): + def __init__(self, value): + self.value = value + def __str__(self): + return repr(self.value) + +def getURL(search): + final = None + original = search + search = unidecode(search) + try: + print("The item to be searched: ",search) + search = search.replace(' ', '%20') + print("Converted string: ", search) + + rawdata = request.urlopen("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q="+(search)) + result = json.loads(rawdata.readall().decode('utf-8')) + searchResults = result['responseData']['results'] + + final = searchResults[0]['unescapedUrl'] + except Exception as e: + if (search == "\n"): + printEnd() + else: + print(e) + print("You need to switch your VPN! Start next download with :", original) + raw_input() + getURL(search) + + return final + +def printEnd(): + print("All songs searched, check Faliure.txt and Success.txt for more info") + print("Press enter to exit") + raw_input() + sys.exit() + + +'''Begin Main''' + +print("Press enter to search \"Download.txt\". PLEASE READ THE README FILE:") +raw_input() +print("Enter number to specify where you want to get your song from (Press enter if you don't care)") +print("1. Youtube \n2. Soundcloud") +x = raw_input() + +#Opens text file, Download = source +f1 = open("Download.txt", "r") +songs = [] + +for i, line in enumerate(f1): + line = line[:-1] + songs.append(line) + +f1.close() + +currentDate = time.strftime("%Y-%m-%d - %H-%M-%S") +for element in songs: + #Options for Youtube_DL, read the documentation on github + ydl_opts = {'outtmpl': os.getcwd()+'/links/'+element+'.%(ext)s', + 'format': 'bestaudio/best', + 'postprocessors': [{ + 'key': 'FFmpegExtractAudio', + 'preferredcodec': 'mp3', + 'preferredquality': '192', + }], + } + + with youtube_dl.YoutubeDL(ydl_opts) as ydl: + if (x == 1): + element += " youtube" + if (x == 2): + element += " soundcloud" + + url = getURL(element) + print("URL: ",url,"\n") + + try: + if not 'youtube' in url: + raise NotYoutubeLinkError("NotYoutubeLinkError: Not a youtube Link!") + + ydl.download([url]) + except Exception as ex: + print(ex) +printEnd() diff --git a/Easy Link Downloader/README.md b/Easy Link Downloader/README.md new file mode 100644 index 000000000..dad1b2be5 --- /dev/null +++ b/Easy Link Downloader/README.md @@ -0,0 +1,25 @@ +NOTE: If you don't know what you're doing READ THE DETAILED DESCRIPTION! + +NOTE: Do not download copyrighted music with this opensource script! + +Step 1: Find "Download.txt" inside "Music Downloader" folder -> Double Click + +Step 2: Fill "Download.txt" with songs you like (scroll to bottom to see an example list) + +Step 3: Double Click "EasyLinkDownloader.py" + +Step 4: Hit enter when done, music will be in music folder + + +Example List (included): +1812 Overture by Tchiavosky +Moonlight Sonata by Beethoven +Cannon in D by Pachebel + +Credit: + +Team behind youtube-dl Amazing work! + +Team behind Google Ajax + +Team behind ffmpeg and ffprobe diff --git a/Easy Link Downloader/desktop.ini b/Easy Link Downloader/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/Easy Link Downloader/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/Easy Link Downloader/ffmpeg.exe b/Easy Link Downloader/ffmpeg.exe new file mode 100644 index 000000000..c20d06ec2 Binary files /dev/null and b/Easy Link Downloader/ffmpeg.exe differ diff --git a/Easy Link Downloader/ffprobe.exe b/Easy Link Downloader/ffprobe.exe new file mode 100644 index 000000000..07409626d Binary files /dev/null and b/Easy Link Downloader/ffprobe.exe differ diff --git a/Easy Link Downloader/links/1812 Overture by Tchiavosky.mp3 b/Easy Link Downloader/links/1812 Overture by Tchiavosky.mp3 new file mode 100644 index 000000000..37d582aa9 Binary files /dev/null and b/Easy Link Downloader/links/1812 Overture by Tchiavosky.mp3 differ diff --git a/Easy Link Downloader/links/Cannon in D by Pachebe.mp3 b/Easy Link Downloader/links/Cannon in D by Pachebe.mp3 new file mode 100644 index 000000000..3fbd17129 Binary files /dev/null and b/Easy Link Downloader/links/Cannon in D by Pachebe.mp3 differ diff --git a/Easy Link Downloader/links/Moonlight Sonata by Beethoven.mp3 b/Easy Link Downloader/links/Moonlight Sonata by Beethoven.mp3 new file mode 100644 index 000000000..7641ba9ec Binary files /dev/null and b/Easy Link Downloader/links/Moonlight Sonata by Beethoven.mp3 differ diff --git a/Easy Link Downloader/links/desktop.ini b/Easy Link Downloader/links/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/Easy Link Downloader/links/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/bin/desktop.ini b/bin/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/bin/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/desktop.ini b/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/devscripts/desktop.ini b/devscripts/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/devscripts/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/devscripts/gh-pages/desktop.ini b/devscripts/gh-pages/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/devscripts/gh-pages/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/docs/desktop.ini b/docs/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/docs/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/test/desktop.ini b/test/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/test/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/test/swftests/desktop.ini b/test/swftests/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/test/swftests/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/youtube_dl/desktop.ini b/youtube_dl/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/youtube_dl/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/youtube_dl/downloader/desktop.ini b/youtube_dl/downloader/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/youtube_dl/downloader/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/youtube_dl/extractor/desktop.ini b/youtube_dl/extractor/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/youtube_dl/extractor/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/youtube_dl/postprocessor/desktop.ini b/youtube_dl/postprocessor/desktop.ini new file mode 100644 index 000000000..309dea230 --- /dev/null +++ b/youtube_dl/postprocessor/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file