Skip to content

Commit

Permalink
Update 1.2.7: Profile pictures and animated avatars can now be downlo…
Browse files Browse the repository at this point in the history
…aded. The standard download log is now disabled by default. Code rewritten/cleaned up, and some preparations made for upcoming features.
  • Loading branch information
Jettcodey committed Jun 21, 2024
1 parent 08811bc commit d171d1e
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 17 deletions.
58 changes: 42 additions & 16 deletions MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using System.Net;
using System.Reflection;
using System.Text.Json;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace TikTok_Downloader
Expand All @@ -21,6 +23,8 @@ public partial class MainForm : Form
private string jsonLogFilePath;
private object jsonLock = new object();
private bool useOldFileStructure;
private bool DownloadVideosOnly;
private bool DownloadImagesOnly;
private readonly AppSettings settings;
private SettingsDialog settingsDialog;
private List<string> cachedVideoUrls = new List<string>();
Expand Down Expand Up @@ -1111,6 +1115,16 @@ public void EnableDownloadLogsCheckBox(bool value)
InitializeLoggingFolder();
}

public void DownloadVideosOnlyCheckBox(bool value)
{
DownloadVideosOnly = value;
}

public void DownloadImagesOnlyCheckBox(bool value)
{
DownloadImagesOnly = value;
}

private void outputTextBox_TextChanged(object sender, EventArgs e)
{

Expand Down
20 changes: 19 additions & 1 deletion SettingsDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ private void Setting5CheckBox_CheckedChanged(object sender, EventArgs e)
}
}

private void Setting1CheckBox_CheckedChanged(object sender, EventArgs e)
{
if (sender is CheckBox checkBox)
{
mainForm.DownloadVideosOnlyCheckBox(checkBox.Checked);
}
}

private void Setting4CheckBox_CheckedChanged(object sender, EventArgs e)
{
if (sender is CheckBox checkBox)
{
mainForm.DownloadImagesOnlyCheckBox(checkBox.Checked);
}
}

private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsDialog));
Expand Down Expand Up @@ -141,13 +157,14 @@ private void InitializeComponent()
setting1CheckBox.Text = "Download Videos Only";
setting1CheckBox.UseVisualStyleBackColor = false;
setting1CheckBox.Visible = false;
setting1CheckBox.CheckedChanged += Setting1CheckBox_CheckedChanged;
//
// setting2CheckBox
//
setting2CheckBox.AutoSize = true;
setting2CheckBox.BackColor = Color.Transparent;
setting2CheckBox.ForeColor = SystemColors.Control;
setting2CheckBox.Location = new Point(162, 70);
setting2CheckBox.Location = new Point(167, 70);
setting2CheckBox.Name = "setting2CheckBox";
setting2CheckBox.Size = new Size(115, 19);
setting2CheckBox.TabIndex = 6;
Expand Down Expand Up @@ -180,6 +197,7 @@ private void InitializeComponent()
setting4CheckBox.Text = "Download Images Only";
setting4CheckBox.UseVisualStyleBackColor = false;
setting4CheckBox.Visible = false;
setting4CheckBox.CheckedChanged += Setting4CheckBox_CheckedChanged;
//
// setting5CheckBox
//
Expand Down

0 comments on commit d171d1e

Please sign in to comment.