Skip to content

Commit

Permalink
Clean up EIT fixes for ProSiebenSat.1 and Vodafone Germany
Browse files Browse the repository at this point in the history
* Update EIT fixes for ProSiebenSat.1 (Europe):
EIT of ProSiebenSat.1 has changed years ago, old fixes do not work any more.
ProSiebenSat.1 still dumps all kind of metadata into the subtitle field
from where it can be retrieved.

* Remove most fixes for Kabel Deutschland:
EPG of Vodafone's (formerly Kabel Deutschland) DVB-C is much better today,
most fixes are superflous now. Due to frequency/channel changes, the old
fixes did not work any more anyway. Only use updated fixes for ProSiebenSat.1

* Remove fixups for German DVB-T:
Service got disabled in 2019.
  • Loading branch information
citronalco committed Dec 9, 2024
1 parent ec39b20 commit 8e21313
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 143 deletions.
118 changes: 65 additions & 53 deletions mythtv/libs/libmythtv/eitfixup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1737,75 +1737,87 @@ static const QMap<QString,DBPerson::Role> deCrewTitle {
*/
void EITFixUp::FixPRO7(DBEventEIT &event)
{
static const QRegularExpression pro7Subtitle { R"(,{0,1}([^,]*?),([^,]+?)\s{0,1}(\d{4})$)" };
auto match = pro7Subtitle.match(event.m_subtitle);
// strip repeat info and set previouslyshown flag
static const QRegularExpression pro7Repeat
{ R"(\(WH vom \w+, \d{2}\.\d{2}\.\d{4}, \d{2}:\d{2} Uhr\)$)" };

auto match = pro7Repeat.match(event.m_subtitle);
if (match.hasMatch())
{
if (event.m_airdate == 0)
{
event.m_airdate = match.captured(3).toUInt();
}
event.m_previouslyshown = true;
event.m_subtitle.remove(match.capturedStart(0),
match.capturedLength(0));
event.m_subtitle = event.m_subtitle.trimmed();
}

/* handle cast, the very last in description */
static const QRegularExpression pro7Cast { "\n\nDarsteller:\n(.*)$",
QRegularExpression::DotMatchesEverythingOption };
match = pro7Cast.match(event.m_description);
// strip "Mit Gebärdensprache (Online-Stream)"
static const QRegularExpression pro7signLanguage
{ R"(\s+Mit Gebärdensprache \(Online\-Stream\)$)" };
match = pro7signLanguage.match(event.m_subtitle);
if (match.hasMatch())
{
QStringList cast = match.captured(1).split("\n");
for (const auto& line : std::as_const(cast))
{
static const QRegularExpression pro7CastOne { R"(^([^\(]*?)\((.*)\)$)" };
auto match2 = pro7CastOne.match(line);
if (match2.hasMatch())
{
/* Possible TODO: if EIT inlcude the priority and/or character
* names for the actors, include them in AddPerson call. */
event.AddPerson (DBPerson::kActor, match2.captured(1).simplified());
}
}
event.m_description.remove(match.capturedStart(0),
match.capturedLength(0));
event.m_subtitle.remove(match.capturedStart(0),
match.capturedLength(0));
event.m_subtitle = event.m_subtitle.trimmed();
}

/* handle crew, the new very last in description
* format: "Role: Name" or "Role: Name1, Name2"
*/
static const QRegularExpression pro7Crew { "\n\n(Regie:.*)$",
QRegularExpression::DotMatchesEverythingOption };
match = pro7Crew.match(event.m_description);
// move age ratings into metadata
static const QRegularExpression pro7ratingAllAges
{ R"(\s+Altersfreigabe: Ohne Altersbeschränkung$)" };
match = pro7ratingAllAges.match(event.m_subtitle);
if (match.hasMatch())
{
EventRating prograting;
prograting.m_system="DE";
prograting.m_rating = "0";
event.m_ratings.push_back(prograting);

event.m_subtitle.remove(match.capturedStart(0),
match.capturedLength(0));
event.m_subtitle = event.m_subtitle.trimmed();
}
static const QRegularExpression pro7rating
{ R"(\s+Altersfreigabe: ab (\d+)$)" };
match = pro7rating.match(event.m_subtitle);
if (match.hasMatch())
{
QStringList crew = match.captured(1).split("\n");
for (const auto& line : std::as_const(crew))
EventRating prograting;
prograting.m_system="DE";
prograting.m_rating = match.captured(1);
event.m_ratings.push_back(prograting);

event.m_subtitle.remove(match.capturedStart(0),
match.capturedLength(0));
event.m_subtitle = event.m_subtitle.trimmed();
}

// move category and (original) airdate into metadata, add country and airdate to description
static const QRegularExpression pro7CategoryOriginalairdate
{ R"(\s+(Late Night Show|Live Shopping|Real Crime|Romantic Comedy|Scripted Reality|\S+), ([A-Z]+(?:\/[A-Z]+)*) (\d{4})$)" };
match = pro7CategoryOriginalairdate.match(event.m_subtitle);
if (match.hasMatch())
{
event.m_category = match.captured(1);

event.m_description.append(" (").append(match.captured(2)).append(" ").append(match.captured(3)).append(")");

uint y = match.captured(3).toUInt();
event.m_originalairdate = QDate(y, 1, 1);
if (event.m_airdate == 0)
{
static const QRegularExpression pro7CrewOne { R"(^(.*?):\s+(.*)$)" };
auto match2 = pro7CrewOne.match(line);
if (match2.hasMatch())
{
DBPerson::Role role = DBPerson::kUnknown;
if (deCrewTitle.contains(match2.captured(1)))
role = deCrewTitle[match2.captured(1)];
QStringList names = match2.captured(2).simplified().split(R"(\s*,\s*)");
for (const auto & name : std::as_const(names))
{
/* Possible TODO: if EIT inlcude the priority
* and/or character names for the actors, include
* them in AddPerson call. */
event.AddPerson (role, name);
}
}
event.m_airdate = y;
}
event.m_description.remove(match.capturedStart(0),
match.capturedLength(0));

event.m_subtitle.remove(match.capturedStart(0),
match.capturedLength(0));
event.m_subtitle = event.m_subtitle.trimmed();
}

// remove subtitle if equal to title
if (event.m_title == event.m_subtitle) {
event.m_subtitle = "";
}

/* FIXME unless its Jamie Oliver, then there is neither Crew nor Cast only
* \n\nKoch: Jamie Oliver
*/
}

/**
Expand Down
119 changes: 29 additions & 90 deletions mythtv/libs/libmythtv/eithelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1124,10 +1124,6 @@ static void init_fixup(FixupMap &fix)
fix[ 1089LL << 32 | 1 << 16] = // DVB-S
fix[ 1041LL << 32 | 1 << 16] = // DVB-S RTL Group HD Austria Transponder
fix[ 1057LL << 32 | 1 << 16] = // DVB-S RTL Group HD Transponder
fix[ 773LL << 32 | 8468U << 16] = // DVB-T Berlin/Brandenburg
fix[ 2819LL << 32 | 8468U << 16] = // DVB-T Niedersachsen + Bremen
fix[ 8706LL << 32 | 8468U << 16] = // DVB-T NRW
fix[ 12801LL << 32 | 8468U << 16] = // DVB-T Bayern
EITFixUp::kFixRTL;

// Mark HD+ channels as HDTV
Expand All @@ -1136,19 +1132,17 @@ static void init_fixup(FixupMap &fix)
fix[ 1057LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;
fix[ 1109LL << 32 | 1 << 16] = EITFixUp::kFixHDTV;

// PRO7/SAT.1
fix[ 1017LL << 32 | 1 << 16] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
fix[ 1031LL << 32 | 1 << 16 | 5300] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
fix[ 1031LL << 32 | 1 << 16 | 5301] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
fix[ 1031LL << 32 | 1 << 16 | 5302] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
fix[ 1031LL << 32 | 1 << 16 | 5303] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1;
fix[ 1031LL << 32 | 1 << 16 | 5310] = EITFixUp::kFixP7S1;
fix[ 1031LL << 32 | 1 << 16 | 5311] = EITFixUp::kFixP7S1;
fix[ 1107LL << 32 | 1 << 16] = EITFixUp::kFixP7S1;
fix[ 1082LL << 32 | 1 << 16] = EITFixUp::kFixP7S1;
fix[ 5LL << 32 | 133 << 16 | 776] = EITFixUp::kFixP7S1;
fix[ 8468 << 16 | 16426] = EITFixUp::kFixP7S1; // ProSieben MAXX - DVB-T Rhein/Main
fix[ 8707LL << 32 | 8468 << 16] = EITFixUp::kFixP7S1; // ProSieben Sat.1 Mux - DVB-T Rhein/Main
// PRO7/SAT.1 DVB-S
fix[ 1017LL << 32 | 1 << 16] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1; // DVB-S ProSiebenSat.1 Austria transponder
fix[ 1031LL << 32 | 1 << 16 | 5300] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1; // SAT.1 HD Austria
fix[ 1031LL << 32 | 1 << 16 | 5301] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1; // ProSieben HD Austria
fix[ 1031LL << 32 | 1 << 16 | 5302] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1; // kabel eins HD Austria
fix[ 1031LL << 32 | 1 << 16 | 5303] = EITFixUp::kFixHDTV | EITFixUp::kFixP7S1; // PULS 4 HD Austria
fix[ 1031LL << 32 | 1 << 16 | 5310] = EITFixUp::kFixP7S1; // SAT.1 Gold Austria
fix[ 1031LL << 32 | 1 << 16 | 5311] = EITFixUp::kFixP7S1; // Pro7 MAXX Austria
fix[ 1107LL << 32 | 1 << 16] = EITFixUp::kFixP7S1; // DVB-S ProSiebenSat.1 Germany transponder
fix[ 1082LL << 32 | 1 << 16] = EITFixUp::kFixP7S1; // DVB-S ProSiebenSat.1 Switzerland transponder
fix[ 5LL << 32 | 133 << 16 | 776] = EITFixUp::kFixP7S1; // DVB-S ProSiebenSat.1 Germany transponder

// ATV / ATV2
fix[ 1117LL << 32 | 1 << 16 | 13012 ] = EITFixUp::kFixATV; // ATV
Expand Down Expand Up @@ -1244,79 +1238,24 @@ static void init_fixup(FixupMap &fix)
fix[4097U << 16] |= EITFixUp::kEFixForceISO8859_1;
fix[4098U << 16] |= EITFixUp::kEFixForceISO8859_1;

//DVB-T Germany Berlin HSE/MonA TV
fix[ 772LL << 32 | 8468 << 16 | 16387] = EITFixUp::kEFixForceISO8859_15;
//DVB-T Germany Ruhrgebiet Tele 5
//fix[ 8707LL << 32 | 8468 << 16 | 16413] = EITFixUp::kEFixForceISO8859_15; // they are sending the ISO 8859-9 signalling now
// ANIXE
fix[ 8707LL << 32 | 8468U << 16 | 16426 ] = // DVB-T Rhein-Main
EITFixUp::kEFixForceISO8859_9;

// DVB-C Kabel Deutschland encoding fixes Germany
fix[ 112LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
fix[ 10000LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
fix[ 10001LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
fix[ 10002LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
fix[ 10003LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
fix[ 10006LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
fix[ 10009LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
fix[ 10010LL << 32 | 61441U << 16] = EITFixUp::kEFixForceISO8859_15;
// Mark program on the HD transponders as HDTV
fix[ 10012LL << 32 | 61441U << 16] = EITFixUp::kFixHDTV;
fix[ 10013LL << 32 | 61441U << 16] = EITFixUp::kFixHDTV;
// On transport 10004 only DMAX needs no fixing:
fix[10004LL<<32 | 61441U << 16 | 50403] = // BBC World Service
fix[10004LL<<32 | 61441U << 16 | 53101] = // BBC Prime (engl)
fix[10004LL<<32 | 61441U << 16 | 53108] = // Toon Disney (engl)
fix[10004LL<<32 | 61441U << 16 | 53109] = // Sky News (engl)
fix[10004LL<<32 | 61441U << 16 | 53406] = // BBC Prime
fix[10004LL<<32 | 61441U << 16 | 53407] = // Boomerang (engl)
fix[10004LL<<32 | 61441U << 16 | 53404] = // Boomerang
fix[10004LL<<32 | 61441U << 16 | 53408] = // TCM Classic Movies (engl)
fix[10004LL<<32 | 61441U << 16 | 53409] = // Extreme Sports
fix[10004LL<<32 | 61441U << 16 | 53410] = // CNBC Europe (engl)
fix[10004LL<<32 | 61441U << 16 | 53503] = // Detski Mir
fix[10004LL<<32 | 61441U << 16 | 53411] = // Sat.1 Comedy
fix[10004LL<<32 | 61441U << 16 | 53412] = // kabel eins classics
fix[10004LL<<32 | 61441U << 16 | 53112] = // Extreme Sports (engl)
fix[10004LL<<32 | 61441U << 16 | 53513] = // Playhouse Disney (engl)
fix[10004LL<<32 | 61441U << 16 | 53618] = // K1010
fix[10004LL<<32 | 61441U << 16 | 53619] = // GemsTV
EITFixUp::kEFixForceISO8859_15;
// On transport 10005 QVC and Giga Digital needs no fixing:
fix[10005LL<<32 | 61441U << 16 | 50104] = // E! Entertainment
fix[10005LL<<32 | 61441U << 16 | 50107] = // 13th Street (KD)
fix[10005LL<<32 | 61441U << 16 | 50301] = // ESPN Classic
fix[10005LL<<32 | 61441U << 16 | 50302] = // VH1 Classic
fix[10005LL<<32 | 61441U << 16 | 50303] = // Wein TV
fix[10005LL<<32 | 61441U << 16 | 50304] = // AXN
fix[10005LL<<32 | 61441U << 16 | 50305] = // Silverline
fix[10005LL<<32 | 61441U << 16 | 50306] = // NASN
fix[10005LL<<32 | 61441U << 16 | 50307] = // Disney Toon
fix[10005LL<<32 | 61441U << 16 | 53105] = // NASN (engl)
fix[10005LL<<32 | 61441U << 16 | 53115] = // VH1 Classic (engl)
fix[10005LL<<32 | 61441U << 16 | 53405] = // ESPN Classic (engl)
fix[10005LL<<32 | 61441U << 16 | 53402] = // AXN (engl)
fix[10005LL<<32 | 61441U << 16 | 53613] = // CNN (engl)
fix[10005LL<<32 | 61441U << 16 | 53516] = // Voyages Television
fix[10005LL<<32 | 61441U << 16 | 53611] = // Der Schmuckkanal
fix[10005LL<<32 | 61441U << 16 | 53104] = // Jukebox
EITFixUp::kEFixForceISO8859_15;
// On transport 10007 only following channels need fixing:
fix[10007LL<<32| 61441U << 16 | 53607] = // Eurosport
fix[10007LL<<32| 61441U << 16 | 53608] = // Das Vierte
fix[10007LL<<32| 61441U << 16 | 53609] = // Viva
fix[10007LL<<32| 61441U << 16 | 53628] = // COMEDY CENTRAL
EITFixUp::kEFixForceISO8859_15;
// RTL Subtitle parsing
fix[10007LL<<32| 61441U << 16 | 53601] = // RTL
fix[10007LL<<32| 61441U << 16 | 53602] = // Super RTL
fix[10007LL<<32| 61441U << 16 | 53604] = // VOX
fix[10007LL<<32| 61441U << 16 | 53606] = // n-tv
EITFixUp::kFixRTL | EITFixUp::kFixCategory;
// On transport 10008 only following channels need fixing:
fix[ 10008LL<<32 | 61441U << 16 | 53002] = // Tele 5
EITFixUp::kEFixForceISO8859_15;
// DVB-C Vodafone Germany
fix[ 10000LL<<32 | 61441U << 16 | 53626 ] = EITFixUp::kFixP7S1; // SAT.1
fix[ 10006LL<<32 | 61441U << 16 | 50019 ] = EITFixUp::kFixP7S1; // sixx HD
fix[ 10008LL<<32 | 61441U << 16 | 53621 ] = EITFixUp::kFixP7S1; // ProSieben
fix[ 10008LL<<32 | 61441U << 16 | 53622 ] = EITFixUp::kFixP7S1; // kabel eins
fix[ 10008LL<<32 | 61441U << 16 | 50700 ] = EITFixUp::kFixP7S1; // sixx
fix[ 10011LL<<32 | 61441U << 16 | 50056 ] = EITFixUp::kFixP7S1; // kabel eins CLASSICS HD
fix[ 10011LL<<32 | 61441U << 16 | 50058 ] = EITFixUp::kFixP7S1; // SAT.1 emotions HD
fix[ 10013LL<<32 | 61441U << 16 | 50015 ] = EITFixUp::kFixP7S1; // ProSieben HD
fix[ 10013LL<<32 | 61441U << 16 | 50057 ] = EITFixUp::kFixP7S1; // ProSieben FUN HD
fix[ 10013LL<<32 | 61441U << 16 | 50086 ] = EITFixUp::kFixP7S1; // Kabel eins Doku HD
fix[ 10014LL<<32 | 61441U << 16 | 50086 ] = EITFixUp::kFixP7S1; // kabel eins HD
fix[ 10017LL<<32 | 61441U << 16 | 50122 ] = EITFixUp::kFixP7S1; // kabel eins Doku
fix[ 10017LL<<32 | 61441U << 16 | 53009 ] = EITFixUp::kFixP7S1; // ProSieben MAXX
fix[ 10017LL<<32 | 61441U << 16 | 53324 ] = EITFixUp::kFixP7S1; // SAT.1 Gold
fix[ 10019LL<<32 | 61441U << 16 | 50018 ] = EITFixUp::kFixP7S1; // SAT.1 HD
fix[ 10020LL<<32 | 61441U << 16 | 50046 ] = EITFixUp::kFixP7S1; // ProSieben MAXX HD
fix[ 10020LL<<32 | 61441U << 16 | 50074 ] = EITFixUp::kFixP7S1; // SAT.1 Gold HD

// DVB-C Unitymedia Germany
fix[ 9999 << 16 | 161LL << 32 | 12101 ] = // RTL Television
Expand Down

0 comments on commit 8e21313

Please sign in to comment.