From: Simon Ruderich Date: Mon, 6 Apr 2015 22:16:27 +0000 (+0200) Subject: bin/squvi: delete X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=7cfed4fe97739e0c4679a716b0983c5c4e620b1c;p=config%2Fdotfiles.git bin/squvi: delete Use youtube-dl instead. --- diff --git a/bin/squvi b/bin/squvi deleted file mode 100755 index 2a08cf0..0000000 --- a/bin/squvi +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/perl - -# Download video files with quvi. -# -# Don't use clive which is just a front-end to quvi anyway, but with -# vulnerable "exec" code (system() with missing escaping). - -# Copyright (C) 2013-2014 Simon Ruderich -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -use strict; -use warnings; - -use IPC::Run (); -use JSON (); - - -if (scalar @ARGV != 1) { - print STDERR "Usage: $0 \n"; - exit 1; -} - - -my ($out, $err); -my @cmd = ('quvi', $ARGV[0]); -if (not IPC::Run::run(\@cmd, \undef, \$out, \$err)) { - die "'@cmd' died:\n$err"; -} - -my $data = JSON::decode_json($out); - -my $url = $data->{link}[0]{url}; -my $suffix = $data->{link}[0]{file_suffix}; - -my $name = $data->{page_title}; -# Strip all non-ASCII characters including "/" which is illegal in file names. -$name =~ s{[^\x20-\x2E\x30-\x7e]}{-}g; - -@cmd = ('wget', '--no-clobber', '--progress=bar:force', - '-O', "$name.$suffix", $url); -exec { $cmd[0] } @cmd or die $!;