Recording Service API

From DVBViewer

Jump to: navigation, search

Contents

One warning: This api is still in development and may change without warning (but most likely it will be backward compatible, because the dvbviewer uses it also).

Recordingservice API Topic

Most api calls are simple http-get calls.

[edit] Answers

All answers are xml "files" To get the timerlist:

http://[user:password@]IP[:port]/api/timerlist.html[?utf8=]

Parameter utf8 the answer will be UTF8 encoded

[edit] Version

The version of the service:

http://[user:password@]IP[:port]/api/version.html 

[edit] Status

The Status of the service:

http://[user:password@]IP[:port]/api/status.html
<status>
	<recordcount>
		0
	</recordcount>
	<clientcount>
		1
	</clientcount>
	<epgudate>
		0
	</epgudate>
	<epgbefore>
		5
	</epgbefore>
	<epgafter>
		10
	</epgafter>
	<timezone>
		60
	</timezone>
	<defafterrecord>
		0
	</defafterrecord>
	<recfolders>
		<folder size="1445946646528" free="15966986240">
			E:\Recorded TV
		</folder>
		<folder size="57404289024" free="3202850816">
			C:\Users\Public\Recorded TV
		</folder>
	</recfolders>
</status>

[edit] Recordings list

recordings list:

http://[user:password@]IP[:port]/api/recordings.html[?utf8=]

Parameter utf8 the answer will be UTF8 encoded

[edit] EPG

EPG

http://[user:password@]IP[:port]/api/epg.html?lvl=2[&channel={epgchannelID}][&start={floatDateTime}][&end={floatDateTime}]

the parameters:

EPGChannelID = (TunerType + 1)*2^48 + NID*2^32 + TID*2^16 + SID

where:

SID = Service PID

TID = Stream ID

NID = Network ID

TunerType: 0=Cable 1=Satelite 2=Terrestial 3=ATSC

It's best to get the epg in several steps (one day at a time as example), because it can be several megabytes of data.

[edit] Add a timer

How to add a timer:

A http Get request to

http://[user:password@]IP[:port]/api/timeradd.html

With the following Params:

(ord(tunertype) + 1) shl 29 + APID shl 16 + SID;
in other words
(tunertype + 1) * 536870912 + APID * 65536 + SID
tunertype =
DVB-C = 0
DVB-S = 1
DVB-T = 2
ATSC = 3
DVB-IPTV = 4
APID = Audio-PID
SID = Service-ID


[edit] Edit a timer

To edit a timer:

http://[user:password@]IP[:port]/api/timeredit.html

same parameters as adding a timer. Additional:

IDs are only valid for the process runtime of the service. Make sure you get a current timerlist before editing.


remember all string values musst be url encoded!


[edit] Delete a timer

To delete a timer:

http://[user:password@]IP[:port]/api/timerdelete.html?id=xxxx[&delrecfile=x]

With the following Params:

IDs are only valid for the process runtime of the service. Make sure you get a current timerlist before editing.


remember all string values musst be url encoded!

[edit] Clear EPG

Clear EPG:

http://[user:password@]IP[:port]/api/index.html?epg_clear=true

Just the presence of the parameter will clear the EPG. Use at your own risk.


[edit] add epg

To add epg:

a POST request to

http://[user:password@]IP[:port]/cgi-bin/EPGimport

with valid EPG XML (same format like the api epg.html function).

Attention: returns a code 302 (Moved) when no file is posted, redirecting you to EPGimport/ which then returns a 404 (not found)

Attention: This call will set a a 30 sec. standby/hibernate block is if Block Standby/Hibernate... for Web interface actions is enabled.

[edit] start task

To start a task:

a POST request to

http://[user:password@]IP[:port]/tasks.html?task=[task name]&aktion=tasks 

Attention: This call will set a a 30 sec. standby/hibernate block is if Block Standby/Hibernate... for Web interface actions is enabled.


e.g. for hibernate

http://[user:password@]IP[:port]/tasks.html?task=Hibernate&aktion=tasks 

[edit] internal task names

EPGStart Start EPG Scan

EPGStop Stop EPG Scan

Hibernate Hibernate

Standby Standby

Shutdown Shutdown

AutoTimer AutoTimer

CleanupDB Cleanup Recording DB

RefreshDB Refresh Recording DB

CleanupRefreshDB Cleanup and Refresh Recording DB

UpdateVideoDB Update Medias library DB

RebuildVideoDB Rebuild Video library DB

RebuildAudioDB Rebuild Audio library DB

RebuildPhotoDB Rebuild Photo library DB

ClearAudioStats Clear Audio library Stats

ClearRecordingStats Clear Recording Stats

ClearVideoStats Clear Video library Stats

ClearPhotoStats Clear Photo library Stats

Personal tools
Namespaces
Variants
Actions
Navigation
DVBViewer
Toolbox