create output dir if not already there
This commit is contained in:
@@ -7,6 +7,8 @@ import subprocess
|
|||||||
import glob
|
import glob
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'vcodec': "vp9",
|
'vcodec': "vp9",
|
||||||
@@ -26,6 +28,13 @@ with open(jsonFileName) as jf:
|
|||||||
ydl_opts = {"outtmpl": "%(id)s"}
|
ydl_opts = {"outtmpl": "%(id)s"}
|
||||||
|
|
||||||
for clip in clipDict:
|
for clip in clipDict:
|
||||||
|
# create the directories so ffmped doesn't complain
|
||||||
|
try:
|
||||||
|
outputDir = os.path.dirname(clip['target'])
|
||||||
|
os.makedirs(outputDir)
|
||||||
|
except:
|
||||||
|
print(f"Couldn't create {outputDir}")
|
||||||
|
|
||||||
infoDict = None
|
infoDict = None
|
||||||
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
||||||
infoDict = ydl.extract_info(clip['source'], download=False)
|
infoDict = ydl.extract_info(clip['source'], download=False)
|
||||||
@@ -70,7 +79,9 @@ for clip in clipDict:
|
|||||||
# "an":None,
|
# "an":None,
|
||||||
"y":None,
|
"y":None,
|
||||||
"pass":"1",
|
"pass":"1",
|
||||||
"b:v":"512k", "minrate":"375k", "maxrate":"1088k",
|
# "b:v":"276k", "minrate":"138k", "maxrate":"400k", # x360
|
||||||
|
"b:v":"512k", "minrate":"256k", "maxrate":"742k", # x480 LQ
|
||||||
|
# "b:v":"750k", "minrate":"375k", "maxrate":"1088k", # x480 MQ
|
||||||
"quality":"good",
|
"quality":"good",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user