Problem downloading 'shetland'

Andy Wedge andy_wedge at linetwo.co.uk
Tue Nov 24 11:58:08 PST 2026


>-----Original Message-----
>From: get_iplayer <get_iplayer-bounces at lists.infradead.org> On Behalf Of Jimmy Aitken
>Sent: 13 November 2026 17:44
>To: get_iplayer <get_iplayer at lists.infradead.org>
>Subject: Problem downloading 'shetland'
>
>Anyone else get this:
>
>% get_iplayer shetland: -g
>
>Matches:
>6596: tv, Shetland: Series 11 - Episode 1, BBC One, m003445v
>INFO: 1 matching programmes
>
>WARNING: A UK TV licence is required to access BBC iPlayer TV content legally
>INFO: Processing tv: 'Shetland: Series 11 - Episode 1 (m003445v)'
>Illegal division by zero at /usr/local/get_iplayer/perl/bin/get_iplayer line 6256.

As the error message says, it's a divide by zero error at line 6256.

If you look at line 6256 (or whatever line number is given in your version of GiP) in get_iplayer.pl in the folder specified, you will see this line:

my $num_segments = int($programme_duration / $segment_duration);

The divide by zero is obviously caused because the variable $segment_duration is zero when it should not be.
I've no idea what it should be, so I inserted an extra line just before that statement:

$segment_duration = 1 if $segment_duration == 0;

This sets $segment_duration to a value of 1 when it's 0, thereby preventing the divide by zero error.

My GiP runs OK for now with that extra line and I'll look out for a more formal fix from the maintainer of GiP.

Note: Updating text files inside Program Files on Windows 11
---------------------------------------------------------------------------------
Windows protects Program Files from ordinary changes, even when you use an administrator account. This helps prevent apps or malware from altering installed programs.
Try an elevated text editor
    Close the text file.
    Right-click Notepad or your preferred text editor and select Run as administrator.
    In the editor, open the file from its folder under Program Files, make your changes, and save.
Or edit a copy
    Copy the file to your Desktop or another writable folder.
    Edit and save it there.
    Copy it back to its original location and approve the administrator prompt.

Regards
Andy




More information about the get_iplayer mailing list