Jump to content
uglyned

API - timers list contains invalid characters (according to Visual Stu

Recommended Posts

uglyned

Hi,

 

Having a go at reading in the timer list using the new async processes in Visual Studio 2012.

 

The application throws an exception when reading in the timer list direct into a string, stating the following (I'm using the ?utf8 parameter in the query string).

 

'The character set provided in ContentType is invalid. Cannot read content as string using an invalid character set'

 

However, if I read it into a byte array, then use UTF8 encoding to convert it to string, it works OK.

 

So no big issue - there's an easy workaround, just thought you might like to know.

 

 

Share this post


Link to post
Lars_MQ

Could please you provide a sample xml, which includes the problematic entries?

Share this post


Link to post
uglyned

It was an '&'. Food & Drink. Programme has finished now. I just turned the feed into a char array and manually omitted the '&' and it was fine. Weird.

Share this post


Link to post
uglyned

It may have been .Net Framework being a bit picky - I haven't found VS2012 to be all that stable at the moment.

Share this post


Link to post
Lars_MQ

I think it's picky. I tried it with several the webbrowsers and they didn't complain about the encoding of & or other special chars...

Share this post


Link to post
uglyned

Sounds like it to me. Easy to substitute chars it doesn't like so not an issue. Sounds like it's not a 'real' issue.

Share this post


Link to post

  • Similar Content

    • DetlefM
      By DetlefM
      I noticed several things during my tests that make debugging api calls difficult.
      /api/epg.html
      The returned XML string is often (but not always) incorrect if the EPG entry is not found.
      <?xml version="1.0" encoding="utf-8" ?><!-- by DVBViewer Media Server --><epg Ver="1">
      The end tag is missing.
      Here it would be nice (besides the return of a valid XML string) to get an error code included. For example: wrong channelid, epgid not found
      When searching for pdc with a wrong pdc value (in my case 'NOPDC') this filter is completely ignored and the EPG list of the channel is returned. I think also here an error message would be more helpful.
      Many other api calls have no return value at all - e.g. timeredit. Here it would be helpful if the changed timer (or an error code in case of problems) would be returned.
    • t5b6_de
      By t5b6_de
      Hallo zusammen, 
       
      ich möchte für den DVBViewer und den Media Server plugins schreiben die  (im ersten Schritt Daten im TS-Datenstrom abgreifen, später dann auch manipulieren)
       
      Gibt es irgendwo ein Projektbeispiel für Visual Studio in c++ oder c?

      Ich konnte leider keines finden, oder war nicht in der Lage einen passenden Suchbegriff zu formulieren.
       
      Grüße
      Thomas
    • AnBad
      By AnBad
      Hallo,
      weiß jemand eine Möglichkeit wie man von FHEM aus EPG_Daten des Mediaservers aufrufen bzw. nach FHEM importieren kann? Also z.B. einmal am Tag für bestimmte Sender das Programm für z.B. die nächsten drei Tage.
       
      Ich weiß es gibt eine API-Schnittstelle im Mediaserver. Aber ich habe da keine Ahnung. Könnte man mit "http://[user]:[password]@[IP]:[port]/api/" Daten im Browser anzeigen lassen, die man dann mit Parsing abgreift? Wobei ich nicht einmal weiß, welchen User und Passwort ich in das Link eintragen müsste.
       
      Danke
      Michael
    • sir drake
      By sir drake
      Hallo Griga,
      ich möchte ein meinem Programm neben dem CHANNEL-NAME auch die Quelle( SAT/Internet...HLS Deutsch....)  einer Aufnahme anzeigen.
      In einem TIMER-RECORD habe kann ich hierfür den Node  <CHANNEL ID> zerlegen und benutzen.
      In einem RECORDING-RECORD habe ich nur den Node >CHANNEL>xxxx</CHANNEL>
      Das reicht leider für meine Zwecke nicht aus.

      <recording id="98" charset="255" start="20181021195500" duration="001000">
      <channel>Das Erste</channel>
      <channel ID>1234567890</channel ID>
      <file>
      d:\_aufnahmen\2018-10-21_19-59-23_das erste_tagesschau.ts
      </file>
      <title>Tagesschau</title>
      <image>2706243175_SM.jpg</image>
      </recording>
       
      Vielleicht kannst du diesen Node optional beim Aufruf hinzufügen:
       
      ....://localhost:8089/api/recordings.html?utf8=1&amp;images=1;channel_id=1
       
       
      vg & Dank 
      Sir Drake
    • sir drake
      By sir drake
      Hello Griga,
       
      maybe somthing for further versions.
       
      by using the Tasks-command ( api/tasks.html?action=.... ) 
      i did not know, when a started process is finished.
      (also not if start has happen successfully. no feedback given ) 

      should it be possible to implement this as a feedback
      once in the existing status2-request or in a sep. new tasks-status-request ? 

      in a very specific case i need to know if a process has ended 
      prior i fire the next command to dms.
       
      every suggestion is welcome
       
      brgds
      sir drake
       
×
×
  • Create New...