From 1d89ab4ab4325604a95b665faac83184a0e3f7e8 Mon Sep 17 00:00:00 2001 From: msglm Date: Wed, 11 Jan 2023 20:51:08 -0600 Subject: videos now convert to webm instead of being mp4 Justification for thsi is that ifunny has swapped to hvec for its encoding. This is a problem as hvec is not widely adopted and proprietary, so the videos are now being converted to webm instead. I greatly await the day we get av1 normalization so we can abandon these shitty codecs. --- comedyGenerator | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/comedyGenerator b/comedyGenerator index 19392e0..a5206b1 100755 --- a/comedyGenerator +++ b/comedyGenerator @@ -213,12 +213,15 @@ for tags in args.tags: print("Now running for " + str(video)) urlsplit = video.split('.') + if args.verbose: + print("url split = " + str(urlsplit)) if len(name) > 200: if args.verbose: print("shortening name because its too long") name = name[0:200] name = name.replace('"', "") outputPath = args.output + tags + " - " + name + "." + urlsplit[len(urlsplit)-1] + convertedOutputPath = args.output + tags + " - " + name + "." + "webm" if args.verbose: print("name read as: " + name) if os.path.exists(outputPath): @@ -226,6 +229,11 @@ for tags in args.tags: else: print("saving " + video + " as " + name) urllib.request.urlretrieve(video, outputPath) + if args.verbose: + print("converting " + outputPath + " to " + convertedOutputPath) + os.system("ffmpeg -i \"" + outputPath + "\" \"" + convertedOutputPath + "\"") + if args.verbose: + print("converting complete!") if args.jobs > 1 and args.noDownload == False: pool = Pool(args.jobs) for video in videos: -- cgit v1.2.3