aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/main.py b/main.py
index de93106..50a0d90 100644
--- a/main.py
+++ b/main.py
@@ -1,4 +1,5 @@
-from VaporSong import VaporSong
+from src.VaporSong import VaporSong
+from src.VHSImage import generateVHSStyle
import os
import sys
import youtube_dl
@@ -18,20 +19,28 @@ text = 'This program takes YouTube URL or title of a song and converts it into v
parser = argparse.ArgumentParser(description = text)
parser.add_argument("-M", "--music", help="generate v a p o r w a v e music", action="store_true")
+parser.add_argument("-P", "--picture", help="generate VHS Style image", action="store_true")
parser.add_argument("-V", "--version", help="show program version", action="store_true")
-parser.add_argument("-i", "--input", help="input url")
+parser.add_argument("-i", "--input")
+
args = parser.parse_args()
+music = False
+picture = False
+
if args.version:
print("vaporwave generator 旺育栄", version)
exit
if args.music:
music = True
+elif args.picture:
+ picture = True
if args.input:
query = args.input
else:
- query = input("Enter target song's name or YouTube URL: ")
+ parser.print_help()
+ exit
MAX_DURATION = 600 # In-case the program finds a compilation
youtube_urls = ('youtube.com', 'https://www.youtube.com/', 'http://www.youtube.com/', 'http://youtu.be/', 'https://youtu.be/', 'youtu.be')
@@ -149,3 +158,6 @@ for s in sys.argv:
if music:
name, title = download_file(query)
gen_vapor(name, title)
+elif picture:
+ generateVHSStyle(query,"out.jpg")
+ \ No newline at end of file