summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcomedyGenerator41
1 files changed, 29 insertions, 12 deletions
diff --git a/comedyGenerator b/comedyGenerator
index 163875c..0d05108 100755
--- a/comedyGenerator
+++ b/comedyGenerator
@@ -47,7 +47,7 @@ parser.add_argument('--log','-l',
default=config['DEFAULT']['log'],
dest='log',
action="store",
- help="the output directory of the log file for your funnies",
+ help="the output directory of the log file for your funnies. STDOUT if you wish for standard output.",
type=str
)
@@ -59,6 +59,12 @@ parser.add_argument('--jobs','-j',
type=int
)
+parser.add_argument('--no-download', '--nd',
+ dest='noDownload',
+ action="store_true",
+ help="If you would like to actually download the funnies or not",
+ )
+
parser.add_argument('--type','-t',
default=str(config['DEFAULT']['type']),
dest='type',
@@ -105,7 +111,10 @@ if args.verbose:
logging = False
if not args.log == "False":
logging = True
- logFile = open(args.log, "a")
+ if args.log == "STDOUT":
+ logFile = "STDOUT"
+ else:
+ logFile = open(args.log, "a")
tmpLog = []
if args.verbose:
print("We're going to be logging!")
@@ -220,23 +229,31 @@ for tags in args.tags:
time.sleep(tries*1.5)
continue
break
- if args.jobs > 1:
+ if args.jobs > 1 and args.noDownload == False:
pool = Pool(args.jobs)
for video in videos:
pool.apply_async(download, (video.url, video.name,))
pool.close()
pool.join()
- if logging:
- for video in videos:
- logName = video.url
- logPath = args.output + logName
- if args.verbose:
- print("Writing " + logPath + " to log file")
- logFile.write(logPath + "\n")
- logFile.close()
- else:
+ elif args.noDownload == False:
for video in videos:
download(video.url, video.name)
+
+ if logging and args.noDownload == False:
+ for video in videos:
+ logName = video.url
+ logPath = args.output + logName
+ if args.verbose:
+ print("Writing " + logPath + " to log file")
+ logFile.write(logPath + "\n")
+ elif logging:
+ for video in videos:
+ logName = video.url
+ if args.verbose:
+ print("Writing " + logName + " to log file")
+ logFile.write(logName + "\n")
+logFile.close()
+
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU Affero General Public License version 3 as published by
#the Free Software Foundation.