Incorrect Channel; SD/Upstream won't correct

An evolving, supported alternative to Rovi
Forum rules
★ Download the latest EPG123 here: http://epg123.garyan2.net <> Setup guide here: http://epg123.garyan2.net/downloads/epg123_Guide.pdf
NOYB

Posts: 111
Joined: Thu Sep 10, 2020 8:03 am
Location:

HTPC Specs: Show details

Incorrect Channel; SD/Upstream won't correct

#1

Post by NOYB » Sun Mar 07, 2021 10:48 pm

Duplicate of Bounce on Ch. 22.2 is in schedule on 42.2. But actual broadcast on 42.2 (21) is Daystar Español airing Reflections program 24/7.

I can change the channel name and logo easily thanks to the EPG123 customization features. :)
What would be a good way to override the SD provided schedule for the channel?
Suppose I could run a script to modify the mxf file before import. Haven't look at that though so don't know how feasible it would be.

This is a request for input not a feature request.

Thanks

Reason I've been given why SD/Upstream hasn't fixed...
No progress - our upstream closed the ticket:

"Channel contact has been unresponsive to our inquiries."

If they can't get the station to confirm the change, then they don't make the change. The assumption is that the station knows what they're transmitting, so our upstream has to get positive confirmation.
Last edited by NOYB on Sun Mar 07, 2021 11:28 pm, edited 2 times in total.

User avatar
garyan2

Posts: 5943
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#2

Post by garyan2 » Sun Mar 07, 2021 11:08 pm

If Daystar is available in the guide, just wrong channel, then you can map the correct guide listings using the client. Just left-click the station on the right side in your lineup and then right-click channel 42.2 on the left side to select 'Subscribe'.

If Daystar is not available, and you really want it to be correct, then you will need to find a lineup that does have it, add it in the configuration GUI and select it for download, then do the above in the client.

EPG123 will not override a station mapping if a valid mapping already exists, so the automatch routine will leave it alone.
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

NOYB

Posts: 111
Joined: Thu Sep 10, 2020 8:03 am
Location:

HTPC Specs: Show details

#3

Post by NOYB » Sun Mar 07, 2021 11:23 pm

Is there a good way to search channel lineups for a channel by name or affiliate?
"Daystar-ES" is the PSIP. SD provided affiliate of the main (English) channel is "DYSTR".

User avatar
garyan2

Posts: 5943
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#4

Post by garyan2 » Sun Mar 07, 2021 11:48 pm

https://www.rabbitears.info/search.php? ... pa%C3%B1ol

You will probably want to find one in your current time zone in case they have some time shift. Pick one and check zap2it (http://tvlistings.zap2it.com) to see if the listings match what you are seeing broadcast and then add it to your lineup in epg123.
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

NOYB

Posts: 111
Joined: Thu Sep 10, 2020 8:03 am
Location:

HTPC Specs: Show details

#5

Post by NOYB » Tue Mar 09, 2021 5:23 am

Haven't found a suitable schedule so looks like I'll be doing a script to modify epg123.mxf before it is imported.

Fortunately it's a 24/7 repetitive program schedule "Reflections (Español)". So replacing the channel's schedule entries with 360 or so one hour blocks of that is pretty straight forward.

Also adding a guide image, series info, and program entry.
Using id i9999 for the guide image, id si9999 for the series info, and id 99999 for the program.

Have a few questions...
What are the maximum values that those can be? Want to keep them from ever conflicting with something from SD.
What determines the series info and program uid value? Using "!Series!09999999" and "!Program!SH09999999_0000".

Anything else that should be modified or added?

Thanks

User avatar
garyan2

Posts: 5943
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#6

Post by garyan2 » Tue Mar 09, 2021 5:38 am

The ids can be anything you want, they don't have to follow the pattern or be numeric. The risk of conflicting with a series id is only if you use an 8 digit numeric value. You don't even need to use "si" or "i" for the series info and image ids.
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

NOYB

Posts: 111
Joined: Thu Sep 10, 2020 8:03 am
Location:

HTPC Specs: Show details

#7

Post by NOYB » Tue Mar 09, 2021 10:10 pm

Here is the PowerShell script I've come up with for anyone who may have occasion to do similar with some channel.
Being parameter driven it should be simple to apply to any channel.

The script replaces the channel's existing programs schedule with a number of recurring programs.

Action added to Task Scheduler epg123_update prior to the import.
Action: Start a program
Program/script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Add arguments (optional): -ExecutionPolicy Unrestricted -File C:\ProgramData\GaRyan2\epg123\output\Daystar-ES_Schedule_Reflections.ps1
Start in (optional): C:\ProgramData\GaRyan2\epg123\output
C:\ProgramData\GaRyan2\epg123\output\Daystar-ES_Schedule_Reflections.ps1

Code: Select all

# File Encoding: UTF-8-BOM

# Criteria to use
$MXF_Path = 'C:\ProgramData\GaRyan2\epg123\output\epg123.mxf'	# Fully qualified path to MXF file

$Channel_name = 'Daystar-ES'
$Channel_callSign = 'Daystar-ES'
$Station_callSign = 'KPXGLD2'
$Affiliate = 'DYSTR'

$GuideImageID = 'c_i0001'
$SeriesInfoID = 'c_si0001'
$ProgramID = 'c_00001'

$SeriesInfoUID = '!Series!c_00000001'
$ProgramUID = '!Program!c_SH00000001_0000'

$imageUrl = 'https://schedulesdirect-api20141201.s3.us-east-1.amazonaws.com/assets/p8555922_b_h3_ac.jpg'

$duration = '3600'
$qty = 360	# 15 days
$tvRating = '3'
$isRepeat = 'true'

$title = 'Reflections (Español)'
$description = 'Familiar hymns and original music accompany Scripture to help one let go and surrender during a time of daily prayer and meditation.'
$shortDescription = 'Familiar hymns and original music accompany Scripture to help one let go for a time of daily prayer.'
$language = 'es'

$startAirdate = '2011-03-01'
$originalAirdate = '2011-03-01'
$keywords = ''
$series= $SeriesInfoID
$isMusic = 'true'
$isSeries = 'true'
$isGeneric = 'true'


#
# The below should be parameter driven.
#

# Backup and load the MXF file.
Copy-Item -Path $MXF_Path -Destination $MXF_Path'.original'
$epg123_mxf = Get-Content -path $MXF_Path -Raw


# Find the channel by name and callSign.
$found = $epg123_mxf -match '<Service id="(.*?)" uid="(.*?)" name="'+$Channel_name+'" callSign="'+$Channel_callSign+'".*? logoImage="(.*?)".*?/>'
if ($found) {
#	"found"
	$Service_id = $matches[1]
	$Service_uid = $matches[2]
	$Service_logoImage = $matches[3]
} else {
#	"not found"
	exit
}


# Make guide image, series info, and program entry xml.
$XmlStrGuideImage = '<GuideImage id="'+$GuideImageID+'" imageUrl="'+$imageUrl+'" />'
$XmlStrSeriesInfos = '<SeriesInfo id="'+$SeriesInfoID+'" uid="'+$SeriesInfoUID+'" title="'+$title+'" description="'+$description+'" shortDescription="'+$shortDescription+'" startAirdate="'+$startAirdate+'" guideImage="'+$GuideImageID+'" />'
$XmlStrPrograms = '<Program id="'+$ProgramID+'" uid="'+$ProgramUID+'" title="'+$title+'" description="'+$description+'" shortDescription="'+$shortDescription+'" language="'+$language+'" originalAirdate="'+$originalAirdate+'" keywords="'+$keywords+'" series="'+$series+'" isMusic="'+$isMusic+'" isSeries="'+$isSeries+'" isGeneric="'+$isGeneric+'" />'


# Xml to correct the affiliate.
$XmlStrService_Org = '<Service id="'+$Service_id+'" uid="'+$Service_uid+'" name="'+$Channel_name+'" callSign="'+$Channel_callSign+'" affiliate="!Affiliate!.*?" logoImage="'+$Service_logoImage+'" />'
$XmlStrService_New = '<Service id="'+$Service_id+'" uid="'+$Service_uid+'" name="'+$Channel_name+'" callSign="'+$Channel_callSign+'" affiliate="!Affiliate!'+$Affiliate+'" logoImage="'+$Service_logoImage+'" />'


# Xml to override the schedule entries.
for ($i=1; $i -le $qty - 1; $i++)
{
	$XmlStrScheduleEntries += '      <ScheduleEntry program="'+$ProgramID+'" duration="'+$duration+'" tvRating="'+$tvRating+'" isRepeat="'+$isRepeat+'" />'+"`r`n"
}

$XmlStrSchedule_Org = '<ScheduleEntries service="'+$Service_id+'">
      <ScheduleEntry program=".*?".*? startTime="(?<startDate>(.*?))T.*?".*?/>
      <ScheduleEntry program.*?
    </ScheduleEntries>'

$XmlStrSchedule_New = '<ScheduleEntries service="'+$Service_id+'">
      <ScheduleEntry program="'+$ProgramID+'" startTime="${startDate}T00:00:00" duration="'+$duration+'" tvRating="'+$tvRating+'" isRepeat="'+$isRepeat+'" />
      '+$XmlStrScheduleEntries.Trim()+'
    </ScheduleEntries>'

$XmlStrSchedule_Org = '(?ms)'+$XmlStrSchedule_Org		# enable multi line mode and include CR LF in wild card.


# Apply changes to the MXF.
$org = '</GuideImages>'
$new = '  '+$XmlStrGuideImage+"`r`n    </GuideImages>"
$epg123_mxf = $epg123_mxf -replace $org, $new

$org = '</SeriesInfos>'
$new = '  '+$XmlStrSeriesInfos+"`r`n    </SeriesInfos>"
$epg123_mxf = $epg123_mxf -replace $org, $new

$org = '</Programs>'
$new = '  '+$XmlStrPrograms+"`r`n    </Programs>"
$epg123_mxf = $epg123_mxf -replace $org, $new

$org = $XmlStrService_Org
$new = $XmlStrService_New
$epg123_mxf = $epg123_mxf -replace $org, $new

$org = $XmlStrSchedule_Org
$new = $XmlStrSchedule_New
$epg123_mxf = $epg123_mxf -replace $org, $new


# Save the modified MXF file.  Encoding UTF-8-BOM
$epg123_mxf | Set-Content -Encoding UTF8 -Path $MXF_Path


#"$Service_id"
#"$Service_uid"
#"$Service_logoImage"

#pause	# For debugging (don't exit/close PS window)
Last edited by NOYB on Wed Mar 10, 2021 3:05 am, edited 1 time in total.

User avatar
garyan2

Posts: 5943
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#8

Post by garyan2 » Tue Mar 09, 2021 10:55 pm

You're not going to want to populate the keywords unless you find the keywords you want in the mxf and use the ids from those. The id values for keywords will possibly change run-to-run.

Your series info and program IDs have a potential to conflict with SD, but I doubt you will have a problem. I just checked and that series/program does not exist. You could put a c_ in front of them as well if you want.
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

NOYB

Posts: 111
Joined: Thu Sep 10, 2020 8:03 am
Location:

HTPC Specs: Show details

#9

Post by NOYB » Wed Mar 10, 2021 12:19 am

Do you mean the series and program uid values?

Like this?

Code: Select all

$SeriesInfoUID = 'c_!Series!00000001'
$ProgramUID = 'c_!Program!SH00000001_0000'
or like this?

Code: Select all

$SeriesInfoUID = '!Series!c_00000001'
$ProgramUID = '!Program!c_SH00000001_0000'
I'm not sure what roll the "!series!" and "!program!" prefixes play and then the "SH" also and if there are any requirement for the uid to begin with the prefix.
Guess what I mean is that I'm not sure if any of that ever gets used as a substring.

I'll dispense with the keywords. Don't need them for this program.

Code: Select all

$keywords = ''

User avatar
garyan2

Posts: 5943
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#10

Post by garyan2 » Wed Mar 10, 2021 2:00 am

The "!Series!" and "!Program!" are really just namespaces in the database. MS/Zap2it/Rovi actually used "!MCSeries!" and "!MCProgram!"... just I think it would be desirable to have them use the same namespaces as epg123. What comes after the last '!' can be anything you want. That will be the id of the series and program in the database.

The 'SH', along with 'EP', 'MV', and 'SP' and part of how Gracenote id's their programs. Nothing to do with WMC. All the MS/Rovi id's were strictly numeric, but like I said, it can be anything you want.
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

NOYB

Posts: 111
Joined: Thu Sep 10, 2020 8:03 am
Location:

HTPC Specs: Show details

#11

Post by NOYB » Wed Mar 10, 2021 2:24 am

Okay thanks.

Think I just prefix value part with the "c_" like so...

Code: Select all

$SeriesInfoUID = '!Series!c_00000001'
$ProgramUID = '!Program!c_SH00000001_0000'

NOYB

Posts: 111
Joined: Thu Sep 10, 2020 8:03 am
Location:

HTPC Specs: Show details

#12

Post by NOYB » Fri Mar 19, 2021 8:18 pm

The PS script is catching this exception. It is always for 2 hours after the execution hour. So for 6 am update the exception is for 8 am.

Don't see how to track down which input string is not in the correct format. The message doesn't seem to cite a specific parameter.

Code: Select all

[3/19/2021 1:08:07 PM] ===============================================================================
[3/19/2021 1:08:07 PM]  Beginning epg123 client execution. version 1.6.3.0
[3/19/2021 1:08:07 PM] ===============================================================================
[3/19/2021 1:08:07 PM] [ INFO] Beginning epg123 client execution. 2021-03-19 20:08:07Z
[3/19/2021 1:08:07 PM] [ INFO] Import: True , Match: True , NoLogo: False , Force: False , ShowProgress: False , NoGC: True , NoVerify: False , Verbose: False
[3/19/2021 1:08:08 PM] Entering ImportMxfFile() for file "c:\programdata\garyan2\epg123\output\epg123.mxf".
[3/19/2021 1:08:21 PM] [ INFO] Successfully imported .mxf file into Media Center database. Exit code: 0
[3/19/2021 1:08:21 PM] Exiting ImportMxfFile(). SUCCESS.
[3/19/2021 1:08:21 PM] Entering VerifyLoad()
[3/19/2021 1:08:24 PM] [ INFO] Exception caught for Daystar-ES at 3/19/2021 3:00:00 PM, message Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at epg123Client.VerifyLoad..ctor(String mxfFile, Boolean verbose)
[3/19/2021 1:08:25 PM] [ INFO] Checked 23781 entries and corrected 0 of them.
[3/19/2021 1:08:25 PM] Exiting VerifyLoad()
[3/19/2021 1:08:25 PM] [ INFO] Completed the automatch of lineup stations to tuner channels.
[3/19/2021 1:08:25 PM] [ INFO] Completed lineup refresh.
[3/19/2021 1:08:25 PM] Entering RunWmcIndexTask(PvrScheduleTask)
[3/19/2021 1:08:25 PM] [ INFO] SUCCESS: Attempted to run the scheduled task "Microsoft\Windows\Media Center\PvrScheduleTask".
[3/19/2021 1:08:25 PM] [ INFO] Successfully started the PvrScheduleTask task. Exit code: 0
[3/19/2021 1:08:25 PM] Exiting RunWmcIndexTask(PvrScheduleTask). SUCCESS.
[3/19/2021 1:08:25 PM] Entering RunWmcIndexTask(ReindexSearchRoot)
[3/19/2021 1:08:25 PM] [ INFO] SUCCESS: Attempted to run the scheduled task "Microsoft\Windows\Media Center\ReindexSearchRoot".
[3/19/2021 1:08:25 PM] [ INFO] Successfully started the ReindexSearchRoot task. Exit code: 0
[3/19/2021 1:08:25 PM] Exiting RunWmcIndexTask(ReindexSearchRoot). SUCCESS.
[3/19/2021 1:08:25 PM] [ INFO] MXF file was created on 3/19/2021 9:13:13 AM
[3/19/2021 1:08:25 PM] [ INFO] Completed EPG123 client execution.
[3/19/2021 1:08:25 PM] [ INFO] EPG123 client execution time was 00:00:17.9716414.

User avatar
garyan2

Posts: 5943
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#13

Post by garyan2 » Fri Mar 19, 2021 9:27 pm

Ah, sorry. I forgot about the verification step. It is probably choking on the program and series id when I am determining if programs are of the same series. I'll take a look later to give specifics.

Sent from my SM-G965U using Tapatalk

- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

User avatar
garyan2

Posts: 5943
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#14

Post by garyan2 » Fri Mar 19, 2021 11:18 pm

Could you send me your mxf file so I can take a look? The only thing I parse to an int in the verify process is the program id (not the uid). If you made the id custom as well, that is probably where the problem is.
support@garyan2.net
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

NOYB

Posts: 111
Joined: Thu Sep 10, 2020 8:03 am
Location:

HTPC Specs: Show details

#15

Post by NOYB » Fri Mar 19, 2021 11:29 pm

Sent the customized MXF file.
Yeah the program ID is prefixed with "c_".

Is that something you want to change to a string verify or should remove the "c_" prefix and do something else to prevent possible conflict with SD program iD's?

User avatar
garyan2

Posts: 5943
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#16

Post by garyan2 » Fri Mar 19, 2021 11:33 pm

Yah, that's the problem. Change it to something like '999999999' will work and I would think you would never have 1 billion programs in the MXF file to be concerned about.
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

User avatar
garyan2

Posts: 5943
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#17

Post by garyan2 » Fri Mar 19, 2021 11:43 pm

Oh, and the reason for the 2 hour difference between the update time and the time logged for the verify failure... EPG123 does not verify the current running program or the next program in the schedule entries. So if the current running program is an hour long, and the next program is an hour long, then there will be a 2 hour difference between the current time and the first verified program in the database.
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

NOYB

Posts: 111
Joined: Thu Sep 10, 2020 8:03 am
Location:

HTPC Specs: Show details

#18

Post by NOYB » Sat Mar 20, 2021 12:12 am

Code: Select all

[3/19/2021 5:09:54 PM] Entering VerifyLoad()
[3/19/2021 5:09:57 PM] [ INFO] Exception caught for Daystar-ES at 3/19/2021 7:00:00 PM, message Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at epg123Client.VerifyLoad..ctor(String mxfFile, Boolean verbose)
[3/19/2021 5:09:57 PM] [ INFO] Checked 25473 entries and corrected 0 of them.
[3/19/2021 5:09:57 PM] Exiting VerifyLoad()
Looks like I'll have to increment from the last (highest) program id value. Hope they are always in sequence (highest as last in the list of programs).

User avatar
garyan2

Posts: 5943
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#19

Post by garyan2 » Sat Mar 20, 2021 12:23 am

Yah, I'm a doofus. The reason I am parsing the id to an int is to identify which element in the array I need to look at. Of course, 9999999999 isn't going to work because the array isn't that big.

Yes, they are sequential with highest as the last. Though this is not guaranteed with my programming, I have never seen it any different.
- Gary
Keeping WMC alive beyond January 2020. http://epg123.garyan2.net

NOYB

Posts: 111
Joined: Thu Sep 10, 2020 8:03 am
Location:

HTPC Specs: Show details

#20

Post by NOYB » Sat Mar 20, 2021 12:27 am

Thanks.
Grabbing the last program id is probably the easiest. But could also count the number of xml program tags.

Post Reply