Author |
Message |
marc.aronson
|
Posted: Wed Aug 10, 2011 11:50 pm |
|
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location:
California
|
I just installed my first HDHOMERUN. RUnning LINHES 6.04.0. I did a channel scan following by a download for schedules direct. While the channel scan did find the call signs for the stations, it looks like the XMLTVID didn't get filled in for most of them as the listings data shows no match for major channels like KICU. Do I need to poke the XMLTVID's in by hand or is there an automated procedure for doing this? Thanks in advance for your help!
Marc
_________________ Marc
The views expressed are my own and do not necessarily reflect the views of my employer.
|
|
Top |
|
 |
goofee
|
Posted: Thu Aug 11, 2011 12:23 am |
|
Joined: Sat Feb 03, 2007 12:52 am
Posts: 187
Location:
Manitoba, Canada
|
It's been awhile but I think what I did was in mythtv-setup -> channel editor I selected icon download. It then matches callsigns with xmltvids and downloads the icon. Then mythfilldatabase works. (i think)
|
|
Top |
|
 |
spideyk21
|
Posted: Tue Aug 16, 2011 9:45 am |
|
Joined: Tue Sep 12, 2006 6:03 am
Posts: 210
Location:
Roseville, MI
|
I had to input the XMLID by hand for my WOW! service after the digital changeover. You can do this through MythWeb > Settings > TV > Channel Info tab (easiest way I know).
After you update all the XMLID's make sure to run a mythfilldatabase to propagate the listings.
_________________ -Roseville, Michigan USA LinHES R8: FE/BE, FE (x2)
|
|
Top |
|
 |
marc.aronson
|
Posted: Tue Aug 16, 2011 10:46 am |
|
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location:
California
|
Thanks for all the suggestions. Here is what I have learned:
1. Downloading the icons does not help get the XMLTVID's set properly.
2. If you set the channel number to the logical channel number shown in schedules direct & ensure that the XMLTVID is blanked out, the next run of "mythfilldatabase --refresh-today" will fill in the XMLTVID field with the appropriate value.
_________________ Marc
The views expressed are my own and do not necessarily reflect the views of my employer.
|
|
Top |
|
 |
tjc
|
Posted: Tue Aug 16, 2011 7:32 pm |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
Mostly. I think it was about 80% for Comcast here since it depends on matching the embedded channel id information with what's available in the Schedules Direct feed and some of them were either missing or enough different not to match... So depending on cable provider and line up, YMMV. 
|
|
Top |
|
 |
thekingofspain
|
Posted: Tue Aug 30, 2011 1:36 am |
|
Joined: Fri Nov 19, 2004 11:58 pm
Posts: 99
|
WOW cable is on rollout change 5 of 6 this month which forced me to upgrade from 5.5 to 7.03
I don't have this perfected yet, but zip2it is still your friend and has your xmltvids, channels, and even frequencies.
1. Goto tvlistings.zap2it.com and setup an account if needed to pick your provider.
2. Go to TV -> TV Listings
3. View Source and save as text file.
4. Parse the source for the goodies.
I am using the following regex expression to parse out my channel information:
Code: <a\s*class="zc-st-a"\s*href=\s*"http://tvlistings.zap2it.com/tvlistings/ZCSGrid.do\?stnNum= (?<xmltvid>\d+)\&channel= (?<channum>\d+)">(?<callsign>[^<]+)</a></span>\s* </td> <td.*\s+style="[^"]*"\s onclick="[^"]*\( this,\s*'.*', (?<cableId>\d{4}) (?<frequency>\d+), (?<transmissionChannel>\d+)\)">
From there I save the values as a CSV file: Code: xmltvid: 11438 channum: 3 callsign: WFLD cableId: 51 frequency: 403200000 transmissionChannel: 240
Then in a spread sheet I will be make a formulas that takes captured regex data and makes a sql update statement: Code: update channel set xmltvid = 11438, channum = '3', callsign ='WFLD' where serviceid = 1 and freqid = 240;
|
|
Top |
|
 |
marc.aronson
|
Posted: Tue Aug 30, 2011 11:28 pm |
|
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location:
California
|
What program are you using to process that regexp? ie, grep, sed, awk, etc.
_________________ Marc
The views expressed are my own and do not necessarily reflect the views of my employer.
|
|
Top |
|
 |
thekingofspain
|
Posted: Thu Sep 01, 2011 1:55 am |
|
Joined: Fri Nov 19, 2004 11:58 pm
Posts: 99
|
I formulated the the regex and generated the csv file using a program call Expresso. Its a windows program geared at .Net.
http://www.ultrapico.com/
For the CSV I am using google docs to make <cough> sql.
Today is the final lineup change, and Zip2It is not lining up with the myth scan at all.
Hopefully the frequency in dtv_multiplex line up, then I think I have enough info to by pass SD (home of 20 golf channels, 20 tvlands, etc) and just write insert statements into the channel table.
You could probably write the sql code doing a regex replace, but have do not have any experience with complex replace regexes.
|
|
Top |
|
 |
marc.aronson
|
Posted: Thu Sep 01, 2011 2:25 am |
|
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location:
California
|
I tried running that regexp using expresso on zap2it data for my area -- it didn't product any results so I can't assess weather the zap2it data is useful in my area. I did the following:
1. Loaded the regexp by using file->Read Regular Expression...
2. Loaded the zap2it data by using file->read input data...
3. Hit tools->Run Match while in test mode
No matches. Did I do it right?
If the zap2it data seems to be good I can write a Linux script that automates the end-to-end process...
_________________ Marc
The views expressed are my own and do not necessarily reflect the views of my employer.
|
|
Top |
|
 |
thekingofspain
|
Posted: Thu Sep 01, 2011 10:47 pm |
|
Joined: Fri Nov 19, 2004 11:58 pm
Posts: 99
|
I think it depends on how the browser saves the html data. Last night the right click save was different than the view source source save. The right click save escaped out an ampersand which caused the previous regex not to work.
Enter this in the test tab for the regular expression:
Code: <a\s*class="zc-st-a"\s*href=\s*"http://tvlistings.zap2it.com/tvlistings/ZCSGrid.do\?stnNum= (?<xmltvid>\d+)\&channel= (?<channum>\d+)">(?<callsign>[^<]+)</a></span>\s* </td> <td.*\s+style="[^"]*"\s onclick="[^"]*\( this,\s*'.*', (?<cableId>\d{4}) (?<frequency>\d+), (?<transmissionChannel>\d+)\)"> Click the design tab and check the only the following options on the bottom: Code: Multiline Ignore White Go back to a select the File->Read Input Data... menu item and read the zap2it html source file. Next click the Run Match button and it should spit out a row per channel in the search results. If you highlight some of the regular expression you can click the Partial Match, and it will match only the highlighted bit of the regular expression. This is great for debugging where to see where the regex stops matching. Also clicking on search result item highlights the select text in the Input Data window. Also good for debugger. Another hint is the search results are ordered by the source file, so your channels should be listed 1 to n sequentially. I there are missing channels something needs adjusting. Note the regex is accounting for both when a channel does and does not have an icon reference. In the Search Results, right click and select Export to comma separated values... These are the two sql statements that worked for me. Note that I deleted all the channels and before hand and ran mythsetup. When the channel scan was complete I querried mysql after each specific add channel popup appeared. I did not click the next install all channels until all channels were mapped from the previous insert. I could only paste like 10 statements into mysql via putty without mysql locking up. Code: ---ATSC Channel Query---
--formula-- =CONCATENATE("update channel set xmltvid = ", C3, ", channum = '",D3, "', callsign ='", E3, "' where atsc_major_chan= ", 1008, " and serviceid = ", D3, " and atsc_minor_chan = " , D3, " and xmltvid ='';")
-- note all my ATSC channel had 1008 as the major channel from the scan
[i]query[/i] : update channel set xmltvid = 11299, channum = '2', callsign ='WBBM' where atsc_major_chan= 1008 and serviceid = 2 and atsc_minor_chan = 2 and xmltvid ='';
---Non ATSC Channel Query---
--formula-- =CONCATENATE("update channel set xmltvid = ", $C3, ", channum = '",$D3, "', callsign ='", $E3, "' where atsc_major_chan= 0 and serviceid = ", $D3, " and atsc_minor_chan = 0 and xmltvid ='';")
--query-- update channel set xmltvid = 11299, channum = '2', callsign ='WBBM' where atsc_major_chan= 0 and serviceid = 2 and atsc_minor_chan = 0 and xmltvid ='';
c = xmltv d = channum e =callsign
Here is a link to Zap2it MySql XmlTvId Helper spread sheet.
Also for copy and paste, usually spread sheet to notepad, copying notepad and pasting to terminal is the best way to avoid corruption and oddities.
For each sql query column make an extra column. Select the sql formula column and select copy. Next select the blank column and perform a paste values into. This is the column you need to copy from and pastee into mysql from.[url][/url]
|
|
Top |
|
 |
mythedoff
|
Posted: Tue Sep 06, 2011 9:13 am |
|
Joined: Mon Jul 31, 2006 10:41 pm
Posts: 149
|
I offer the following and I hope won't be seen as an insult but I personally find the whole Espresso and Excel coding baffling.
As I am uncertain as to the what the final output should be, consider this script as incomplete and or wrong but I think it is close. I tried to emulate the output format:
Code: update channel set xmltvid = 11438, channum = '3', callsign ='WFLD' where serviceid = 1 and freqid = 240;
The script assumes the page source from zap2it is created and called listings. The curl command is commented out in the script, as it results in much shorter list of channels. The script assumes that it is in the same directory as listings and outputs two files, listings.csv and csv.formatted. Code: $ cat 2line.sh #!/bin/bash
#curl -silent -o listings http://tvlistings.zap2it.com/tvlistings/ZCGrid.do
grep stnNum listings | \ sed -e 's/^.*stnNum=//' -e 's/&channel=/,/' -e 's/">/,/' -e 's/<.*$//' > part1
sed '/^$/d' listings | sed -n '/stnNum/{n;p;}' | \ sed -e "s/^.*',//" \ -e 's/)">$//' | \ awk 'BEGIN { FS="," } { print substr($1,1,4)"," substr($1,5,9)","$2}' > part2
paste -d, part1 part2 > listings.csv rm part1 part2
# Format the delimited data awk -v cruxofthebisquit="'" 'BEGIN { FS = "," } { print "\nupdate channel" ; print "set xmltvid = " $1"," ; printf "\t""channum = " cruxofthebisquit $2 cruxofthebisquit ",\n" ; printf "\t""callsign =" crusofthebisquit $3 cruxofthebisquit "\n" ; print "where" ; printf "\tserviceid = " $2 " and\n" ; printf "\tfreqid = " $6 ";\n" }' < listings.csv > csv.formatted
Additions or corrections welcome.
|
|
Top |
|
 |
marc.aronson
|
Posted: Wed Sep 07, 2011 1:11 am |
|
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location:
California
|
mythedoff, thanks for posting that script -- you saved me time of doing the conversion to curl, sed and awk -- very much appreciated. After cleaning up a few cut-and-paste errors it works.
Any idea why Curl only pulls down the first 103 channels?
_________________ Marc
The views expressed are my own and do not necessarily reflect the views of my employer.
|
|
Top |
|
 |
mythedoff
|
Posted: Thu Sep 08, 2011 10:19 am |
|
Joined: Mon Jul 31, 2006 10:41 pm
Posts: 149
|
marc.aronson wrote: ... Any idea why Curl only pulls down the first 103 channels?
Ok, so it looks like curl results differ because of the zipcode which the browser has stored in a cookie. The curl command was using 12345.
It looks as if curl can pass the the stored browser cookies which can be found in the browser source file. See: http://curl.haxx.se/docs/httpscripting.html
A better solution would be to pass the zipcode which I would think is possible.
|
|
Top |
|
 |
marc.aronson
|
Posted: Fri Sep 09, 2011 5:16 am |
|
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location:
California
|
I saved the source from my browser rather than futzing with "curl" for now, so that I could verify that the frequencies made sense. After running the script, the first bunch of lines in listings.csv contain the following:
Code: 32046,1,VODDM,1315,461600000,240 10760,2,KTVU,1315,465200000,30 10600,3,KNTV,1315,463700000,62 10672,4,KRON,1315,465200000,30 10641,5,KPIX,1315,463700000,62 10507,6,KICU,1315,463400000,60 10479,7,KGO,1315,465200000,67 10736,8,KTSF,1315,465200000,60 10653,9,KQED,1315,465200000,60 10717,10,KQEH,1315,465200000,30 10269,11,HSN,1315,461600000,120 10345,12,KBCW,1315,465200000,30 10619,13,KOFY,1315,465200000,60 10418,14,KDTV,1315,465200000,60 23490,15,PUAC015,1315,461600000,240 10562,16,KKPX,1315,465200000,60 35545,17,KCSMDT,1315,465200000,90 10703,18,KSTS,1315,463400000,90 10457,19,KTNC,1315,465200000,30 14752,20,KFSF,1315,463400000,120 10381,21,KCNS,1315,465200000,30 10161,22,CSPAN,1315,458000000,300 11069,23,QVC,1315,465200000,180 22138,24,EDAC024,1315,461600000,240
Every channel is at a frequency of 46x,xxx,xxx. When I look at my exiting channel table, which is the result of my previous channel scans, I don't find anything on that frequency. I'm running a fresh scan now, but I also find it difficult to believe that every channel is at a frequency of 46x,xxx,xxx.
The script also seems to assume that the logical channel number and serviceid are they same, but this is rarely the case.
Is anyone successfully using this data to match scanned channel results to what the script produces?
Thanks!
When I look at the results of doing a channel scan, I don't see anything at that frequency.
_________________ Marc
The views expressed are my own and do not necessarily reflect the views of my employer.
|
|
Top |
|
 |
mythedoff
|
Posted: Fri Sep 09, 2011 10:43 am |
|
Joined: Mon Jul 31, 2006 10:41 pm
Posts: 149
|
marc.aronson wrote: I saved the source from my browser rather than futzing with "curl" for now, so that I could verify that the frequencies made sense. After running the script, the first bunch of lines in listings.csv contain the following: Code: 32046,1,VODDM,1315,461600000,240 10760,2,KTVU,1315,465200000,30 10600,3,KNTV,1315,463700000,62 10672,4,KRON,1315,465200000,30 10641,5,KPIX,1315,463700000,62 10507,6,KICU,1315,463400000,60 10479,7,KGO,1315,465200000,67 10736,8,KTSF,1315,465200000,60 10653,9,KQED,1315,465200000,60 10717,10,KQEH,1315,465200000,30 10269,11,HSN,1315,461600000,120 10345,12,KBCW,1315,465200000,30 10619,13,KOFY,1315,465200000,60 10418,14,KDTV,1315,465200000,60 23490,15,PUAC015,1315,461600000,240 10562,16,KKPX,1315,465200000,60 35545,17,KCSMDT,1315,465200000,90 10703,18,KSTS,1315,463400000,90 10457,19,KTNC,1315,465200000,30 14752,20,KFSF,1315,463400000,120 10381,21,KCNS,1315,465200000,30 10161,22,CSPAN,1315,458000000,300 11069,23,QVC,1315,465200000,180 22138,24,EDAC024,1315,461600000,240
Every channel is at a frequency of 46x,xxx,xxx. When I look at my exiting channel table, which is the result of my previous channel scans, I don't find anything on that frequency. I'm running a fresh scan now, but I also find it difficult to believe that every channel is at a frequency of 46x,xxx,xxx. The script also seems to assume that the logical channel number and serviceid are they same, but this is rarely the case. Is anyone successfully using this data to match scanned channel results to what the script produces? Thanks! When I look at the results of doing a channel scan, I don't see anything at that frequency. Sorry, as I said I was uncertain as to what the final output should be. I was trying to interpret the excel results which I must have done incorrectly. So the script is clearly wrong. Perhaps you could explain, possibly by example, what the correct data should be. Here is an alternative that could help. After entering the following and hitting the enter key, enter your zipcode. Code: $ read zipcode && curl -silent http://www.silicondust.com/hdhomerun/lineup_web/US:$zipcode#sidebyside | grep -A5 qam256 | head -n 14
Sample output:
<Modulation>qam256</Modulation>
<Frequency>111000000</Frequency>
<PhysicalChannel>98</PhysicalChannel>
<ProgramNumber>1</ProgramNumber>
<GuideNumber>924</GuideNumber>
<GuideName>WILLDT3</GuideName>
--
<Modulation>qam256</Modulation>
<Frequency>111000000</Frequency>
<PhysicalChannel>98</PhysicalChannel>
<ProgramNumber>2</ProgramNumber>
<GuideNumber>902</GuideNumber>
<GuideName>SMRENG</GuideName>
--
|
|
Top |
|
 |