Browse Source

fix warning for \d+x\d+ episode number

also: list of new episodes

themage
theMage 5 years ago
parent
commit
ccf2738a3a
2 changed files with 12 additions and 1 deletions
  1. 6 0
      lib/CinePantufas/Core.pm
  2. 6 1
      lib/CinePantufas/Source/EZTV.pm

+ 6 - 0
lib/CinePantufas/Core.pm

@ -71,6 +71,8 @@ sub __cmd_update {
71 71
      if @list;
72 72
  }
73 73
74
  my @new = ();
75
74 76
  my $fname = ___show_file();
75 77
  my %epidb;
76 78
  tie %epidb, 'DB_File', $fname;
@ -91,12 +93,16 @@ sub __cmd_update {
91 93
      $rec->{first_seen} = time;
92 94
      $rec->{name} = $show->{name};
93 95
96
      push @new, $show->{name};
94 97
      $newshows++;
95 98
    }
96 99
    $epidb{$k} = to_json($rec, {utf8=>1});
97 100
  }
98 101
99 102
  print STDERR "updated $sources source(s): $newshows new shows\n";
103
  if (@new) {
104
    print STDERR " => $_\n" for @new;
105
  }
100 106
}
101 107
102 108

+ 6 - 1
lib/CinePantufas/Source/EZTV.pm

@ -68,10 +68,15 @@ sub get_episode_list {
68 68
  my %episodes = ();
69 69
  for my $row (@rows) {
70 70
    my ($name) = $row =~ m{class="epinfo">([^>]+)</a>}smxi;
71
    my ($ses,$epi) = $name =~ m{S(\d+)E(\d+)};
71
    my ($ses,$epi) = $name =~ m{S?(\d+)[Ex](\d+)}i;
72 72
    my %links = reverse
73 73
        $row=~m{<a \s href="([^"]+)" \s+ class="download_(\d+)"}smxgi;
74 74
75
    unless ($ses and $epi) {
76
      print STDERR "Missing ses and epi in '$name'\n" if $ENV{DEBUG};
77
      next;
78
    }
79
75 80
    $_ = "http:$_" for grep { substr($_,0,1) eq '/' } values %links;
76 81
  
77 82
    my $episode=($ses+0).'x'.sprintf('%02d', $epi);