Any plans to add a CMD feature? It's already possible to run commands via RCremap, but with a native feature in this api it would be a lot more flexible.
Security would be a concern of course, so maybe a list with allowed commands?
[API] SamyGO web API
Re: [API] SamyGO web API
Hi, how to instal web api in model serie B?
Re: [API] SamyGO web API
On my TV, i get a garbled BMP screenshot when using web API. After some troubleshooting using libscreenshot.so, I found that in order to get a non-garbled image using libScreenShot.so I have to use:
Modifying samygo-web-apt.cgi to the below just resulted in an internal server error 500:
I assume this is because the rest of the code is expecting a BMP but is getting a JPG...
Is there a way to trigger the ALT mode when retrieving the screenshot via the web interface?
Code: Select all
samyGOso -d -A -B -l /mnt/opt/privateer/usr/libso/libScreenShot.so ALT
Code: Select all
if(getLock()){
$exec=`$SAMYGOSO -d -A -B -l $LIBSDIR/libScreenShot.so PATH:/dtv ALT`;
Is there a way to trigger the ALT mode when retrieving the screenshot via the web interface?
Re: [API] SamyGO web API
After some trial and error I have gotten ALT (.jpg) screenshots working.
For anyone else looking to do the same, I modified the 'SNAPSHOT' section of samygo-web-api.cgi as per below:
Disclaimer: It worked on my TV, however I know nothing about code, so make changes at your own risk...
*edit: have added comments in the code (comments ending in -shmergin) to explain what I have changed, hope it helps someone.
For anyone else looking to do the same, I modified the 'SNAPSHOT' section of samygo-web-api.cgi as per below:
Code: Select all
case 'SNAPSHOT':
error_log("Processing SNAPSHOT");
//see if TV is on or off by checking /dtv/tvIsSleeping
$file="";
if(! file_exists("/dtv/tvIsSleeping")){
#TV is on. Get a list of existing screenshots
#changed from .bmp to .jpg, as ALT captures to .jpg by default - shmergin
$initialFiles = glob("/dtv/*.jpg");
#take the screenshot
if(getLock()){
#changed injection flag from -t to -A, added ALT - shmergin
$exec=`$SAMYGOSO -d -A -B -l $LIBSDIR/libScreenShot.so PATH:/dtv ALT`;
sleep(1);
releaseLock();
#We need to find out the filename
#changed from .bmp to .jpg, as ALT captures to .jpg by default - shmergin
$currentFiles = glob("/dtv/*.jpg");
foreach ($currentFiles as $filename){
if(! array_key_exists($filename, $initialFiles)){
#this looks like a new file. Convert it to jpeg
#commented out conversion, as we are now dealing with .jpg natively - shmergin
#$exec=`$BIN/cjpeg -q 95 $filename > /dtv/screenshot.jpg`;
#we are no longer converting the .bmp to screenshot.jpg, so we have to rename the existing .jpg file from its current name to screenshot.jpg - shmergin
rename($filename, "/dtv/screenshot.jpg");
#remove the bmp file
#commented out as there is no .bmp to remove - shmergin
#unlink("$filename");
$file="/dtv/screenshot.jpg";
break;
}
}
}
*edit: have added comments in the code (comments ending in -shmergin) to explain what I have changed, hope it helps someone.