Jump to content

Recording Service API


brutus

Recommended Posts

in der Wiki steht leider nix : Kann ich via addtimer auch die Vorlauf und Nachlaufzeiten setzen ? Bisher addiere ich diese zu der Start und Stopzeit - mir wäre aber lieber, wenn ich diese einzeln übergeben könnte.

 

Danke !

Georg

Link to comment
  • 2 months later...

Hallo,

 

kann mir noch einmal jemand kurz die IDs in der Timerlist erläutern? ;)

Es gibt insgesamt 3 IDs:


  •  
  • Attribut "ID" im Element "Timer": Deckt sich anscheinend mit dem Element "GUID"? Diese GUID sollte eindeutig sein, auch über einen Restart des Services hinweg, richtig?
  • Element "ID" im Element "Timer": Diese ID kann sich durch Ändern des Timers und Neustart des Services ändern. Ist das richtig?
     

 

Danke,

Till

Link to comment
  • 2 weeks later...

Sorry ich habe im moment so einige baustellen, da ist diese frage leider an mir vorbei gegangen. :/

 

Das Timer Attribute ID ist tatsächlich die guid für einen timer. Die ändert sich nicht und ist für spätere bzw externe zwecke gedacht.

Der Node "ID" ist die ID, die den timer zum Zeitpunkt der abfrage identifiziert. Diese ID wird für die anderen timerfunktionen (löschen/ändern) benötigt, sie ist nur für die laufzeit des RS eindeutig.

Link to comment
  • 4 weeks later...
  • 1 month later...

Hallo,

 

einige Seite zurück hier im Threat wurde geschrieben, dass es "bald" möglich sein würde, die Channels vom RS zu beziehen. Hat sich diesbezüglich schon etwas getan?

Im Wiki konnte ich nicht dazu finden. Währe ziemlich cool :)

 

Gruß

strgalt

Link to comment

/api/getchannelsdat.html

damit bekommst du das dat File.

Die Struktur des DAT Files kann im Mitgliederbereich heruntergeladen werden.

Hier mal ein Java/Android channelDat Parser:

Parser

Link to comment

Nunja die API ist noch in entwicklung und es ist problematisch veröffentlichte Funktionen wieder zu ändern.

/api/getchannelsdat.html wurde auch "gewiresharkt" ;)

 

Dies Kommunkation zwischen DVBV und RS funktioniert auch über die web api.

Also die dort verwendete Funktionen könnte man auch per wireshark auslesen.

 

Ist nicht optimal aber immerhin eine Möglichkeit.

Link to comment

Du könntest mit gutem Beispiel vorangehen und es dort eintragen ;-)

 

Favoriten kann man auch noch abrufen weiss ich gerade aber nicht auswendig....

 

war glaube ich getFavourites.html oder so ähnlich....

Link to comment

in der Tat würde ich mich bereit erklären das einzutragen. Darf das denn jeder?

Und wie wäre es, wenn wir ersteinmal ein paar undokumentierte Funktionen sammeln ?

 

Gruß

strgalt

Link to comment

Im Wiki kann generell jeder was eintragen (auch ohne sich da einzuloggen).

Wer da mehr machen möchte sollte sich da anmelden. Das macht das kontrollieren der Änderungen einfacher und wer angemeldet ist muss nicht jedes mal ein CAPTCHA eingeben und man kann z.B. Bilder hochladen.

 

Inoffiziellen Schnittellen sollte aber am besten als solche kennzeichnen. Damit jeder weiß der die nutzt auf was er sich da einlässt.

Also das die sich ohne Ankündigung von einer Version auf die nächste ändern können.

Link to comment

in der Tat würde ich mich bereit erklären das einzutragen. Darf das denn jeder?

Und wie wäre es, wenn wir ersteinmal ein paar undokumentierte Funktionen sammeln ?

 

Gruß

strgalt

 

Also wenn mal jmd sich mit wireshark bemühen könnte wäre das nett :-)

 

Ich habs mal probiert, aber irgendwie konnte ich mit den Infos nix anfangen...

 

vllt funktionjiert wireshark auch nicht richtig mit Client und Server auf einer Kiste, jedenfalls konnte ich keine URLs in den Wireshark Daten erkennen...

 

Hätte mich mal interessiert was man noch alles so abrufen kann....

 

Vor allem ob man die epg.dat auch abrufen kann, die ist detulich Schlanker als das komplette EPG als xml abzurufen und dann zu parsen.

Link to comment

Also gut, dann werd ich mich da mal anmelden und Eintragungen vornehmen. Aber es wäre schon cool, wenn noch ein paar Funktionen hinzukommen für den "Inoffizielle Funktionen"- Bereich :)

 

Gruß

strgalt

Link to comment
  • 1 month later...

Hätte noch eine Frage zu den Channels:

 

in Browser gibt es ein Treeview wo die Kanäle gruppiert werden.

Also zb. ARD/ZDF darunter dann die einzelnen Kanäle,Private darunter dann Sat1,Pro7, usw.

Kann ich das anhand der getchannelsdat nachbilden? oder gibt es da andere Dienste?

Link to comment

Hätte noch eine Frage zu den Channels:

 

in Browser gibt es ein Treeview wo die Kanäle gruppiert werden.

Also zb. ARD/ZDF darunter dann die einzelnen Kanäle,Private darunter dann Sat1,Pro7, usw.

Kann ich das anhand der getchannelsdat nachbilden? oder gibt es da andere Dienste?

 

Guckst du hier....

Link to comment
  • 3 months later...

in der Wiki steht leider nix : Kann ich via addtimer auch die Vorlauf und Nachlaufzeiten setzen ? Bisher addiere ich diese zu der Start und Stopzeit - mir wäre aber lieber, wenn ich diese einzeln übergeben könnte.

 

Danke !

Georg

 

Hätte dieselbe Frage, habs einfach mal per epgBefore und epgAfter probiert, aber das scheint wohl nicht zu funktionieren.

 

Geht das irgendwie?

Edited by VinoRosso
Link to comment
  • 4 months later...

Habe eine Frage zu der /api/recordings.html?utf8=

 

Hier bekomme ich eine Auflistung aller Aufnahmen.

Im Browser bekomme ich auch so eine Auflistung alle Aufnahmen, hier gibt es aber mehr Infos u.a ein Vorschau Bild : /thumbnails/video/259436791_SM.jpg
Wie komme ich an das Bild und wie setzt sich die ID 259436791_SM zusammen?

Link to comment
  • 3 months later...

It seems RecId only exist in the /api/recordings.html document and nowhere else.

How to retrieve the RecId number when only having the filename. Is it possible to get it by querying the API? If so how?

D:\TV\Recording Service\20130710_15-09-04_Kanal 5_The middle - S04E10 24.ts

The RecId number for the recording is 1768, which I can see by bringing up the whole database, but I would like to automate the retrieval by script.

 

If having RecId it gets very manageable scripting if retrieving only the node for that recording. Next step will then be:

/api/recordings.html?images=1&id=1768

I can then get the image filename easier, which is the very thing I'm after.

Link to comment

I take it, since nobody replied to my question, that the RecId can't be retrieved from anywhere besides calling up the .../api/recordings.html and look it up either manually or parsing the whole database of 1775 RecIds and prey you find the correct one. The addition of id=[RecId] parameter for recordings.html in the API was great, since it gives me the opportunity to let RS API do most of the parsing for me, by bringing up just that exact recording node. That's a tiny node to download to your script compared to if downloading thousands of nodes and load it into your script. The string to parse gets very timeconsuming and most script languages starts complaining if XML contains too many nodes or lines.

 

The only problem with it is there's no clear way to retrieve the id=[RecId], besides internally for RS, and that fact makes having the new parameter in the first place useless. The RecId should be possible to be retrieved from either .../api/recordings.html for example by query the filename (which can of course be a bit problematic if filename isnt uinque). The best possible way to get the RecId would be directly from a placeholder {REC_ID} used as a parameter in an after recording task. Then at first we can truly utilize the id=[RecId] parameter, which would be a dream for a scripter.

 

Man oh man, "The Great One" is truly missed. Feels lonely in here, when there's nobody to turn to for answers. He really had total knowledge about every angle of this software :(

Edited by majstang
Link to comment

The best possible way to get the RecId would be directly from a placeholder {REC_ID} used as a parameter in an after recording task. Then at first we can truly utilize the id=[RecId] parameter, which would be a dream for a scripter.

I agree and your problem is recognized.

Link to comment
  • 3 months later...

Hallo Zusammen,

 

 

eine kurze Frage bzgl. EPG Abfragen. Ist es eigentlich möglich über die API eine Anfrage mit Suchwörtern zu stellen und dann ein gefiltertes Ergebnis aus den EPG Daten zu bekommen? Ich interessiere mich deswegen dafür da ich seit kurzen auf Android umgeschwenkt bin und hier eine sehr hübsche App von VinnoRosso gebaut wurde. Eine EPG-SUche gibt es allerdings nicht von daher hätte mich das interessiert. In der Iphone App gibt es so etwas ich weiß allerdings nicht wie Markus das umgesetzt hat - nach seinen Aussagen mit einem kleinen Trick :-)

 

Grüße

 

Alex

Link to comment
  • 1 month later...

How is the the Channel-ID in timerlist.html or favorites.xml calculated?

I have tried: (found here: http://en.DVBViewer.tv/wiki/Recording_Service_API)

my $channelID = (($tunerType + 1) * 536870912) + ($audioPID * 65536) + $serviceID; 

I have also tried: (found here: http://de.DVBViewer.tv/wiki/Kommandoparameter#-c:SenderID)

my $channelID = $serviceID + ($audioPID + (2**16)) + (($tunerType + 1) + (2**29)) + ($transportStreamID * (2**32)) + (($orbitalPosition * 10) * (2**48)) + (1 * (2**61)); 

The first way seams to work for adding timers with timeradd.html. but since the same Channel-ID is not used by timerlist.html, this makes it very hard to verify if the timer was successfully added..

 

here is a perl script I use to get the channelID: http://pastebin.com/rTKGMUgV

this is not a well written script. is just gets the first channel in the list and prints some info about that channel.

Link to comment

The 2nd should be the same as the Channel ID within the EPGEvent block plus |Channel name. In my example its

2359890659700053125|Animax. The pipe sign | is just a delimiter. In perl is something like

 

($id, $channelname) = split /|/, $channel_id_from_xml;

 

You can search for this ID and then compare date and starttime to be sure.

<Timers>
−
<Timer Type="1" ID="{37A69A54-49CE-4D8F-B9A4-CC66EEF6835A}" Enabled="-1" Priority="50" Charset="0" Date="19.12.2013" Start="12:20:00" Dur="35" End="12:55:00" PreEPG="5" PostEPG="10" Action="0" EPGEventID="5979">
<Descr>Dragon Ball GT</Descr>
<Options AdjustPAT="-1" AllAudio="-1" DVBSubs="-1"/>
<Format>2</Format>
<Folder>Auto</Folder>
<NameScheme>%year-%date_%time_%station_%name</NameScheme>
<Source>Web</Source>
<Channel ID="2359890659700053125|Animax"/>
<Executeable>-1</Executeable>
<Recording>0</Recording>
<ID>0</ID>
<GUID>{37A69A54-49CE-4D8F-B9A4-CC66EEF6835A}</GUID>
</Timer>
</Timers>
Link to comment

Thanks for the reply :original:

 

Then I suspect there is something else wrong with my script..

 

because the channel-id I get from the 2nd formel is 2440951140305670656 but the channel-id in timerlist.html says 2319353951050401984 ..

 

what exactly is "OrbitalPosition" ? How can I find that without parsing channelsdat?

Edited by NChief
Link to comment

My fault. Its the first actually.

 

(TunerType +1) shl 29 + APID shl 16 + SID

 

To this append the delimiter | and the Channelname. Then it should be the same as in the timerlist.

Link to comment

Nope, its not the the same as the ID in timerlist.html.

 

However, I can use this ID to add timers with.

 

eks: I add a timer like this:

/api/timeradd.html?ch=1220675776&dor=41626&enable=1&start=200&stop=230&title=loltimer&encoding=255

 

Then this is what I get in timerlist.html:

<Timer Type="1" ID="{D2EB2ECF-0BA1-4D12-8B4F-2D6EDB6BB248}" Enabled="-1" Priority="50" Charset="0" Date="18.12.2013" Start="03:20:00" Dur="30" End="03:50:00" Action="0">
<Descr>loltimer</Descr>
<Options AdjustPAT="-1" AllAudio="-1" DVBSubs="-1" Teletext="-1"/>
<Format>2</Format>
<Folder>Auto</Folder>
<NameScheme>%year-%date_%time_%station_%name</NameScheme>
<Source>API</Source>
<Channel ID="2319353951050401984|TV3 HD NO"/>
<Executeable>-1</Executeable>
<Recording>0</Recording>
<ID>3</ID>
<GUID>{D2EB2ECF-0BA1-4D12-8B4F-2D6EDB6BB248}</GUID>
</Timer>

The ids is not the same..

 

(if I use the 2nd method/ID with timeradd the timer does not get added)

Edited by NChief
Link to comment

You have a few additions where multiplications should be ;)

 

This is the correct one.

Service ID + AudioPID x 2^16 + (Tunertyp+1) x 2^29 + TransportstreamID x 2^32 + (OrbitalPosition x 10) x 2^48 + TV/Radio-Flag x 2^61

This script uses the id's from 2359890659700053125|Animax

I did it in steps to look for calculation errors and to compare them with a calculator.

#!/usr/bin/perl

use bignum;

$serviceID = 5253;
$audioPID  = 47;
$tunerType = 1;
$transportStreamID = 1037;
$orbitalPosition = 19.2;


$sid  = $serviceID;
$apid = $audioPID * (2**16);
$ttyp = (($tunerType + 1) * (2**29));
$tsid = $transportStreamID * (2**32);
$opo  = ($orbitalPosition * 10) * (2**48);
$tfl  = 1 * (2**61);


print "ServiceID: ".$sid."\n";
print "AudioPID: ".$apid."\n";
print "TunerType: ".$ttyp."\n";
print "TransportStream: ".$tsid."\n";
print "Orbitpos: ".$opo."\n";
print "TVflag: ".$tfl."\n\n";

$channelID = $sid+$apid+$ttyp+$tsid+$opo+$tfl;
print $channelID."\n";

exit;

Edited by mague
Link to comment

oh thanks!! I cant believe I didn't see that.

 

In addition my script got the wrong orbital position. It finds 48 instead of 4.8.. getchannelsdat.html is a total mess! :-P

not sure how I can know if it should be 48 or 4.8.

 

here is a updated version of my script: http://pastebin.com/LT1qgfAH

this now finds the correct channel-ID, however I need to set the orbital position manually...

 

The java-version of this is here https://code.google.com/p/DVBViewer-controller/source/browse/DVBViewerController/trunk/DVBViewerController/src/org/DVBViewer/controller/io/ChannelListParser.java

It was there I got the idea of parsing the channelsdat.

Edited by NChief
Link to comment

In addition my script got the wrong orbital position. It finds 48 instead of 4.8.. getchannelsdat.html is a total mess! :-P

Why dont you just use the xml version of the channel list?

 

It contains the channeild, you dont have to calculate yourself since RS 1.24 ;-)

Link to comment
  • 1 month later...

I'm struggling with converting time / date to the correct format. Could somebody please explain the procedure for converting for example 21:00 to the right format? I have seen the decimal*24*60.. But what is the decimal supposed to be? Can somebody do the whole conversion?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...