Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Commit 308efd7

Browse files
committed
Playlist download fix
1 parent 462df65 commit 308efd7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

WPFMETRO/MainWindow.xaml.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private async void SelectButton_Click(object sender, RoutedEventArgs e)
137137
UrlBox.Background = Brushes.Transparent;
138138
formats.Clear();
139139
string Url = UrlBox.Text;
140-
if (Properties.Settings.Default.PrioritizePlaylists && UrlBox.Text.Contains(@"&list="))
140+
if (Properties.Settings.Default.PrioritizePlaylists && UrlBox.Text.Contains(@"playlist?list="))
141141
{
142142
formats.Add("default", "default (mp4)");
143143
formats.Add("mp3", "mp3");
@@ -325,8 +325,14 @@ private void AddToQueueButton_Click(object sender, RoutedEventArgs e)
325325
string filename = UseVideoTitleBox.IsChecked == true ? "%(title)s.%(ext)s" : FilenameBox.Text + ".%(ext)s"; //Get around nullable bool state
326326
string path = PathBox.Text + @"\";
327327
string filetype = formats.FirstOrDefault(x => x.Value == FiletypeBox.Text).Key;
328-
string title = videoInfo[0];
329-
string thumbURL = videoInfo[1] == "N.A" ? null : videoInfo[1];
328+
string thumbURL = "";
329+
string title = "";
330+
331+
if (videoInfo.Count > 0)
332+
{
333+
title = videoInfo[0];
334+
thumbURL = videoInfo[1] == "N.A" ? null : videoInfo[1];
335+
}
330336

331337
if (filetype == null)
332338
{

0 commit comments

Comments
 (0)