[mythtv-users] Get get user job to run

Simon Hobson linux at thehobsons.co.uk
Sun Dec 11 22:24:05 UTC 2011


Raymond Wagner wrote:

>  > First challenge -
>  > getting the program title and subtitle without it breaking on quote
>>  characters.
>
>A quick look at the code, that information is just being blindly
>replaced into the string with no escaping.

Yes, that much I figured from the errors reported in the logs.

>So where does that leave you?  Well that depends on the language you're
>using.

Bash

>In Perl or Python (or PHP (0.25+)), you can use the official
>bindings to pull that information from the database or backend
>protocol.  You could then key off %CHANID% and %STARTTIME%, or from
>%JOBID% directly.  Alternatively, you can pull such data from the old
>MythXML or the new Services API.

Hmm, looks like a lot of work to extract what I want from the XML 
whichever of those I used (services API isn't available anyway as I'm 
using 0.24.1). For now I'm just querying the database which will do 
for me.

>Title=`mysql --database=${DBName} --user=${DBUserName} 
>--password=${DBPassword} --column-names=false -e "select title from 
>recorded where chanid='${ChanID}' and starttime='${StartTime}'"`

Will put the title into a variable, complete with quote characters 
intact, and then I can use it later as "${Title}" (with the quotes).

Anyway, ffmpeg is chugging along now.

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.


More information about the mythtv-users mailing list