#448 _huro parse wrong date value in xml in some circumstances

0.5.65
closed-fixed
5
2014-04-10
2011-08-02
nagy ullmus
No

If the description of the program is in this form:

"1100 év Európa közepén (magyar ism. sor., 41. rész, 1996) - Felső-Zemplén, ruszinok földje"

(from m1 tv)

tv_grab_huro return:

</programme>
<programme start="20110802181000 +0200" stop="20110802184000 +0200" channel="002.port.hu">
<title lang="hu">1100 év Európa közepén</title>
<desc lang="hu">1100 év Európa közepén (magyar ism. sor., 41. rész, 1996) - Felső-Zemplén, ruszinok földje</desc>
<date>1100</date>
<category lang="en">Educational</category>
<category lang="hu">Oktatás</category>
</programme>

with "1100" in date tag instead of "1996".

This always happens when the program description will appear with a number formats [12][0-9]{3} outside the bracket. eg "1000 miles to ..." or something like that.

Discussion

  • Pojar George

    Pojar George - 2011-08-02

    Hello

    I found a quick solution for this problem

    "1100 év Európa közepén (magyar ism. sor., 41. rész, 1996) - Felső-Zemplén, ruszinok földje"

    if there is () in the desc grab from there:

    "if (m/\(?.*? ([12][0-9]{3})/) { $year = $1 }"

    Explanation:
    grab only if there is a left parenthesis "\(?"

    I did a little test patch:

    --------------------------------------- CODE ---------------------------------------------

    --- tv_grab_huro.in 2011-07-28 12:01:54.000000000 +0300
    +++ tv_grab_huro.in.new 2011-08-02 16:20:44.871094000 +0300
    @@ -716,7 +716,7 @@
    # port.cz/.sk episode style without season
    elsif (m/$WORDS{$COUNTRY}->{episode} \s*([0-9\/]+)/) { $episode = $1; }
    if (m/\s*(\d+)'/) { $minutes = $1; }
    - if (m/\s*([12][0-9]{3})/) { $year = $1 }
    + if (m/\(?.*? ([12][0-9]{3})/) { $year = $1 }

    t "found episode: '$episode'" if defined $episode;
    t "found minutes: '$minutes'" if defined $minutes;
    @@ -1113,7 +1113,7 @@
    { $episode = $1; last SWITCH;}
    if ((m/\s*(\d+) $WORDS{$COUNTRY}->{minute}/) && (! defined $minutes))
    { $minutes = $1; last SWITCH;}
    - if ((m/\s*([12][0-9]{3})/) && (! defined $year))
    + if ((m/\(?.*? ([12][0-9]{3})/) && (! defined $year))
    { $year = $1; last SWITCH;}
    { ; } # default -> category, was processed over
    }

    ------------------------------------------------------------------------------------------

    Greetings.

     
  • Geoff

    Geoff - 2014-04-10
    • status: open --> closed-fixed
    • Group: --> 0.5.65
     
  • Geoff

    Geoff - 2014-04-10

    Fixed in version 1.49

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks