Index: /status
===================================================================
--- /status (revision 583)
+++ /status (revision 584)
@@ -1,5 +1,5 @@
 application     shepherd            0.4.72
 grabber         yahoo7widget        1.81
-grabber         rex                 3.4.4
+grabber         rex                 3.4.5
 grabber         abc_website         2.09
 grabber         abc2_website        2.09
Index: /grabbers/rex.conf
===================================================================
--- /grabbers/rex.conf (revision 481)
+++ /grabbers/rex.conf (revision 584)
@@ -4,5 +4,5 @@
             'option_days_offset' => '--offset',
             'option_offset_eats_days' => 1,
-            'regions' => '-71 79 90',
+            'regions' => '',
             'option_ready' => '--version',
             'desc' => 'Rex fetches data of high quality, very slowly, from YourTV.com.au. It supplies all Australian regions.',
Index: /grabbers/rex
===================================================================
--- /grabbers/rex (revision 550)
+++ /grabbers/rex (revision 584)
@@ -3,5 +3,5 @@
 # "Rex"
 
-my $version  = '3.4.4';
+my $version  = '3.5.0';
 
 # An Australian TV Guide Grabber (a.k.a. tv_grab_au)
@@ -76,4 +76,5 @@
 # 3.4.3   : Bugfix : don't die on corrupted cache file
 # 3.4.4   : Bugfix : --dump-cache works
+# 3.4.5   : Bugfix : support regions with multiple channels of same name
 
 use strict;
@@ -649,4 +650,5 @@
   my $tree = HTML::TreeBuilder->new_from_content($guidedata);
   my $curchan = '';
+  my @channels_seen;
   my ($pid, $block, $line, $link, $title);
   my $c = 0;
@@ -654,7 +656,7 @@
   {
     $c++;
-    next if ($curchan eq $tag->as_text()); # Ignore repeated Station name
-    $curchan = $tag->as_text();
-    $curchan =~ s/\(.*\)//;
+    my $channame = $tag->as_text();
+    my $curchan = translate_channel_name($tag->as_text(), grep($_ eq $channame, @channels_seen));
+    push @channels_seen, $channame;
     if (!$channels->{$curchan})
     {
@@ -758,4 +760,26 @@
     $lastpids->{$curchan} = $pid;
   }
+}
+
+# The guide pages for some regions don't provide any way to distinguish
+# between (eg) "Prime (Regional)" and "Prime (Albury)" in the same region,
+# other than the order in which they're listed. (They're both called
+# simply "Prime".) This func tracks which is which.
+sub translate_channel_name
+{
+    my ($chan, $seen_before) = @_;
+
+    my $rchans = {
+	71 => {	'TEN' => [ 'TEN (NSW: Southern NSW)', 'TEN (Mildura Digital)' ],
+		'Prime' => [ 'Prime (Canberra/Wollongong/South Coast)', 'Prime (Wagga Wagga/Orange)' ] },
+	79 => { 'WIN' => [ 'WIN (QLD: Regional)', 'WIN (Mackay/Wide Bay)' ],
+		'Seven' => [ 'Seven (Cairns/Townsville/Mackay/Wide Bay/Sunshine Coast)', 'Seven (Rockhampton/Toowoomba)' ] },
+	90 => { 'Prime' => [ 'Prime (Regional)', 'Prime (Albury)' ] }
+	};
+
+    my $region = $opt->{region};
+    return $chan unless ($rchans->{$region} and $rchans->{$region}->{$chan});
+    $seen_before = ($seen_before ? 1 : 0);
+    return $rchans->{$region}->{$chan}->[$seen_before];
 }
 
