From b5908358bf8647d4c28445e0ff70bdeef8bf319b Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 14 Nov 2020 17:10:24 +0100 Subject: Bug fixes --- .local/bin/linkview | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to '.local/bin/linkview') diff --git a/.local/bin/linkview b/.local/bin/linkview index 88ffe93..50b04c5 100755 --- a/.local/bin/linkview +++ b/.local/bin/linkview @@ -29,7 +29,6 @@ sub open_link my $pwd; my $ret; my @wc; - my $word; my $i; if ($a == 1) { @@ -54,10 +53,12 @@ sub open_link $file_name =~ s/.+\///g; if ($file_name =~ m/^watch\?v=.+/) { $file_name = `youtube-dl -e $url`; + if (not $file_name) { + $file_name = "Youtube video"; + } chomp $file_name; } @wc = split / /, $file_name; - print @wc . "\n"; if (@wc > 6) { $file_name = ""; $i = 0; @@ -67,6 +68,7 @@ sub open_link } $file_name .= "[...]"; } + $file_name =~ s/^[0-9]+/\[\.\.\.\]/; system( NOTIFYSEND_PATH, '-u', -- cgit v1.2.3