#!/usr/bin/env perl # # get_iplayer - Lists and records BBC iPlayer TV and BBC Sounds radio programmes # # Copyright (C) 2008-2010 Phil Lewis, 2010- get_iplayer contributors # # 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 . # # Authors: Phil Lewis, get_iplayer contributors # Web: https://github.com/get-iplayer/get_iplayer/wiki # License: GPLv3 (see LICENSE.txt) # # package main; my $version = 3.35; my $version_text; $version_text = sprintf("v%.2f", $version) unless $version_text; # # Help: # ./get_iplayer --help | --longhelp # # Release notes: # https://github.com/get-iplayer/get_iplayer/wiki/releasenotes # # Documentation: # https://github.com/get-iplayer/get_iplayer/wiki/documentation # use Encode qw(:DEFAULT :fallback_all); use Env qw[@PATH]; use Fcntl; use File::Copy; use File::Path; use File::stat; use File::Spec; use Getopt::Long; use HTML::Entities; use HTTP::Cookies; use HTTP::Headers; use IO::Seekable; use IO::Socket; use IPC::Open3; use LWP::ConnCache; use LWP::UserAgent; use open IN => ':crlf :utf8', OUT => ':utf8'; use PerlIO::encoding; use POSIX qw(strftime); use POSIX qw(:termios_h); use strict; #use warnings; use Time::Local; use Unicode::Normalize; use URI; use version 0.77; use if $^O eq 'MSWin32', "Win32::Unicode::Process" => qw(); use constant DIVIDER => "-==-" x 20; use constant FB_EMPTY => sub { '' }; use constant IS_MACOS => $^O eq 'darwin' ? 1 : 0; use constant IS_WIN32 => $^O eq 'MSWin32' ? 1 : 0; $PerlIO::encoding::fallback = XMLCREF; # Save default SIG actions my %SIGORIG; $SIGORIG{$_} = $SIG{$_} for keys %SIG; STDOUT->autoflush(1); STDERR->autoflush(1); # Define general 'option names' => ( ,