change saving path and error logging
This commit is contained in:
parent
7237cb8da9
commit
fe3993bda8
2 changed files with 5 additions and 5 deletions
|
|
@ -6,12 +6,12 @@ import subprocess
|
|||
|
||||
def download(url, video_or_audio):
|
||||
if video_or_audio == "video":
|
||||
process = subprocess.Popen(["yt-dlp", "-o", "%(playlist|)s/%(playlist_index)s - %(title)s.%(ext)s", "--yes-playlist", f"{url}"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
process = subprocess.Popen(["yt-dlp", "-o", "data/ytdl/%(playlist|)s/%(playlist_index)s - %(title)s.%(ext)s", "--yes-playlist", f"{url}"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
print(process.stdout.read())
|
||||
process.wait()
|
||||
return True
|
||||
elif video_or_audio == "audio":
|
||||
process = subprocess.Popen(["yt-dlp", "-o", "%(playlist|)s/%(playlist_index)s - %(title)s.%(ext)s", "-x", "--yes-playlist", f"{url}"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
process = subprocess.Popen(["yt-dlp", "-o", "data/ytdl/%(playlist|)s/%(playlist_index)s - %(title)s.%(ext)s", "-x", "--yes-playlist", f"{url}"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
print(process.stdout.read())
|
||||
process.wait()
|
||||
return True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue