Discussion:
[Xmltv-devel] [ xmltv-Bugs-3384336 ] _huro parse wrong date value in xml in some circumstances
SourceForge.net
2011-08-02 09:05:27 UTC
Permalink
Bugs item #3384336, was opened at 2011-08-02 11:05
Message generated for change (Tracker Item Submitted) made by ullmus
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3384336&group_id=39046

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: tv_grab_huro
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: nagy ullmus (ullmus)
Assigned to: Zsolt Bagoly (zbagoly)
Summary: _huro parse wrong date value in xml in some circumstances

Initial Comment:
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.

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3384336&group_id=39046
SourceForge.net
2011-08-02 13:50:44 UTC
Permalink
Bugs item #3384336, was opened at 2011-08-02 12:05
Message generated for change (Comment added) made by pojar-george
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3384336&group_id=39046

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: tv_grab_huro
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: nagy ullmus (ullmus)
Assigned to: Zsolt Bagoly (zbagoly)
Summary: _huro parse wrong date value in xml in some circumstances

Initial Comment:
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.

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

Comment By: Pojar George (pojar-george)
Date: 2011-08-02 16:50

Message:
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.

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=424135&aid=3384336&group_id=39046
Loading...