SageTV Community  

Go Back   SageTV Community > SageTV Customizations > SageTV Customizations

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-13-2009, 03:11 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,672
Arrow ComChecker for Linux/Mac Script Version

ComChecker.sh is the script only version of the ComChecker software application for Mac. This script is designed to work on Linux and Mac and should be executed as a background process. I run this command on my server to execute and leave running as user sagetv:

Code:
su -c 'nohup /opt/sagetv/scripts/comchecker.sh 2>/dev/null 1>/dev/null &' sagetv
For the default root user version run as:

Code:
nohup /opt/sagetv/scripts/comchecker.sh 2>/dev/null 1>/dev/null &
Assumes script is placed in the path as noted.

Usage:

To use this script you must have WINE installed for your distro. It is also helpful to be using the donator version of comskip if you want to scan HDPVR files. Support for comskip as it pertains to accuracy, etc., can be found here. Please edit the script in your favorite editor and adjust the values as needed. Beginning in this version, I have added the ability to specify different multipliers so that you can control how many processes run on a per file type basis. This is handy because TS file scanning is more costly than MPG file scanning.

E.g.: If you set a base number of 50 and your MPG files are set to 10, you will be able to run 5 simultaneous executions of comskip.exe.

All math is treated in whole numbers, please increase the SIMUL variable to fine tune the numbers.

Questions on usage and bug reports should be handled in this thread.

Download here.

Thanks,

B

Version .6 - 10-31-2009
Added support for nice. Per a user PM request. Thanks!
Version .5 - 9-20-2009
Added the capability to filter shows based on channel id. This requires the use of Stuckless' sagex.api plugin.
__________________
Running SageTV 7.1.9 on Arch Linux 64-bit, Java 1.7.0_25, 3 HD300 Extenders
Tuning handled by HDHR3-6CC-3X2 (Cable Card in Linux), 1 HD-PVR and lirc using the HDPVR -- Check out my blog
Comskip on Linux

Last edited by bcjenkins; 10-31-2009 at 06:34 AM.
Reply With Quote
  #2  
Old 11-04-2009, 10:11 AM
chip33az chip33az is offline
Sage User
 
Join Date: Nov 2006
Posts: 66
Thank you for writing this!

I was able to set it up and it does find the .mpg files and runs comskip on them, but it doesn't seem to be deleting the old files (edl, txt, etc).

I ran the comchecker program and it says

Looking for old files

Find: paths must precede expression: readme.txt
(along with some other items).

Any suggestions?
__________________
Server - AMD 4850e, ASUS M3A76-CM, 4GB RAM, 1.5TB drive
OS - ArchLinux - console only
Client(s) - Media MVP
Tuner(s) - 2x HVR 1600 (SD only)
Reply With Quote
  #3  
Old 11-05-2009, 10:03 AM
chip33az chip33az is offline
Sage User
 
Join Date: Nov 2006
Posts: 66
After looking at this for a bit the problem has to do with the txt extension. I really don't know why.

If I do a find for log, edl, etc, everything works. Once I put in txt it crashes.

I removed txt from the CHKEXT array and that seems to have solved it (at least for me).
__________________
Server - AMD 4850e, ASUS M3A76-CM, 4GB RAM, 1.5TB drive
OS - ArchLinux - console only
Client(s) - Media MVP
Tuner(s) - 2x HVR 1600 (SD only)
Reply With Quote
  #4  
Old 11-05-2009, 12:01 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,672
How does it crash? Is there an error?

B
__________________
Running SageTV 7.1.9 on Arch Linux 64-bit, Java 1.7.0_25, 3 HD300 Extenders
Tuning handled by HDHR3-6CC-3X2 (Cable Card in Linux), 1 HD-PVR and lirc using the HDPVR -- Check out my blog
Comskip on Linux
Reply With Quote
  #5  
Old 11-05-2009, 12:56 PM
chip33az chip33az is offline
Sage User
 
Join Date: Nov 2006
Posts: 66
It doesn't crash, but it didn't remove old files. When the program ran, it would show:
Looking for old files

Find: paths must precede expression: readme.txt
(along with some other items).
It would never delete the old files. I found on my box that if I just ran find -name *.txt, I would see the same message. If I ran find -name *.edl, it would show a listing of the files with the edl extension.

I don't know why it doesn't like the txt.
__________________
Server - AMD 4850e, ASUS M3A76-CM, 4GB RAM, 1.5TB drive
OS - ArchLinux - console only
Client(s) - Media MVP
Tuner(s) - 2x HVR 1600 (SD only)
Reply With Quote
  #6  
Old 11-05-2009, 02:12 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,672
What about
Code:
find /var/media/tv -type f -name *.txt
?

I am working on rewriting that section anyways because it was ugly. But I am still using find. Also, what happens if edl is first in the order?

B

PS find --version?

find (GNU findutils) 4.4.2
__________________
Running SageTV 7.1.9 on Arch Linux 64-bit, Java 1.7.0_25, 3 HD300 Extenders
Tuning handled by HDHR3-6CC-3X2 (Cable Card in Linux), 1 HD-PVR and lirc using the HDPVR -- Check out my blog
Comskip on Linux
Reply With Quote
  #7  
Old 11-05-2009, 07:10 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,672
CAUTION

You can test this section of code in the script to see if it solves your problems. Please copy some files to a different directory to test against.

Code:
FILE_LIST=$(find ${TVPATH[$x]} -type f | sed 's/.*\///' | cut -d '.' -f1 | uniq)
for FILE in ${FILE_LIST}
do
	if [[ ! $(find "${TVPATH[$x]}" -type f -regextype posix-awk -regex "(.*.$(echo ${EXTEN[*]}|sed 's/ /\|\.\*\./g'))" | grep "${FILE}") && "${FILE}" != "images" ]]; then
		echo "find ${TVPATH[$x]} -type f -delete -name ${FILE}.*" 
		find ${TVPATH[$x]} -type f -delete -name ${FILE}.*
	fi
done
B
__________________
Running SageTV 7.1.9 on Arch Linux 64-bit, Java 1.7.0_25, 3 HD300 Extenders
Tuning handled by HDHR3-6CC-3X2 (Cable Card in Linux), 1 HD-PVR and lirc using the HDPVR -- Check out my blog
Comskip on Linux
Reply With Quote
  #8  
Old 11-09-2009, 12:13 PM
chip33az chip33az is offline
Sage User
 
Join Date: Nov 2006
Posts: 66
I created a separate directory and placed some files in it. I modified the comchecker.sh to use your new code.

While I don't see any error messages pop up, it does say it is looking for old files, but never displays a listing of files and it never deletes anything.

I made sure to delete one .mpg file to test.
__________________
Server - AMD 4850e, ASUS M3A76-CM, 4GB RAM, 1.5TB drive
OS - ArchLinux - console only
Client(s) - Media MVP
Tuner(s) - 2x HVR 1600 (SD only)
Reply With Quote
  #9  
Old 11-09-2009, 02:47 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,672
You're right.. I thought it was working, but try this one:

Code:
FILE_LIST=$(find ${TVPATH[$x]} -type f | sed 's/.*\///' | cut -d '.' -f1 | uniq)
  for FILE in ${FILE_LIST}
    do
      if [[ -z $(find "${TVPATH[$x]}" -type f -regextype posix-awk -regex "(.*.$(echo ${KEEP[*]}|sed 's/ /\|\.\*\./g'))" | grep "${FILE}") && "${FILE}" != "images" ]]; then
        echo "Deleting file(s): ${TVPATH[$x]}/${FILE}.*"
        rm -i ${TVPATH[$x]}/${FILE}.*
      fi
  done
Change -i to -f when ready to let it go.

B
__________________
Running SageTV 7.1.9 on Arch Linux 64-bit, Java 1.7.0_25, 3 HD300 Extenders
Tuning handled by HDHR3-6CC-3X2 (Cable Card in Linux), 1 HD-PVR and lirc using the HDPVR -- Check out my blog
Comskip on Linux
Reply With Quote
  #10  
Old 04-30-2010, 02:33 PM
btf1962 btf1962 is offline
Sage User
 
Join Date: Feb 2010
Location: Rochester, NY
Posts: 22
Trouble with curl

I need a little help.

comchecker.sh seems to work for me with one exception. The curl invocations to query the AiringChannel do not work for me.

Here are the config variables I used:

Code:
# SageTV Specific feature: Check recording channel and skip if listed.
SAGETV_ENABLE=TRUE
SAGETV_SERVER=localhost
SAGETV_SERVER_PORT=8080
SAGETV_SERVER_USER=myname
SAGETV_SERVER_PASS=apassword
SAGETV_SKIP_CHAN=( WXXIDT WXXIDT2 WXXIDT3 ) # This is the channel id. eg ( NBC PBS )
Which produces the following curl invocation:

Code:
curl --user myname:apassword --silent 'http://localhost:8080/sagex/api?c=GetMediaFileForFilePath&1=/var/media/tv/TheOffice-BodyLanguage-23396-0.mpg'
Which produces the following output:

Code:
<HTML><HEAD><TITLE>404 Not found</TITLE></HEAD><BODY BGCOLOR="#F1D0F2"><H2>404 Not found</H2><HR/><ADDRESS><A HREF="http://tjws.sourceforge.net">Rogatkin's JWS based on Acme.Serve $Revision: 1.26 $</A></ADDRESS></BODY></HTML>
I've experimented by hand with a few things. Supposedly this is supposed to produce output but I get the same "404 Not Found":

Code:
curl --user myname:apassword --silent 'http://localhost:8080/sagex/api?c=GetMediaFiles&1=T'
What works successfully are commands like:

Code:
curl --user myname:apassword --silent 'http://localhost:8080/sage/Home'
I realize this uses a different interface which makes me believe my /opt/sagetv/server/webserver/realms.properties values are not set correctly.

Here's my latest (unworking) iteration of realms.properties:

Code:
# Username/passwords for protected web pages
# Format:
#     Prompt=/path,user:password
# multiple users/passwords can be given for the same prompt/path
#

# Example customsation
# The following lines protect pages that perform actions
# with different username/password, giving 2 levels of
# priviledge: read-only and read-write
#
# these must be put before the top level user/password for them
# to take effect.
#
# replace write:only with a username:password of your choice
# you can also add this username:password as a top level password (below) so that
# it can also be used for read-only actions.
#
SageTV Web Actions=/sage/Command,myname:apassword
SageTV Web Actions=/sage/AiringCommand,myname:apassword
SageTV Web Actions=/sage/ManualRecord,myname:apassword
SageTV Web Actions=/sage/ResolveConflict,myname:apassword
SageTV Web Actions=/sage/TimedRecord,myname:apassword
SageTV Web Actions=/sage/MediaFileCommand,myname:apassword
SageTV Web Actions=/sage/GlobalCommand,myname:apassword
SageTV Web Actions=/sage/EditShowInfo,myname:apassword
SageTV Web Actions=/sage/EncodeCommand,myname:apassword
SageTV Web Actions=/sage/FavoriteCommand,myname:apassword

SageTV Web Actions=/sages/api,myname:apassword
SageTV Web Actions=/sagex/api,myname:apassword

# top level user:password
SageTV Web Interface=/sage,myname:apassword
SageTV Web Interface=/sages,myname:apassword
SageTV Web Interface=/sagex,myname:apassword




# note that there is now a url defined in servlets.properties
# defined as /sagepublic/MediaFile
# this should be left unprotected to allow media players to play
# files without specifying a username/password.
From the webserver JAR files I have only unzipped the ones in italics:

Code:
JARs/nielm_getrssnews.jar
JARs/nielm_sageimdb.jar
JARs/nielm_sagemenureader.jar
JARs/nielm_sageutls.jar
JARs/nielm_sagewebserver.jar
JARs/nielm_sagexmlinfo.jar
Do I need more? Perhaps nielm_sagexmlinfo.jar?
Reply With Quote
  #11  
Old 04-30-2010, 03:01 PM
btf1962 btf1962 is offline
Sage User
 
Join Date: Feb 2010
Location: Rochester, NY
Posts: 22
Trouble with curl

OK. I fixed it by following the instructions on this page
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Utility: ComChecker for SageTV on Mac OS X bcjenkins SageTV Customizations 29 09-01-2009 07:29 PM
Utility: Linux/OS X batch beta firmware upgrade script bcjenkins SageTV Customizations 3 08-13-2008 07:08 AM
Linux and Mac OS X Comskip Users bcjenkins SageTV Customizations 0 06-19-2008 05:23 AM
SageTV Mac version choppy on Core 2 1.66 Mac Mini neilbradley SageTV Mac Edition 1 09-09-2007 08:55 AM
SageTV for Linux version 5 or version 6? ataren SageTV Linux OEM Edition 1 12-28-2006 03:04 PM


All times are GMT -6. The time now is 04:09 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.