forked from Saman-VDR/vdr-plugin-restfulapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPI.html
1152 lines (1030 loc) · 37.6 KB
/
API.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>RESTFULAPI Documentation</title>
<style type="text/css">
html, body {
background-color: white;
}
.blurb {
font-style: italic;
font-weight: bold;
text-align: center;
}
.center {
text-align: center;
}
.code {
background-color: #F0F0F0;
}
.modified {
background-color: #FFDDDD;
}
</style>
</head>
<body>
<div class="center">
<h1>RESTFULAPI-Plugin for VDR</h1><br />
<b>Version 0.1.3</b><br />
Copyright © 2011 yavdr-Team, Michael Eiler<br /><br />
Organization/Community: <a href="mailto:[email protected]">[email protected]</a><br />
Developer: <a href="mailto:[email protected]">[email protected]</a> or <a href="mailto:[email protected]">[email protected]</a><br />
<a href="http://www.yavdr.org">www.yavdr.org</a><br />
<a href="http://github.com/yavdr/vdr-plugin-restfulapi">www.github.com/yavdr/vdr-plugin-restfulapi</a><br />
</div>
<br />
<hr />
<h1>Table Of Contents</h1>
<ul>
<li><a href="#Preface">Preface</a>
<li><a href="#Requirements">Requirements</a>
<li><a href="#Configuration">Configuration</a>
<li><a href="#Audio">Audio</a>
<li><a href="#Channels">Channels</a>
<ul><li><a href="#ChannelGroups">Groups</a>
<li><a href="#ChannelImages">Images / Channel-Logos</a></ul>
<li><a href="#Events">Events / EPG</a>
<ul><li><a href="#EventImages">Images</a>
<li><a href="#EventSearch">Search (EPGSEARCH)</ul>
<li><a href="#Info">Info</a>
<li><a href="#Osd">Osd</a>
<li><a href="#Recordings">Recordings</a>
<ul><li><a href="#RecordingCut">Cut</a>
<li><a href="#RecordingDelete">Delete</a>
<li><a href="#RecordingsMarks">Marks</a>
<li><a href="#RecordingMove">Move</a>
<li><a href="#RecordingPlay">Play</a>
<li><a href="#RecordingRewind">Rewind</a></ul>
<li><a href="#Remote">Remote</a>
<li><a href="#Timers">Timers</a>
<ul><li><a href="#ReadingTimers">Reading/Deleting Timers</a>
<li><a href="#CreatingTimers">Creating Timers</a>
<li><a href="#UpdatingTimers">Updating Timers</a></ul>
<li><a href="#SearchTimers">SearchTimers (EPGSEARCH)</a>
<ul><li><a href="#SearchTimersCreate">Create</a>
<li><a href="#SearchTimersDelete">Delete</a>
<li><a href="#SearchTimersShow">Show</a>
<li><a href="#SearchTimersSearch">Search</a></ul>
</ul>
<hr />
<h1 class="center"><a name="Preface">Preface</a></h1>
<hr />
<br />
This plugin has been developed to offer a modern API for other developers to communicate with the VDR. <br />
The plugin supports the following outputs formats: xml, json and html.<br />
It also supports the folloing input formats: json and html.<br />
<br />
It would not exist without the help of the following people:<br />
<ul>
<li>Klaus Schmidinger: Of course because of the VDR itself. Thank you also for the nice and clean layout for the API-Documentation which I "borrowed" from your PLUGINS.html.
<li>Gerald Dachs: Thank you for the intial idea and the initial jsonapi-Plugin.
<li>Volker Richert: Thank you for fixing the UTF8-Support.
<li>Tommi Mäkitalo: Thank you for implementing the Regex-Support in cxxtools which allows RESTful web services.
<li>Holger Schvestka: Thank you for improving the package structure.
<li>All other yaVDR-Members who I haven't already mentioned, just because you are who you are and do your best to improve the VDR experience.
<li>The developers of the live and vnsisserver Plugins which helped me to learn a lot about the API of VDR.
<li>The developers of the live plugin where I borrowed parts of the epgsearch-implementation :-)
<li>Daniel Kuschny: Thank you for fixing my broken regular expressions. Will pay you a beer! :-)
<li>Keine_Ahnung@vdr-portal for the VDR 1.6 compatibility patch
</ul>
<br /><br />
<b>This document describes the API and how to use it. It contains a lot of examples for the different formats and services but there is still a lot more to discover if you simply try to make a few simple requests. </b>
<br />
<hr />
<h1 class="center"><a name="Requirements">Requirements</a></h1>
<hr />
<br />
Someone who wants to install the plugin on his/her VDR needs following applications and libraries:
<br />
<ul>
<li>VDR 1.7.18
<li>libcxxtools Rev. >= 1231, which is available as package for Ubuntu in the yavdr-PPA's
</ul>
Someone who wants to develop an application which uses this API:
<br/>
<ul>
<li>XML or JSON Parser (Depends on which format you want to use! - You can also use the html-format, but that one is more a proof for the restful concept and does not show all information!)
<li>URL Decoder or JSON Serializer (to send data to the webservice, required f.e. to create timers, searchtimers usw...)
</ul>
<hr />
<h1 class="center"><a name="Configuration">Configuration</a></h1>
<hr />
<br />
Create a new file called plugin.restfulapi.conf in /etc/vdr/plugins/ .<br />
<br />
<div class="code"><code>
#
# Command line parameters for vdr-plugin-restfulapi
#
--port=8002
--ip=0.0.0.0
--epgimages=/var/cache/vdr/epgimages
--channellogos=/usr/share/vdr/channel-logos
</code></div>
<br />
<br />
<hr />
<h1 class="center"><a name="Audio">Audio</a></h1>
<hr />
<br />
This service retrieves audio commands, sends them to VDR and returns the result:<br />
<br />
Methods: <b>POST, GET</b> (for simple requests) <br />
<br />
<b>Syntax:</b><br />
<br />
<div class="code"><code>
GET http://127.0.0.1:8002/audio.<format><br />
POST http://<ip>:<port>/audio.<format><br />
</code></div>
<br /><br />
<b>Description of the Body Parameters (POST only):</b>
<br />
<ul>
<li><format> - The requested format: json, xml or html.
<li><volume>
<ul>
<li>volume=180 // 180 absolute
<li>volume=020 // +20
<li>volume=-20 // -20
</ul>
<li><mute> - 0 (mute), 1 (unmute) or 2(toggle).
<li><track> - track number.
<li><channel> - 0 (mono left), 1 (mono right) or 2(stereo).
</ul>
<br />
<br />
<b>Example Result:</b>
<br />
<div class="code"><code>
GET http://127.0.0.1:8002/audio.xml<br />
POST http://127.0.0.1:8002/audio.xml<br />
volume=230&track=33<br /><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<audio xmlns="http://www.domain.org/restfulapi/2011/channels-xml"><br />
<volume>230</volume><br />
<mute>0</mute><br />
<tracks count="3"><br />
<track type="1" description="französisch"/><br />
<track type="2" description="ohne Audiodeskription"/><br />
<track type="33" description="Dolby Digital 5.1"/><br />
</tracks><br />
<type>33</type><br />
<description>Dolby Digital 5.1</description><br />
<channel>dd 5.1</channel><br />
</audio><br />
</code></div>
<br />
<br />
<br />
<hr />
<h1 class="center"><a name="Channels">Channels</a></h1>
<hr />
<br />
This service returns a list of channels.<br />
<br />
<b>The Request:</b>
<br />
<br />
Method: <b>GET</b><br />
<br />
Examples: <br/>
<br />
<div class="code"><code>
GET http://<ip>:<port>/channels/.<format><br />
GET http://<ip>:<port>/channels/<channelid>.<format><br />
GET http://<ip>:<port>/channels/.<format>?start=<int>&limit=<int><br />
</code></div>
<br />
<br />
<b>Description of the Parameters:</b>
<br />
<ul>
<li><format> - The requested format: json, xml or html.
<li><channelid> - Id of the requested channel.
<li>start, limit - These values are used to control the whole list. Start ist the first element you want to retrieve. Limit...
</ul>
<br />
<br />
<b>Example Result:</b>
<br />
<div class="code"><code>
GET http://127.0.0.1:8002/channels.xml?start=0&limit=1<br /><br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<channels xmlns="http://www.domain.org/restfulapi/2011/channels-xml"><br />
<channel><br />
<param name="name"<ORF1 HD</param><br />
<param name="number">1</param><br />
<param name="channel_id">C-71-71-61920</param<<br />
<param name="image">true</param><br />
<param name="group">hd</param><br />
<param name="transponder">330</param><br />
<param name="stream">C-71-71-61920.ts</param><br />
<param name="is_atsc">false</param><br />
<param name="is_cable">true</param><br />
<param name="is_sat">false</param><br />
<param name="is_terr">false</param><br />
</channel><br />
<count>1</count><br />
<total>259</total><br />
</channels>
</code></div>
<br />
<div class="code"><code>
GET http://127.0.0.1:8002/channels.json?start=0&limit=1<br /><br />
{ "channels": [<br />
{<br />
"name":"ORF1 HD",<br />
"number":1,<br />
"channel_id":"C-71-71-61920",<br />
"image":true,<br />
"group":"hd",<br />
"transponder":330,<br />
"stream":"C-71-71-61920.ts",<br />
"is_atsc":false,<br />
"is_cable":true,<br />
"is_terr":false,<br />
"is_sat":false<br />
}],<br />
"count":1,<br />
"total":259<br />
}
</code></div>
<h2><a name="ChannelGroups">Groups</a></h2>
<br />
This service will return a list containing all channel groups.<br />
<br />
<b>The Request:</b><br />
<br />
Method: <b>GET</b><br />
<br />
Examples: <br />
<br />
<div class="code"><code>
GET http://<ip>:<port>/channels/groups<br />
GET http://<ip>:<port>/channels/groups?start=<int>&limit=<int><br />
GET http://<ip>:<port>/channels.<format>?group=<group>
</code></div>
<br />
<br />
<b>Description of the Parameters</b></br>
<br />
<ul>
<li><group> - returns the channels of the requested group
</ul>
<br />
<br />
<b>Example Result:</b><br />
<br />
<div class="code"><code>
GET http://<ip>:<port>/channels/groups?start=0&limit=3<br />
<br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<groups xmlns="http://www.domain.org/restfulapi/2011/groups-xml"><br />
<group>hd</group><br />
<group>main</group><br />
<group>stuff</group><br />
<count>3</count><br />
<total>3</total><br />
</groups>
</code></div>
<br />
<div class="code"><code>
GET http://<ip>:<port>/channels/groups?start=0&limit=3<br />
<br />
{<br />
"groups":<br />
[<br />
"hd",<br />
"main",<br />
"stuff"<br />
],<br />
"count":3,<br />
"total":3<br (>
}
</code></div>
<h2><a name="ChannelImages">Images / Channel-Logos</a></h2>
<br />
This service returns the requested channel-logo.<br />
<br /> XML or JSON Parser (Depends on which format you want to use!)
URL Decoder
Method: <b>GET</b><br />
<br />
Examples: <br />
<br />
<div class="code"><code>
GET http://<ip>:<port>/channels/image/<channelid>
</code></div>
<br />
<br />
<hr />
<h1 class="center"><a name="Events">Events / EPG</a></h1>
<hr />
<br />
This service returns the epg information.<br />
<br />
Method: <b>GET</b><br />
<br />
Examples: <br />
<br />
<div class="code"><code>
GET http://<ip>:<port>/events/<channelid>.<format>?timespan=<timespan><br />
GET http://<ip>:<port>/events/<channelid>/<eventid>.<format><br />
GET http://<ip>:<port>/events/<channelid>.<format>?timespan=<timespan><br />
GET http://<ip>:<port>/events/<channelid>.<format>?timespan=<timespan>&from=<from>&start=<int>&limit=<int>
</code></div>
<br />
<br />
<b>Description of the Parameters:</b><br />
<br />
<ul>
<li><format> - The requested format: json, xml or html.
<li><channelid> - (optional) id of the channel, if not set the plugin will return the whole epg sorted by your channel list
<li><timespan> - the timespan from which you want to know the event-details, if set to 0 - all events in the future will be returned
<li><from> - (optional) time in the future when the requested events should end/start (default-value: now)
<li><eventid> - (optional) if you only want the details of a specific event
<li><chevents> - (optional) the count of events for each channel
<li><chfrom> - (optional) start number of the channel, from where events will be returned
<li><chto> - (optional) end number of the channel, through events will be returned
<li><only_count> - (optional) if you just want to know the amount of available epg items
</ul>
<br />
<br />
<b>Example Result:</b><br />
<br />
<div class="code"><code>
GET http://<ip>:<port>/events/C-1-1011-11110/3600.xml?start=0&limit=1<br />
<br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<events xmlns="http://www.domain.org/restfulapi/2011/events-xml"><br />
<event><br />
<param name="id">51514</param><br />
<param name="title">Eine Serie</param><br />
<param name="short_text">Der Episodentitel</param><br />
<param name="description">Die Beschreibung</param><br />
<param name="channel">C-1-1011-11110</param><br />
<param name="channel_name">ZDF HD</param><br />
<param name="start_time">1308845100</param><br />
<param name="duration">3300</param><br />
<param name="images">1</param><br />
<param name="components">
<component stream="5" type="11" language="deu" description="H.264/AVC high definition Video, 16:9 aspect ratio," />
<component stream="2" type="3" language="deu" description="stereo deutsch" />
<component stream="2" type="3" language="eng" description="stereo englisch" />
<component stream="2" type="5" language="deu" description="Dolby Digital 2.0" />
</param>
<param name="timer_exists">true</param>
<param name="timer_active">true</param>
<param name="timer_id">C-71-71-61920:0:1315173600:2100:2300</param>
</event><br />
<count>1</count><br />
<total>236</total><br />
</events>
</code></div>
<br />
<div class="code"><code>
GET http://<ip>:<port>/events/C-1-1011-11110/3600.json?start=0&limit=1<br />
<br />
{"events":[{<br />
"id":51514,<br />
"title":"Eine Serie",<br />
"short_text":"Der Episodentitel",<br />
"description":"Die Beschreibung",<br />
"start_time":1308845100,<br />
"channel":"C-1-1011-11110",<br />
"channel_name":"ZDF HD",<br />
"duration":3300, <br />
"images":3,<br />
"count":1,<br />
"timer_exists":true,<br />
"timer_active":true,<br />
"timer_id":"C-71-71-61920:0:1315173600:2100:2300",<br />
"components":[<br />
{"stream":5, "type":11, "language":"deu", "description":"H.264\/AVC high definition Video, 16:9 aspect ratio,"},<br />
{"stream":2,"type":3,"language":"deu","description":"stereo deutsch"},<br />
{"stream":2,"type":3,"language":"eng","description":"stereo englisch"},<br />
{"stream":2,"type":5,"language":"deu","description":"Dolby Digital 2.0"}],<br />
"total":236}
</code></div>
<br />
<h2><a name="EventImages">Images</a></h2>
<br />
This service returns the requested epg image.<br />
<br />
Method: <b>GET</b><br />
<br />
Examples: <br />
<br />
<div class="code"><code>
GET http://<ip>:<port>/events/image/<eventid>/<imagenumber>
</code></div>
<br />
<br />
<b>Description of the Parameters:</b><br />
<br />
<ul>
<li><eventid> - Id of the event
<li><imagenumber> - the number of the image, in the above mentioned examples it would be 0,1 or 2
</ul>
<h2><a name="EventSearch">Search</a></h2>
This service allows you to search for events.<br />
<br />
<b>The Request:</b>
<br />
<br />
Method: <b>POST</b><br />
<br />
<b>Example URL:</b> <br />
<br />
<div class="code"><code>
POST http://<ip>:<port>/events/search.<format>?limit=5&start=0;
</code></div>
<br />
<b>HTTP-Body-Parameters:</b>
<br />
<ul>
<li>query - (required)
<li>mode - (required) 0=phrase, 1=and, 2=or, 3=regex
<li>channelid - (optional) if id invalid, the plugin will search on every channel
<li>use_title - (optional, default) search in the title
<li>use_subtitle - (optional)
<li>use_description - (optional)
</ul>
<br />
<b>Example:</b>
<div class="code"><code>
{"query":"Asterix", "mode":0, "channelid":0,"use_title":true}
</code></div>
<br />
<br />
<hr />
<h1 class="center"><a name="Info">Info</a></h1>
<hr />
General Information about the plugin and vdr.<br />
<br />
<b>Examples:</b><br />
<br />
<div class="code"><code>
GET http://<ip>:<port>/info.<format>
</code></div>
<br />
<br />
<b>Description of the Parameters:</b>
<br />
<ul>
<li><format> - The requested format: json, xml or html.
</ul>
<br />
<b>Example Results:</b><br />
<br />
<div class="code"><code>
<br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<info xmlns="http://www.domain.org/restfulapi/2011/info-xml"><br />
<version>0.0.1</version><br />
<time>1372855585</time><br />
<services><br />
<service path="/audio" version="1" internal="true" /><br />
<service path="/channels" version="1" internal="true" /><br />
<service path="/channels/groups" version="1" internal="true" /><br />
<service path="/channels/image" version="1" internal="true" /><br />
<service path="/events" version="1" internal="true" /><br />
<service path="/events/image" version="1" internal="true" /><br />
<service path="/events/search" version="1" internal="false" /><br />
<service path="/info" version="1" internal="true" /><br />
<service path="/osd" version="1" internal="true" /><br />
<service path="/recordings" version="1" internal="true" /><br />
<service path="/recordings/cut" version="1" internal="true" /><br />
<service path="/recordings/marks" version="1" internal="true" /><br />
<service path="/recordings/play" version="1" internal="true" /><br />
<service path="/recordings/rewind" version="1" internal="true" /><br />
<service path="/remote" version="1" internal="true" /><br />
<service path="/searchtimers" version="1" internal="false" /><br />
<service path="/timers" version="1" internal="true" /><br />
</services><br />
<channel>S19.2E-1-1019-10302</channel><br />
<channel_name>arte HD</channel_name><br />
<channel_number>4</channel_number><br />
<eventid>64734</eventid><br />
<start_time>1372853100</start_time><br />
<duration>5700</duration><br />
<title>Die schönsten Augen von Portugal</title><br />
<recording>false</recording><br />
<diskspace>1405401MB 156536MB 88%</diskspace><br />
<vdr><br />
<version>2.0.2</version><br />
<plugins><br />
<plugin name="softhddevice" version="0.6.0" /><br />
<plugin name="dbus2vdr" version="12e" /><br />
<plugin name="skinnopacity" version="0.1.2" /><br />
<plugin name="play" version="0.0.14" /><br />
<plugin name="menuorg" version="0.5.1" /><br />
<plugin name="channellists" version="0.0.5" /><br />
<plugin name="markad" version="0.1.5pre" /><br />
<plugin name="tvguide" version="0.0.5" /><br />
<plugin name="music" version="0.9.9-dev2" /><br />
<plugin name="epgsearch" version="1.0.1.beta5" /><br />
<plugin name="yaepghd" version="0.0.5_pre1" /><br />
<plugin name="extrecmenu" version="1.2.2" /><br />
<plugin name="streamdev-server" version="0.6.0-git" /><br />
<plugin name="cinebars" version="0.1.0" /><br />
<plugin name="conflictcheckonly" version="0.0.1" /><br />
<plugin name="live" version="0.3.0" /><br />
<plugin name="osdserver" version="0.1.3" /><br />
<plugin name="quickepgsearch" version="0.0.1" /><br />
<plugin name="restfulapi" version="0.1.2" /><br />
<plugin name="sleeptimer" version="0.8.3-201205011650dev" /><br />
<plugin name="vnsiserver3" version="0.9.1" /><br />
<plugin name="femon" version="2.0.0" /><br />
<plugin name="epgsearchonly" version="0.0.1" /><br />
</plugins><br />
</vdr><br />
</info><br />
</code></div>
<br />
Instead of the channel it can also contain the currently playing video file:<br />
<br />
<div class="code"><code>
<video name="Asterix in Amerika">/var/lib/video.00/Asterix_in_Amerika/2011-06-19.12.40.1-0.rec</video>
</code></div>
<br />
<br />
<hr />
<h1 class="center"><a name="Osd">Osd</a></h1>
<hr />
OSD<br />
<br />
<b>Examples:</b><br />
<br />
<div class="code"><code>
GET http://<ip>:<port>/osd.<format>
</code></div>
<br />
<b>Example Results:</b><br />
<br />
<div class="code"><code>
{"TextOsd":{"type":"TextOsd","title":"VDR - Disk 68% - 57:53 free","message":"","red":"","green":"Audio","yellow":"","blue":"Stop","items":[{"content":" 1 Schedule","is_selected":true},{"content":" 2 Channels","is_selected":false},{"content":" 3 Timers","is_selected":false},{"content":" 4 Recordings","is_selected":false},{"content":" 5 Search","is_selected":false},{"content":" 6 Media Player","is_selected":false},{"content":" 7 Program guide","is_selected":false},{"content":" 8 Quick search","is_selected":false},{"content":" 9 Timer conflicts","is_selected":false},{"content":" 10 Setup","is_selected":false},{"content":" 11 Commands","is_selected":false},{"content":" Stop replaying","is_selected":false}]}}
</code></div>
<br />
<br />
<div class="code"><code>
{"ProgrammeOsd":{"present_time":1311710264,"present_title":"Der letzte Bulle","present_subtitle":"Ich hab sie alle gehabt","following_time":1311713161,"following_title":"direkt - das magazin","following_subtitle":""}}
</code></div>
<br />
<br />
<hr />
<h1 class="center"><a name="Recordings">Recordings</a></h1>
<hr />
<br />
This service can delete recordings and can also return all the recordings as a list.<br />
<br />
<b>The Request:</b>
<br />
<br />
Method: <b>GET, DELETE</b><br />
<br />
Examples: <br/>
<br />
<div class="code"><code>
GET http://<ip>:<port>/recordings/.<format><br />
GET http://<ip>:<port>/recordings/<recordingnumber>.<format>?marks=true<br />
DELETE http://<ip>:<port>/recordings/<number>
</code></div>
<br />
<br />
<b>Description of the Parameters:</b>
<br />
<ul>
<li><format> - The requested format: json, xml or html.
<li><number> - The number of the recording which you want to delete. (The first recordings has the number 0.)
<li><recordingnumber> - The number of the recording you want to retrieve.
<li>marks=true - add the cutting marks by reading the marks file from the recording directory
<li>start, limit - These values are used to control the whole list. Start ist the first element you want to retrieve. Limit...
</ul>
<br />
<br />
<b>Example Result:</b>
<br />
<div class="code"><code>
GET http://127.0.0.1:8002/recordings.xml?start=0&limit=1<br />
<br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<recordings xmlns="http://www.domain.org/restfulapi/2011/recordings-xml"><br />
<recording><br />
<param name="number">0</param><br />
<param name="name">Asterix in Amerika</param><br />
<param name="filename">/var/lib/video.00/Asterix_in_Amerika/2011-06-19.12.40.1-0.rec</param><br />
<param name="is_new">false</param><br />
<param name="is_edited">false</param><br />
<param name="is_pes_recording">false</param><br />
<param name="duration">-1</param><br />
<param name="frames_per_second">50</param><br />
<param name="marks"><0:03:17.10><1:43:07.24></param><br/>
<param name="event_title">Asterix in Amerika</param><br />
<param name="event_short_text"></param><br />
<param name="event_description">(Zeichentrickfilm, DEU 1994)</param><br />
<param name="event_start_time">1308480705</param><br />
<param name="event_duration">4611</param><br />
</recording><br />
<count>2</count><total>2</total><br />
</recordings>
</code></div>
<br />
<div class="code"><code>
GET http://127.0.0.1:8002/recordings.json?start=0&limit=1&marks=true<br />
<br />
{"recordings":[{<br />
"number":0,<br />
"name":"Asterix in Amerika",<br />
"file_name":"\/var\/lib\/video.00\/Asterix_in_Amerika\/2011-06-19.12.40.1-0.rec",<br />
"is_new":false,<br />
"is_edited":false,<br />
"is_pes_recording":false,<br />
"duration":-1,<br />
"frames_per_second":50,<br />
"marks":["0:03:17.10", "1:43:07.24"],<br />
"event_title":"Asterix in Amerika",<br />
"event_short_text":"",<br />
"event_description":"(Zeichentrickfilm, DEU 1994)",<br />
"event_start_time":1308480705,<br />
"event_duration":4611<br />
}],"count":1,"total":2}
</code></div>
<br />
<br />
<h2><a name="RecordingCut">Cut</a></h2>
This service tells your VDR to cut a recording or can tell the client if the vdr cutter is currently cutting a recording:<br />
<br />
Method: <b>GET, POST</b><br />
<br />
Examples: <br/>
<br />
<div class="code"><code>
POST http://<ip>:<port>/recordings/cut/<recordingnumber> # do it! (cut the recording)<br />
GET http://<ip>:<port>/recordings/cut.<format> # this will return the status of the VDR Cutter
</code></div>
<br />
<br />
<h2><a name="RecordingDelete">Delete</a></h2>
This service can delete recordings by filename.<br />
<br />
Method: <b>POST and DELETE</b><br />
<br />
Examples: <br/>
<br />
<div class="code"><code>
POST http://<ip>:<port>/recordings/delete<br />
DELETE http://<ip>:<port>/recordings/delete<br />
</code></div>
<br />
<b>Required Body Parameters:</b><br />
<ul>
<li>file - source path of the recording (use an url-encoder for this text if you use special characters)
</ul>
<br />
<div class="code"><code>
file=/var/lib/video.00/Asterix_in_Amerika/2011-06-19.12.40.1-0.rec<br />
</code></div>
<br />
<br />
<h2><a name="RecordingsMarks">Marks</a></h2>
This service can save and delete marks. To retrieve them use the parameter "marks=true" in the request url for the recordings.<br />
<br />
<b>Delete Cutting Marks: </b><br />
<br />
Method: <b>DELETE</b><br />
<br />
Examples: <br />
<br />
<div class="code"><code>
DELETE http://<ip>:<port>/recordings/marks/<recordingnumber>
</code></div>
<br />
<b>Create new Cutting Marks: </b><br />
<br />
Method: <b>POST</b><br />
<br />
Examples: <br />
<br />
<div class="code"><code>
POST http://<ip>:<port>/recordings/marks/<recordingnumber>
</code></div>
<br />
<br />
Example Body-Content (required, Only JSON supported):<br />
<br />
<div class="code"><code>
{'marks':['0:02:18.10','0:34:08.24']}
</code></div>
<br />
<br />
<h2><a name="RecordingMove">Move</a></h2>
This service can move or copy recordings by filename.<br />
<br />
Method: <b>POST</b><br />
<br />
Examples: <br/>
<br />
<div class="code"><code>
POST http://<ip>:<port>/recordings/delete<br />
</code></div>
<br />
<b>Required Body Parameters:</b><br />
<ul>
<li>source - source path of the recording (use an url-encoder for this text if you use special characters)
<li>target - relative path of the recording.
</ul>
<br />
<div class="code"><code>
source=/var/lib/video.00/Asterix_in_Amerika/2011-06-19.12.40.1-0.rec<br />
target=Movies/Asterix_in_Amerika<br />
copy_only=false
</code></div>
<br />
<br />
<h2><a name="RecordingPlay">Play</a></h2>
This service tells your VDR to play a recording:<br />
<br />
Method: <b>POST</b><br />
<br />
Examples: <br/>
<br />
<div class="code"><code>
POST http://<ip>:<port>/recordings/play/<number>
</code></div>
<br />
<br />
<b>Description of the Parameters:</b>
<br />
<ul>
<li><number> - The number of the recording you want to play (POST).
</ul>
<br />
<br />
<h2><a name="RecordingRewind">Rewind</a></h2>
This service tells your VDR to play a recording from the beginning:<br />
<br />
Method: <b>POST</b><br />
<br />
Examples: <br/>
<br />
<div class="code"><code>
POST http://<ip>:<port>/recordings/rewind/<number>
</code></div>
<br />
<br />
<b>Description of the Parameters:</b>
<br />
<ul>
<li><number> - The number of the recording you want to rewind (POST).
</ul>
<br />
<br />
<hr />
<h1 class="center"><a name="Remote">Remote</a></h1>
<hr />
<br />
This service retrieves remote commands and sends them to VDR:<br />
<br />
Method: <b>POST</b><br />
<br />
<b>Syntax:</b><br />
<br />
<div class="code"><code>
POST http://<ip>:<port>/remote/<key><br />
POST http://<ip>:<port>/remote/switch/<channelid>
</code></div>
<br />
The parameter <key> can be set to the following remote control commands:<br /><br />
Up, Down, Menu, Ok, Back, Left, Right, Red, Green, Yellow, Blue, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, Info, Play, Pause, Stop, Record, FastFwd, FastRew, Next, Prev, Power, ChanUp, ChanDn, ChanPrev, VolUp, VolDn, Mute, Audio, Subtitles, Schedule, Channels, Timers, Recordings, Setup, Commands, User0, User1, User2, User3, User4, User5, User6, User7, User8, User9, None, Kbd<br />
<br />
The second address allows to directly switch to a specific channel.
<br />
<br />
<hr />
<h1 class="center"><a name="Timers">Timers</a></h1>
<hr />
<br />
<h2><a name="ReadingTimers">Reading/Deleting Timers</a></h2>
<br />
This service returns a list of timers.<br />
<br />
<b>The Request:</b>
<br />
<br />
Method: <b>GET, DELETE</b><br />
<br />
Examples: <br/>
<br />
<div class="code"><code>
GET http://<ip>:<port>/timers.<format><br />
GET http://<ip>:<port>/timers/<timerid>.<format><br />
GET http://<ip>:<port>/timers.<format>?start=<int>&limit=<int><br />
DELETE http://<ip>:<port>/timers/<timerid>
</code></div>
<br />
<br />
<b>Description of the Parameters:</b>
<br />
<ul>
<li><format> - The requested format: json, xml or html.
<li><timerid> - Id of the timer if you want to delete one.
<li>start, limit - These values are used to control the whole list. Start ist the first element you want to retrieve. Limit...
</ul>
<br />
<br />
<b>Example Result:</b>
<br />
<div class="code"><code>
GET http://127.0.0.1:8002/timers.xml?start=0&limit=1<br />
<br />
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><br />
<timers xmlns="http://www.domain.org/restfulapi/2011/timers-xml"><br />
<timer><br />
<param name="id">C-71-71-61920:0:1309039200:2013:2200</param><br />
<param name="start">2013</param><br />
<param name="stop">2200</param><br />
<param name="start_timestamp">2011-12-24 19:00:00</param>
<param name="stop_timestamp">2011-12-24 20:00:00</param>
<param name="priority">50</param><br />
<param name="lifetime">99</param><br />
<param name="event_id">27312</param><br />
<param name="weekdays">-------</param><br />
<param name="day">2011-06-26</param><br />
<param name="channel">C-71-71-61920</param><br />
<param name="is_recording">false</param><br />
<param name="is_pending">false>/param><br />
<param name="filename">Mad Money>/param><br />
<param name="channel_name">ORF1 HD>/param><br />
<param name="is_active">true>/param><br />
</timer><br />
<count>1</count><total>2</total><br />
</timers>
</code></div>
<br />
<div class="code"><code>
GET http://127.0.0.1:8002/timers.json?start=0&limit=1<br />
<br />
</code></div>
<br />
<h2><a name="CreatingTimers">Creating Timers</a></h2>
<br />
This service can create new timers.<br />
<br />
Method: <b>POST</b><br />
<br />
Example:<br />
<br />
<div class="code"><code>
POST http:/<ip>:<ip>/timers
</code></div>
<br />
<b>Required Body Parameters:</b><br />
<ul>
<li>flags - set it to 1 for an active timer
<li>file - name of the recording (use an url-encoder for this text if you special characters)
<li>stop - the time when the recording should be start - in the 24 hour system, f.e. 2015 means quarter past ten in the evening
<li>start - the time when the recording sholud be stoped, f.e. 2230 (half past ten in the evening)
<li>day - YYYY-MM-DD, f.e. 2011-12-24 -> christmas :-)