Last active
July 19, 2017 02:57
-
-
Save BenStigsen/9e779eccabefb958dce690f17276e288 to your computer and use it in GitHub Desktop.
Download GitHub projects and YouTube videos/audio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Made by Tearzz / PhantomScripts | |
import sys, pip | |
# Needed Packages: | |
package_1='pafy' | |
package_2='youtube-dl' # Pafy requires this to work | |
# Menu Screen | |
print('==========================================') | |
print(' Setup For WebDownloader ') | |
print('------------------------------------------') | |
print(' Installing Packages Needed ') | |
print(' (pafy + youtube-dl)') | |
print('==========================================') | |
# Install the packages | |
pip.main(['install', package_1, package_2]) | |
# End screen | |
print('\n') | |
print('----------------') | |
print(' Setup Is Done!') | |
print('================') | |
x = input('press ENTER to close') | |
# This will exit the script | |
sys.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Made by Tearzz / PhantomScripts | |
import pafy, pip, time | |
print(" WebDownloader ") | |
print("----------------------") | |
print(" By PhantomScripts ") | |
print("\n") | |
# Variables | |
option = 1 | |
loop = 1 | |
# ---Menu--- | |
print("1) Download YouTube Video [Default]") | |
print("2) Download YouTube Audio") | |
print("-------------------------") | |
print("3) Download GitHub Project") | |
option = input("[1/2/3]: ") | |
option = int(option) # Turn "option" In To An Integer | |
print("\n" * 20) | |
print("Audio/Video Downloader") | |
print("----------------------") | |
print(" By PhantomScripts ") | |
print("\n") | |
# --- Main Program --- | |
# - Video Download - | |
if option == 1: #Video Download | |
while loop == 1: | |
url = input("YT-URL: ") | |
if url == "": | |
print("No URL Was Given") | |
print("Downloading The Best Video Ever") | |
url = "https://www.youtube.com/watch?v=Gc2u6AFImn8" | |
video = pafy.new(url) | |
best = video.getbest(preftype="mp4") | |
best.download() | |
else: | |
video = pafy.new(url) | |
best = video.getbest(preftype="mp4") | |
best.download() | |
print("Download Complete! = " + "\n") | |
print("\n" * 2) | |
# - Audio Download - | |
elif option == 2: #Audio Download | |
while loop == 1: | |
url = input("YT-URL: ") | |
if url == "": | |
print("No URL Was Given") | |
print("Downloading The Best Song Ever") | |
url = "https://www.youtube.com/watch?v=ByC8sRdL-Ro" | |
video = pafy.new(url) | |
bestaudio = video.getbestaudio(preftype="m4a") | |
bestaudio.download() | |
else: | |
video = pafy.new(url) | |
bestaudio = video.getbestaudio(preftype="m4a") | |
bestaudio.download() | |
print("Download Complete! = " + "\n") | |
print("\n" * 2) | |
elif option == 3: #GitHub Download | |
while loop == 1: | |
url = input("GitHub URL: ") | |
if url == "": | |
print("No URL Was Given") | |
time.sleep(1) | |
print("\n" * 20) | |
else: | |
pip.main(['install', url + "/zipball/master"]) # zipball/master is required | |
print("\n" * 2) | |
print("Made By PhantomScripts") | |
print("Made By PhantomScripts") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment