View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 14 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sat Aug 02, 2008 11:35 pm 
Offline
Joined: Sat Dec 10, 2005 3:41 pm
Posts: 62
Hi, I'm not sure how challenging this is. From a command line, I'd like to get the title of the next recording.

It might be as simple as some command I'm not familiar with. Or it might require querying a database. I'm certainly willing to do some of the leg work and research if someone wants to give me a hint.

_________________
Skill level: 10^-3


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 03, 2008 3:38 am 
Offline
Joined: Wed Mar 03, 2004 7:43 pm
Posts: 748
Location: Sydney, Australia
Soemthing like:
Code:
mythbackend --printsched | head -19 | tail -1 | cut -c 1-38

_________________
| Nigel Pearson, nigel.pearson.au@gmail.com
| "Things you own end up owning you" - Tyler, Fight Club


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 03, 2008 8:07 am 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
I'm afraid that there is no simple answer. The idle.sh script has code to solve a related problem and in verbose mode it prints out the information so you might want to look into that. Unfortunately --printsched gives you a truncated title and also shows potential recordings (schedule matches) which aren't going to be recorded because they've already been recorded or will be recorded later or conflict with something else or ... It _does_ provide an indicator that you can use to tell if something will actually be recorded, but for the full title and subtitle you'll need to go to the DB tables.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 03, 2008 8:23 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
I know this isn't what you asked and may not be a relevant solution for you, but if you have mythweb enabled, browse to the backend status link in your web browser:
Code:
http://IP_of_Mythtv_master_backend/mythweb/status


It will display a very nice summary page including the next 10 shows to be recorded among other useful data.

If you're sshing into your mythtv box from outside the LAN and you don't have your http accessible outside the LAN, I wonder what that page would look like displayed via lynx? In theory, that would allow you to see the info you're seeking in the ssh window:
Code:
$ lynx localhost/mythweb/status

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 03, 2008 4:44 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,
Quote:
$ lynx localhost/mythweb/status

Gives me:
401 Authorization Required

Authorization Required

This server could not verify that you are authorized to access the
document requested. Either you supplied the wrong credentials (e.g.,
bad password), or your browser doesn't understand how to supply the
credentials required.

I think it is the later as it doesn't ask for any login using lynx. Tried as localhost and by ip with same results.

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 03, 2008 6:08 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
I'm not near it now, but I think there's an -auth switch you can pass to the server that will allow this. See the lynx manpage:

Code:
$ man lynx

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 03, 2008 9:29 pm 
Offline
Joined: Sat Feb 03, 2007 12:52 am
Posts: 187
Location: Manitoba, Canada
I use the upcoming recordings scrip from the wiki email tricks page http://www.knoppmythwiki.org/index.php?page=EmailTricks
It returns the next 10 scheduled to record. Might do what your looking for.
Code:
#!/bin/bash
lynx -dump http://localhost:6544 | sed -n '/^Schedule$/,/^Job\ Queue$/p' | sed  '/^Schedule$\|^Job\ Queue$/d' > /usr/src/sendemail/upcoming.txt
perl /usr/bin/sendEmail.pl -f <sender@email> -t <destination@email> -u "Upcoming Shows" -s <sender@email> -o message-file=/usr/src/sendemail/upcoming.txt


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 03, 2008 9:59 pm 
Offline
Joined: Fri Oct 20, 2006 12:04 pm
Posts: 905
Location: LA, CA
goofee wrote:
I use the upcoming recordings scrip from the wiki email tricks page http://www.knoppmythwiki.org/index.php?page=EmailTricks
It returns the next 10 scheduled to record. Might do what your looking for.
Code:
#!/bin/bash
lynx -dump http://localhost:6544 | sed -n '/^Schedule$/,/^Job\ Queue$/p' | sed  '/^Schedule$\|^Job\ Queue$/d' > /usr/src/sendemail/upcoming.txt
perl /usr/bin/sendEmail.pl -f <sender@email> -t <destination@email> -u "Upcoming Shows" -s <sender@email> -o message-file=/usr/src/sendemail/upcoming.txt


Yep, I use that every day to get an email with all kinds of goodies.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 09, 2008 4:18 pm 
Offline
Joined: Sat Dec 10, 2005 3:41 pm
Posts: 62
nigelpearson wrote:
Soemthing like:
Code:
mythbackend --printsched | head -19 | tail -1 | cut -c 1-38


Nifty! What are the flags? (S C I T N). T seems to be the recording frequency. N seems to indicate if it was previously recorded?


Quote:
http://IP_of_Mythtv_master_backend/mythweb/status


Also nifty

_________________
Skill level: 10^-3


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 09, 2008 4:58 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
The column under the 'N' (column 70) is what you need to looks at.

Anything with a number 1-9 will be recorded on the corresponding device.
'R' means that you've still got a recording of that.
'P' means previously recorded and deleted.
'E' means an earlier showing will be recorded.
'C' means that the recording will be skipped due to a conflict.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2008 1:11 pm 
Offline
Joined: Fri Sep 07, 2007 11:57 pm
Posts: 166
tjc wrote:
The column under the 'N' (column 70) is what you need to looks at.

Anything with a number 1-9 will be recorded on the corresponding device.
'R' means that you've still got a recording of that.
'P' means previously recorded and deleted.
'E' means an earlier showing will be recorded.
'C' means that the recording will be skipped due to a conflict.


how is the output of mythbackend -printsched tabulated?
i'm thinking of something like:

Code:
mythbackend --printsched | awk -F'\t' '/print list start/,/print list end/{if ($9 >= 1 && $9 <= 9 || $9 == "N") print $4"\t"$5"\t"$1}'


where 9 (in $9) is the number of the column where the value of N appears and 1,4,5 are where the title, day, and time appear. this should work if the list is tabulated with tabs as delimiters.... (i'm at work right now and can't test it on the machine!)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2008 7:54 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Sorry that won't work. You need to do it by character column ranges as in the example.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2008 9:49 pm 
Offline
Joined: Fri Sep 07, 2007 11:57 pm
Posts: 166
tjc wrote:
Sorry that won't work. You need to do it by character column ranges as in the example.


yeah, i realized that once i tried it...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 31, 2008 11:33 am 
Offline
Joined: Mon Jul 31, 2006 10:41 pm
Posts: 149
Here's what I use in a motd script.

Code:
mythbackend --printsched 2> /dev/null | sed -n '/list\ start/,/list\ end/p' | egrep -v "print|^Title" | cut -c -70 | grep -G [0-9]$ | cut -c -43,44-58


to /etc/profile add:
Code:
/usr/local/bin/motdxtra.sh


create /usr/local/bin/motdxtra.sh script and a make executable:
Code:
#! /bin/bash
#/usr/local/bin/motdxtra.sh

echo ""
lynx -dump http://localhost:6544 | sed -n '/^Encoder\ status$/,/^Schedule$/p' | sed  '/^Schedule$/d'
lynx -dump http://localhost:6544 | sed 20q | sed -n '/profile\.$/{g;1!p;};h' | tail -n 1 | sed 's/   This recording will start in /   The next recording starts in /' | sed 's/ using.*$//'

echo ""
echo "Next five shows to be recorded:"
echo ""
mythbackend --printsched 2> /dev/null | sed -n '/list\ start/,/list\ end/p' | egrep -v "print|^Title" | cut -c -70 | grep -G [0-9]$ | cut -c -43,44-58 | head -5
echo ""


Output should look something like:

su - mythtv

Encoder status

Encoder 3 is local on mythtv2 and is not recording.
Encoder 4 is local on mythtv2 and is not recording.
Encoder 8 is remote on mythtvfe1 (currently not connected).
Encoder 9 is remote on mythtvfe1 (currently not connected).
Encoder 10 is remote on mythtvfe1 (currently not connected).

The next recording starts in 3 hours and 39 minutes

Next five shows to be recorded:

Hardball With Chris Matthews 35 MSNBC 31 14:00-15:00
Countdown With Keith Olbermann 35 MSNBC 31 17:00-18:00
20/20 4 KOMO 31 22:00-23:00
Good Eats 65 FOODP 31 23:00-23:30
Late Show With David Letterman 7 KIRO 31 23:36-00:38

===
Obviously I have something wrong with my encoders, been playing with a vid camera which I added to a new card instead of composite on existing card, I think. I'll the cards and re-add.

===

Edit: the output from the script lost it formatting.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu