~davewalker/xmltv/544522

« back to all changes in this revision

Viewing changes to grab/it/tv_grab_it.in

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Lesicnik
  • Date: 2008-08-07 07:25:45 UTC
  • mfrom: (1.2.10 upstream) (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080807072545-ttu7eljrarkzon1p
Tags: 0.5.52-1ubuntu1
* Merge from debian unstable, remaining changes: (LP: #255450)
  - Fixes multiple broken grabbers (LP: #193703)
  - Update 06_grab_no.dpatch
* Deleted 07_grab_pt.patch from debian/patches as it is now in Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
# 08/12/2007
33
33
# skylife.it has moved to guidatv.sky.it
34
34
# code cleanup
35
 
# 15/01/2007
 
35
# 15/01/2008
36
36
# major optimizations in skylife.it! (thanks Massimo Savazzi)
 
37
# 30/06/2008
 
38
# better handling of season /episodes after site changes
 
39
# now using also the dtd tags episode-num
37
40
#################################################
38
41
# TODO
39
42
# - add more informative errors in xml
50
53
use warnings;
51
54
use strict;
52
55
 
53
 
use XMLTV::Version '$Id: tv_grab_it.in,v 1.59 2008/01/15 18:13:07 mnbjhguyt Exp $';
 
56
use XMLTV::Version '$Id: tv_grab_it.in,v 1.60 2008/06/30 15:39:37 mnbjhguyt Exp $';
54
57
use XMLTV::Capabilities qw/baseline manualconfig cache/;
55
58
use XMLTV::Description 'Italy';
56
59
use XMLTV::Supplement qw/GetSupplement/;
1494
1497
 
1495
1498
        my $desc = $content;
1496
1499
    
1497
 
        my ($cast, $country, $director, $year, $length, $subtitle);
 
1500
        my ($cast, $country, $director, $year, $length, $subtitle, $episode, $season);
 
1501
 
 
1502
        if ($desc=~/(.*?)\' Stagione - Ep.(\d+?) - (.*)/) {
 
1503
                    $season = $1;
 
1504
                    $episode =$2;
 
1505
            $desc = $3 if ($3 ne '');
 
1506
        }
1498
1507
 
1499
1508
        if ($desc=~/(.*?) - (.*)/) {
1500
 
            $subtitle = $1 if ($1 ne '' and $1 ne $programme->{title});
 
1509
                    $subtitle = $1 if ($1 ne '' and $1 ne $programme->{title});
1501
1510
            $desc = $2 if ($2 ne '');
 
1511
                    
 
1512
                    if ($subtitle=~/(.*?)\' Stagione/){$season = $1;}
 
1513
                    if ($subtitle=~/Ep.(\d+)/) {$episode = $1;}
 
1514
                        $subtitle='' if ($season or $episode);
1502
1515
        }
1503
1516
 
 
1517
 
1504
1518
        if ($desc=~/^\'(.*?)\' (.*)/) {
1505
 
            $subtitle.= ' - ' if ($subtitle);
1506
 
            $subtitle.= $1 if ($1 ne '' and $1 ne $programme->{title});
 
1519
                    $subtitle.= ' - ' if ($subtitle);
 
1520
            $subtitle= $1 if ($1 ne '' and $1 ne $programme->{title});
1507
1521
            $desc = $2 if ($2 ne '');
1508
 
        }       
 
1522
        }
 
1523
                
 
1524
                my $strseason = '';
 
1525
                $strseason.= 'Stagione '.$season if ($season);
 
1526
                if ($episode and $season){
 
1527
                        $strseason.= ' Episodio '.$episode ;
 
1528
                }
 
1529
                elsif ($episode) {
 
1530
                        $strseason.= 'Episodio '.$episode ;
 
1531
                }
1509
1532
 
 
1533
                if ($strseason and $subtitle){
 
1534
                        $subtitle="$strseason - ".$subtitle ;
 
1535
                }
 
1536
                else {
 
1537
                        $subtitle=$strseason;
 
1538
                };
1510
1539
 
1511
1540
        if ($desc=~/^Regia di (.*?), con (.*?); (.*?) (\d+?) \((\d+) min\)\. (.*)/) {
1512
1541
            $director = $1;
1556
1585
    $programme->{length}= $length*60 if ($length);
1557
1586
    $programme->{date}= $year if ($year);
1558
1587
    $programme->{'sub-title'}=[[$subtitle, $LANG] ] if ($subtitle);     
1559
 
    push @{$programme->{credits}->{director}}, $director if ($director);
 
1588
    push@{$programme->{'episode-num'}}, [$strseason, 'onscreen'] if ($strseason);       
 
1589
    push@{$programme->{'episode-num'}}, [(defined $season ? ($season-1) : '').".".(defined $episode ? ($episode-1) : '').".0/1", 'xmltv_ns'] if ($strseason);   
 
1590
 
 
1591
        push @{$programme->{credits}->{director}}, $director if ($director);
1560
1592
    push (@{$programme->{country}}, [$country, $LANG]) if ($country);
1561
1593
    $programme->{desc}=[[tidy($desc), $LANG ]] if ($desc ne '');
1562
1594