PDA

View Full Version : Help needed to create new feature



hotbaws
20-04-2008, 11:02 PM
Howdy,

I've been interested in a new feature on the dbox for sometime now and did mention it to speedy a while back when he was looking for ideas but I've got no idea if it exists. If it does let me know!

Anyway, I'm looking to try and create it myself but I think i'll need a couple of pointers from the experts as I've only really started scripting on the dbox.

What I would like...
- Be able to type in a program name (e.g. The Simpsons) so that this is stored on the dbox permanently as a 'favourite' program.
- Now the tricky bit... I know the epg on the dbox is only up to 24 hours but I would like the dbox to automatically search the epg for all my favourite programs everyday (or every couple of hours) and schedule recordings for them.
- So all my favourite programs are recorded automatically. All I need to do is type in my favourite program initially.
- Sounds like a dodgy version of sky+ with series linking.

Any pointers would be appreciated as I have no idea on how to search the epg or schedule a recording from script. If I know how to do these then I think I'll be able get the rest of it sorted.

Comments welcome and if there is something like this out there, let me know.

Cheers.

pt-1
21-04-2008, 09:01 AM
More that 24h is possible !

Check for FreddyFrogs Post's

For the Sly+ Recording Feature I would suggest to start downloading the CVS (Guides are in here, Search Function or as usual my Helpfile) and then look at the timer features as Recording etc is already covered.

There is also a search function built in so you would need to combine both

hotbaws
21-04-2008, 10:33 AM
Thanks for the reply pt-1.

I'm aware of all the work that was kick started around the internet epg and would be intersted in trying that a somepoint when I get a chance.

For this new feature I'm talking about, I was only thinking of modifying an existing image and wouldn't be prepared at this stage to start creating my own images. So when you say start downloading the cvs, is this what you mean? Do I need to create my own image to get this to work?

Sorry if you think i'm looking for handouts but is the info available so that I can modify an image so that I can search the epg and schedule a recording using scripting? I was searching all last night and couldn't find anything useful so this is why posted to see if anyone could point me in the right direction.

Cheers.

pt-1
21-04-2008, 10:57 AM
My Helpfile and some post's in here explain how to create an Image
There is also an open Development Section in this forum

FreddyFrogs solution has nothing to do with Internet, It's up to 7 days using a modified file and the epgfilter.xml and the PVR_Epg Channel

hotbaws
21-04-2008, 11:44 AM
Thanks again pt-1. I see, I just assumed the extra epg thing was the same as the internet epg thing which has been discussed loads of times here. In that case, I might be looking at this sooner that I had thought as it doesn't need the internet.

Yes, from your help file which I have read loads of times in the past, I know how to create image in theory but I don't have the time to sit down and do that at the moment. I am intersted in this and was tempted when Gav offered to open up an image school. May be next time for me.

I don't mind doing a bit of scripting here and there on existing images as it doesn't take too long...

So my question is, can I achieve what I want through scripting alone or do I need to create an image?

Cheers.

hotbaws
21-04-2008, 11:36 PM
Howdy,

I thought I would provide an update incase anyone is interested in this new feature. As I said before, I would rather try and modify an existing image rather than create one as I've not got to that stage yet!!

I've got a basic prototype working which I think acts as a proof of concept rather than being anything useful at this point. For reference, I have executed this code on the blade trilogy image I uploaded a few days ago.

The only way I know how to search the EPG from script is by using wget to retreive the info from yweb. I also use the same technique to schedule recordings. I know there is probably a better way but I have found nothing after a couple of days searching!

As I said before, I would like to end up with a plugin which would allow me to save the names of all my favourite programs on the dbox (e.g. The Simpsons, Family Guy etc). The dbox would then automatically trawl the epg once or twice a day and schedule recordings for them... so that I can put my feet up and know all my favourite programs would be recorded automatically!!!

Anyway here is the code I have at the moment... comments welcome




#/bin/sh

# Read favourite programs from file but just use a variable for now
favprog="BBC News"

# Get all channels in bouquet 1
wget -O channellist.xml http://localhost/Y_Boxcontrol_Channellist.yhtm?bouquet=1#akt

# Extract all channel ids from channel list in bouquet 1
channelids=`sed '/javascript:do_zap/!d' channellist.xml | cut -d"'" -f2`

# Go through every channel, get the epg and find all favourite programs.
for id in $channelids; do

# Get epg for current channel
wget -O $id.txt http://localhost/control/epg?id=$id

# sleep for a second... incase wget isn't fast enough
sleep 1

# Search for favourite program and store in foundlist... format event id, start time, duration, channel id
sed -n -e "/$favprog/{;x;1!p;}" -e h $id.txt | sed "s/$/ $id/" >> foundlist.txt

done

# sleep for a couple seconds... incase wget isn't fast enough
sleep 2

# Read all favourite programs found and schedule a recording
while read line
do
# read file and get variables
start=$(echo "$line" | cut -d" " -f2)
duration=$(echo "$line" | cut -d" " -f3)
channelid=$(echo "$line" | cut -d" " -f4)
stop=`expr $start + $duration`

# Schedule a recording for favourite program
wget -O rec.htm "http://localhost/control/timer?action=new&type=5&alarm=$start&stop=$stop&announce=$start&channel_id=$channelid&rs=1"

# Schedule a channel change for favourite program
#wget -O zap.htm "http://localhost/control/timer?action=new&type=3&alarm=$start&channel_id=$channelid"

done < foundlist.txt

renwich
22-04-2008, 12:16 AM
This thread really belongs in the Development section where it may get the attention it deserves, well done for having a go m8,