From 95cc831989799a31d97b3168582bccc66a7a60dc Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 1 Nov 2020 19:46:01 +0100 Subject: Renamed scripts --- .local/bin/mpv-view.pl | 76 -------------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100755 .local/bin/mpv-view.pl (limited to '.local/bin/mpv-view.pl') diff --git a/.local/bin/mpv-view.pl b/.local/bin/mpv-view.pl deleted file mode 100755 index a66a75b..0000000 --- a/.local/bin/mpv-view.pl +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use Scalar::Util qw(looks_like_number); -use Term::ANSIColor; - -sub get_size -{ - my $size; - my $answer; - - $size = 0; - $answer = 0; - print - "1) 0\n" . - "2) 240\n" . - "3) 360\n" . - "4) 480\n" . - "5) 720\n" . - "6) 1080\n" . - "\n" . - "> "; - $answer = ; - if (!looks_like_number($answer) || $answer == 0 || $answer == 1 || $answer > 6) { - $size = 0; - } - elsif ($answer == 2) { - $size = 240; - } - elsif ($answer == 3) { - $size = 360; - } - elsif ($answer == 4) { - $size = 480; - } - elsif ($answer == 5) { - $size = 720; - } - elsif ($answer == 6) { - $size = 1080; - } - return $size; -} - -sub main -{ - my $size; - - if ($#ARGV + 1 == 0) { - print STDERR "URL needed\n"; - exit 1; - } - $size = get_size(); - if ($size != 0) { - print 'mpv --ytdl-format=[height<=' . $size . '] ' . $ARGV[0] . "\n"; - exec( - 'mpv', - '--ytdl-format=[height<=' . $size . ']', - $ARGV[0] - ); - } - else { - print 'mpv ' . $ARGV[0] . "\n"; - exec( - 'mpv', - $ARGV[0] - ); - } - print "$size\n"; - exit 0; -} - -main(); - -__END__ -- cgit v1.2.3