-
Notifications
You must be signed in to change notification settings - Fork 40
Added unix setExec support, and added timeout on downloads #74
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
base: master
Are you sure you want to change the base?
Conversation
YoutubeDLSharp/Utils.cs
Outdated
{ | ||
if(OSHelper.IsWindows)return; | ||
#if NET8_0_OR_GREATER | ||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) | ||
File.SetUnixFileMode(filename, UnixFileMode.UserExecute | UnixFileMode.UserRead | UnixFileMode.UserWrite); | ||
#else | ||
throw new PlatformNotSupportedException("Setting Unix permissions is not supported on this platform."); | ||
#endif | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- checking with the
OSHelper.GetOSVersion()
is probably enough. File.SetUnixFileMode()
is available in .NET 7+
YoutubeDLSharp/Utils.cs
Outdated
public static async Task DownloadFFmpeg(string directoryPath = "", int timeoutSeconds = 60 * 5) | ||
{ | ||
await FFDownloader(directoryPath, FFmpegApi.BinaryType.FFmpeg); | ||
await FFDownloader(directoryPath, binary: FFmpegApi.BinaryType.FFmpeg); | ||
} | ||
|
||
public static async Task DownloadFFprobe(string directoryPath = "") | ||
public static async Task DownloadFFprobe(string directoryPath = "", int timeoutSeconds = 60 * 5) | ||
{ | ||
await FFDownloader(directoryPath, FFmpegApi.BinaryType.FFprobe); | ||
await FFDownloader(directoryPath, binary:FFmpegApi.BinaryType.FFprobe); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
timeoutSeconds
is not used in these functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests are failing due to changing timeout while other tests are still running.
maybe a global timeout setting is better option (with setter function maybe)
|
Added support for timeouts.
Also made unix downloads (.net core 8 or above) set unix permissions