I'm currently trying top download some clips and then merge them into one video. However, for some reason im getting the following error:
Traceback (most recent call last):
File "F:\tarkovYoutubeAutomation\main.py", line 223, in <module>
download_concatinate()
File "F:\tarkovYoutubeAutomation\main.py", line 68, in download_concatinate
output = subprocess.check_output(cmd).decode("utf-8").strip()
File "C:\Users\myalt\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\myalt\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\myalt\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\myalt\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
The filepath (as seen below) is correct.
F:\tarkovYoutubeAutomation\clips\New to Tarkov and my 3 seasoned friends had to spectate this.mp4
If anybody could explain why im recieving this error, it would be greatly appriciated.
count += 1
video_url = f'{p.url}'
ydl_opts = {'outtmpl': f"./clips/{p.title}"}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([video_url])
input_video = f"F:\\tarkovYoutubeAutomation\\clips\\{p.title}.mp4"
print(input_video)
cmd = ["ffprobe", "-i", input_video, "-show_entries", "format=duration",
"-v", "quiet", "-sexagesimal", "-of", "csv=p=0"]
output = subprocess.check_output(cmd).decode("utf-8").strip()
total_seconds = 0
hour, minutes, seconds = output.split('.')[0].split(':')
total_seconds += int(hour) * 3600
total_seconds += int(minutes) * 60
total_seconds += int(seconds)
if total_seconds >= 100:
print(f'{total_seconds} longer than 60 seconds.')
os.remove(f'./clips/{p.title}.mp4')
urls.insert_one({'url': p.url})
else:
print(f' {total_seconds} not longer than 60 seconds')
urls.insert_one({'url': p.url})```