-----Original message-----
From: Mike Perkins <mikep@randomtraveller.org.uk>
Sent: Thursday 8th June 2023 12:52
To: mythtv-users@mythtv.org
Subject: Re: [mythtv-users] Transcode script that keeps show in Recordings
On 08/06/2023 12:45, James Abernathy wrote:
> On Wed, Jun 7, 2023 at 7:21 PM Jay Harbeston <jharbestonus@gmail.com> wrote:
>
>>
>>
>> On Jun 7, 2023, at 7:13 PM, James <jam@tigger.ws> wrote:
>>
>>
>>
>> On 8 Jun 2023, at 7:08 am, Jay Harbeston <jharbestonus@gmail.com> wrote:
>>
>>
>>
>> I have created a python version of ffcut.sh and am currently making sure I
>> have most of the kinks out of it.
>>
>> I'm thinking tomorrow I should be able to post the python version the same
>> way as I did the shell version.
>>
>> With the python version I did not have to create the text files as
>> intermediary holding arrays for data that needed to be used.
>>
>> It will require python version 3+.
>>
>> jamesWhen I created it originally, mythtranscode would not handle mp4
>> streams that we were getting from the HDHRs when silicon dust did the 4 or
>> so month experiment of being a content provider from the cloud. The ffmpeg
>> version ffcut.sh and soon the ffcut.py version will be able to handle both
>> mp4 and mpeg 2 transport streams.
>>
>>
> I'd be interested in looking at the python script also.
>
> BTW, I did get ffcut working for me to a point. I have to may the mysql
> commands look like this if password was 1234
> sudo mysql -u root -p1234
>
> That works from the console, but not sure what will happen in a UserJob
> when it encounters a sudo?
>
As I recall you can put something in the sudoers file for specific jobs and/or specific users, such
that you wouldn't require a password for that combination. If that wasn't so, half of unix wouldn't run.
--
Mike Perkins
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users http://wiki.mythtv.org/Mailing_List_etiquette MythTV Forums:
https://forum.mythtv.org Mike,
I modified Jay's script so that it uses the /etc/mythtv/config.xml file to get the user credentials:
confxml="/etc/mythtv/config.xml"
hostname=`grep "<Host" $confxml | sed -e "s;</.*>;;" | sed -e "s;<.*>;;" | sed -e "s/ *//g"`
username=`grep "UserName" $confxml | sed -e "s;</.*>;;" | sed -e "s;<.*>;;" | sed -e "s/ *//g"`
passwd=`grep "Password" $confxml | sed -e "s;</.*>;;" | sed -e "s;<.*>;;" | sed -e "s/ *//g"`
dbname=`grep "DatabaseName" $confxml | sed -e "s;</.*>;;" | sed -e "s;<.*>;;" | sed -e "s/ *//g"`
usercreds="-h$hostname -u$username -p$passwd $dbname"
echo "User Credentials = "$usercreds
Then I modified the sql query lines to use this info, such that the first query is:
echo "mythdir=$mythdir chanid=$chanid starttimeutc=$starttimeutc "
query0="select basename from recorded where chanid = $chanid and starttime = '$starttimeutc';"
echo "query = $query0"
basename=`echo "$query0;" | mysql -N $usercreds`
echo "Basename = $basename"
By modifying it in this way, I do not need to use sudo, so long as I enable file privileges for the mysql user, as per an earlier email from me.
Obviously, I should really stop echoing the $usercreds variable :-)
Regards,
Dave