Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with OutputFolder settings #55

Open
meakcega opened this issue Sep 11, 2024 · 1 comment
Open

Problem with OutputFolder settings #55

meakcega opened this issue Sep 11, 2024 · 1 comment

Comments

@meakcega
Copy link

meakcega commented Sep 11, 2024

Hello,
I have problem with OutputFolder settings:

YoutubeDL ytdl = new YoutubeDL();
ytdl.OutputFolder = @"C:\Output";

OptionSet optionSet= new OptionSet();
string temp = @"C:\Temp";
optionSet.Paths = $"temp:{temp}";
optionSet.Output = "%(title)s.%(ext)s";

await ytdl.RunVideoDownload(ytVideo.Url, progress: progress, overrideOptions: optionSet);

When I run code, the temp files were saved correctly in "C:\Temp". But after finishing download, the video files were not saved to "C:\Output". Instead they were saved to the folder that contains "yt-dlp.exe" file.

When I removed variable "optionSet". It works correctly , all video files were saved to "C:\Output":

YoutubeDL ytdl = new YoutubeDL();

ytdl.OutputFolder = @"C:\Output";
ytdl.OutputFileTemplate = "%(title)s.%(ext)s";

await ytdl.RunVideoDownload(ytVideo.Url, progress: progress);

How can I setup "OutputFolder" correctly? Please advise me.
And I want to add a folder to save subtitle files. How can I do that?

@tleylan
Copy link

tleylan commented Oct 6, 2024

I don't have the definitive answer though I've been experimenting with this a lot lately. As far as I can tell you need to set the OutputFolder (as you have) and unfortunately also use the full path in the optionSet.Output. In the example above you would concatenate your temp variable with the template you are sing for optionSet.Output. If there is some way to avoid the duplicate definition I don't know but this works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants