tv_grab_zz_sdjson_sqlite not creating config file

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
Posts: 3
Joined: Thu Jun 25, 2020 6:39 pm
United States of America

tv_grab_zz_sdjson_sqlite not creating config file

Post by rickl19 » Wed Jul 01, 2020 1:00 am


I recently moved from 30 to 31 and am trying to configure the xmltv grabber. This has been nothing but frustration for me. I followed the pre-requisite steps in the wiki of:
  • Downloaded the latest of the script from github
  • Logged in as the same id that runs mythfilldatabase (ie: mythtv)
When I do the first step of:

Code: Select all

tv_grab_zz_sdjson_sqlite --manage-lineups --config-file $HOME/.mythtv/SchedulesDirect.xmltv
I see the prompts the wiki mentions, however, after entering my SD username and password, I don't see any actual lineups.
tv_grab_zz_sdjson_sqlite --manage-lineups --config-file $HOM#/.mythtv/SchedulesDirect.xmltv
Enter your username at Schedules Direct: blahblahblah
Enter your password for blahblahblah at Schedules Direct:

Your Schedules Direct account has the following lineups configured:
Lineup ID Description
Specify a Schedules Direct account lineup management action
0: Exit lineup management
1: Add an additional lineup to your account
2: Delete an existing lineup from your account
3: Display your password hash
4: Delete any password hash stored in the database
5: Initialize/update the local database
6: Manage database lineup channel selection
Select one: [0,1,2,3,4,5,6 (default=0)]
I pick option 5 and initialize the database. Then I exit as suggested in the wiki. Looking at what files it left behind, I see the following in my .mythtv folder:
-rw-r--r-- 1 mythtv mythtv 0 Jun 30 19:50 'FIOS All Channels.xmltv.TMP'
-rw-r--r-- 1 mythtv mythtv 48 Jun 30 20:26 'FIOS Clear.xmltv.TMP'
drwxr-xr-x 65 mythtv mythtv 4096 Jun 30 20:27 ../
drwxr-xr-x 23 mythtv mythtv 4096 Jun 30 20:29 ./
-rw-rw-r-- 1 mythtv mythtv 48 Jun 30 20:32 SchedulesDirect.xmltv.TMP
The next step in the wiki fails for me for obvious reasons in that it can't find the .xmltv configuration file. Any ideas why it leaves TMP files laying around?

Code: Select all

tv_grab_zz_sdjson_sqlite --days 0 --config-file /home/mythtv/.mythtv/SchedulesDirect.xmltv
Thank you for your help!

Posts: 3
Joined: Thu Jun 25, 2020 6:39 pm
United States of America

Re: tv_grab_zz_sdjson_sqlite not creating config file

Post by rickl19 » Wed Jul 01, 2020 2:23 am

Replying to myself. This error message on the Schedules Direct site in my lineup section is probably why the tvgrab script can't get at my lineups. Anyone know what causes this?

Unable to fetch SD-JSON lineups

User avatar
Posts: 1588
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: tv_grab_zz_sdjson_sqlite not creating config file

Post by bill6502 » Wed Jul 01, 2020 1:42 pm

There's a match for the error on the SD forum, but no solution. ... 95&p=10143
Haven't had/heard of the error myself.

Looks like in mythtv-setup, you've got three Video sources named:
'FIOS All Channels' , 'FIOS Clear' and SchedulesDirect. Which
should be fine, just making sure. Never used names with spaces

I'd give this a shot (as the mythtv user). Although I've only run it after my XMLTV was setup.
It needs the login and password in the DB, as far as I can tell:

Code: Select all

tv_grab_zz_sdjson_sqlite --list-lineups --config-file ~mythtv/.mythtv/<your source name>.xmltv
There's a --debug switch available which will give a lot of output. May be some clues there.
Output has login/password hash, don't post it.

You can print the hashed value of your password and then verify at the stored username/passwordhash
like this:

Code: Select all

echo -n 'your password here' | sha1sum
sqlite3 -line SchedulesDirect.DB "SELECT * FROM settings WHERE tag IN ('username', 'passwordhash');"

Posts: 3
Joined: Thu Jun 25, 2020 6:39 pm
United States of America

[solved] Re: tv_grab_zz_sdjson_sqlite not creating config file

Post by rickl19 » Thu Jul 02, 2020 7:54 pm

After rereading the mythtv wiki on the topic a few more times and doing some experiments, I finally got things working. I'll try to walk through what I did in the hopes it helps someone else.

My setup prior to converting to this grabber:
I had two lineups defined inside mythtv and also with Schedules Direct. However, I was only using 1 of the lineups for any real content. That's because I used to have an antenna on my roof paired with an ATSC/QAM HdHomerun. The other lineup in schedules direct was for the over the air content. My current setup is with Verizion FIOS and an HDHomerun Prime (hdhr3-cc) and the regular hdhomerun. I have 5 tuners in all. Three of those tuners come from the hdhr3-cc that has a cablecard and the other two tuners are the regular hdhomerun grabbing at whatever FIOS delivers in the clear.

In mythtv, I have 2 lineup sources. One is the full set of channels that FIOS offers (even if I can't receive them all) called Fios All Channels in myth and the other are those channels I'm able to receive from FIOS in the clear without needing the cablecard called Fios Clear in myth. That lineup is a subset of the full set of channels.

What I learned:
  • The Schedules Direct Fetch SD_JSON Warning message was because my grabber was not retrieving any lineups from Schedules Direct. This was because I didn't actually tell the grabber to fetch any lineups. I didn't realize I needed to create a lineup originally. In hindsight this seems obvious, but at the time I was confused because I knew I had two lineups already defined at Schedules Direct.
  • The location of the .xmltv files are supposed to be in the .mythtv directory not the .xmltv directory. I realized this after I told mythtv-setup to change the lineup source from SchedulesDirect to the tv_grab_zz grabber. Mythtv created those FIOSCLEAR.xmltv.TMP files and that clued me in
  • When you call the tv_grab_zz_sdjson_sqlite program with --manage-lineups, create the lineup in that tool - even if you think you have a lineup defined in the Schedules Direct website!
  • The tv grab database file (called SchedulesDirect.db) is located in the .xmltv directory. It does not get moved to the .mythtv directory
  • Remove spaces from the "tuners" you defined inside mythtv-setup. My two "tuners" were called 'FIOS All Channells" and "FIOS Clear", I editted them to not have spaces. Why? Because the name of the "tuner" inside mythtv-setup becomes the name of the file that .xmltv uses. In other words, "FIOSAllChannels" becomes .mythtv/FIOSAllChannels.xmltv and FIOSCLEAR becomes .mythtv/FIOSCLEAR.xmltv
  • After you create the "tuner" files in .mythtv using either the tv_grab_zz program or from mythtv-setup, you'll want to run mythfilldatabase.
    I did it from the command line so I could see the output in real time.
  • Depending how many channels you have in your lineup, the running of mythfilldatabase can take a real long time! Like over an hour long. I think my first end-to-end run of mythfilldatabase took about 2 hours. Subsequent runs should take less time.
I think that's about it. If something else occurs to me after I hit submit, I'll post a reply.


Post Reply