Skip to content

Commit

Permalink
Merge pull request #423 from melithine/noninteractive-exit-failures
Browse files Browse the repository at this point in the history
Move Environment.Exit() calls outside of the non-interactive conditional block.
  • Loading branch information
sim0n00ps authored Jun 24, 2024
2 parents a9c31f7 + dc311ba commit 6897a20
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions OF DL/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async static Task Main(string[] args)
AnsiConsole.Write(new FigletText("Welcome to OF-DL").Color(Color.Red));

Auth? auth = null;
Config? config = null;
Config? config = null;

if (args is not null && args.Length > 0)
{
Expand All @@ -63,8 +63,8 @@ public async static Task Main(string[] args)
if (!cliNonInteractive)
{
Console.ReadKey();
Environment.Exit(1);
}
Environment.Exit(1);
}
else
{
Expand All @@ -91,8 +91,8 @@ public async static Task Main(string[] args)
if (!cliNonInteractive)
{
Console.ReadKey();
Environment.Exit(2);
}
Environment.Exit(2);
}
}
else
Expand All @@ -104,8 +104,8 @@ public async static Task Main(string[] args)
if (!cliNonInteractive)
{
Console.ReadKey();
Environment.Exit(2);
}
}
Environment.Exit(2);
}

if (File.Exists("config.json"))
Expand All @@ -127,8 +127,8 @@ public async static Task Main(string[] args)
if (!cliNonInteractive)
{
Console.ReadKey();
Environment.Exit(3);
}
}
Environment.Exit(3);
}
}
else
Expand All @@ -140,8 +140,8 @@ public async static Task Main(string[] args)
if (!cliNonInteractive)
{
Console.ReadKey();
Environment.Exit(3);
}
Environment.Exit(3);
}

if(cliNonInteractive)
Expand Down Expand Up @@ -217,8 +217,8 @@ public async static Task Main(string[] args)
if (!config.NonInteractiveMode)
{
Console.ReadKey();
Environment.Exit(4);
}
Environment.Exit(4);
}

if (!File.Exists(Path.Join(WidevineClient.Widevine.Constants.DEVICES_FOLDER, WidevineClient.Widevine.Constants.DEVICE_NAME, "device_client_id_blob")))
Expand Down Expand Up @@ -277,8 +277,8 @@ public async static Task Main(string[] args)
if (!cliNonInteractive)
{
Console.ReadKey();
Environment.Exit(5);
}
Environment.Exit(5);
}
}

Expand Down Expand Up @@ -401,14 +401,14 @@ private static async Task DownloadAllData(APIHelper m_ApiHelper, Auth Auth, Conf
}
else
{
path = $"__user_data__/sites/OnlyFans/{user.Key}";
path = $"__user_data__/sites/OnlyFans/{user.Key}";
}

await dBHelper.CheckUsername(user, path);

if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
Directory.CreateDirectory(path);
AnsiConsole.Markup($"[red]Created folder for {user.Key}\n[/]");
}
else
Expand Down Expand Up @@ -497,7 +497,7 @@ private static async Task DownloadAllData(APIHelper m_ApiHelper, Auth Auth, Conf
else
{
AnsiConsole.Markup($"[red]Folder for {user.Key} already created\n[/]");
}
}

await dBHelper.CreateDB(path);

Expand Down

0 comments on commit 6897a20

Please sign in to comment.