Просмотр исходного кода

Only truncate names with non-whitespace after the \n

Zachary Kotlarek 9 лет назад
Родитель
Сommit
5bda29d850
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      yt/subscribe.pl

+ 3 - 1
yt/subscribe.pl

@@ -436,7 +436,9 @@ FETCH_LOOP: foreach my $id (keys(%{$videos})) {
 					warn('Error executing youtube-dl for name: ' . $NAME . '/' . $id . ' (' . $EXITVAL . ")\n");
 					next FETCH_LOOP;
 				}
-				$file =~ s/^.*\n//;
+				if ($file =~ /\n\S/) {
+					$file =~ s/^.*\n//;
+				}
 				$file =~ s/^\s+//;
 				$file =~ s/\s+$//;