Skip to content

Commit

Permalink
Remove --source option
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Nov 25, 2023
1 parent d28597d commit d3f9f71
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 48 deletions.
7 changes: 0 additions & 7 deletions auto_editor/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,6 @@ def main_options(parser: ArgumentParser) -> ArgumentParser:
metavar="OBJ:START,DUR,ATTRS?",
help="Insert an audio/video object to the timeline",
)
parser.add_argument(
"--source",
"-src",
nargs="*",
metavar="LABEL:PATH",
help="Add a source and associate it with a label",
)
parser.add_text("URL Download Options:")
parser.add_argument(
"--yt-dlp-location",
Expand Down
22 changes: 0 additions & 22 deletions auto_editor/make_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,28 +168,6 @@ def make_timeline(
log,
)

for raw in args.source:
exploded = raw.split(":")
if len(exploded) != 2:
log.error("source label:path must have one :")
label, path = exploded
if len(label) > 55:
log.error("Label must not exceed 55 characters.")

for ill_char in ",.;()/\\[]}{'\"|#&<>^%$=@ ":
if ill_char in label:
log.error(f"Label '{label}' contains illegal character: {ill_char}")

if label[0] in "0123456789":
log.error(f"Label '{label}' must not start with a digit")
if label[0] == "-":
log.error(f"Label '{label}' must not start with a dash")

if not os.path.isfile(path):
log.error(f"Path '{path}' is not a file")

sources[label] = initFileInfo(path, ffmpeg, log, label)

v1_compatiable = None if inp is None else v1(inp, chunks)
tl = v3(sources, tb, sr, res, args.background, vclips, aclips, v1_compatiable)

Expand Down
37 changes: 19 additions & 18 deletions auto_editor/subcommands/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,24 +232,25 @@ def example():
return out

def add_audio():
run.main(
["example.mp4"],
[
"--source",
"snd:resources/wav/pcm-f32le.wav",
"--add",
'audio:0.3sec,end,"snd",volume=0.3',
],
)
return run.main(
["example.mp4"],
[
"--source",
"snd:resources/wav/pcm-f32le.wav",
"--add",
'audio:2,40,"snd",3sec',
],
)
pass
# run.main(
# ["example.mp4"],
# [
# "--source",
# "snd:resources/wav/pcm-f32le.wav",
# "--add",
# 'audio:0.3sec,end,"snd",volume=0.3',
# ],
# )
# return run.main(
# ["example.mp4"],
# [
# "--source",
# "snd:resources/wav/pcm-f32le.wav",
# "--add",
# 'audio:2,40,"snd",3sec',
# ],
# )

# PR #260
def high_speed_test():
Expand Down
1 change: 0 additions & 1 deletion auto_editor/utils/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ def resolution(val: str | None) -> tuple[int, int] | None:
@dataclass
class Args:
add: list[str] = field(default_factory=list)
source: list[str] = field(default_factory=list)
yt_dlp_location: str = "yt-dlp"
download_format: str | None = None
output_format: str | None = None
Expand Down

0 comments on commit d3f9f71

Please sign in to comment.