Solved CURL and media files with accented characters (ë, é, ü etc.)
#1
Thanks to the help on this forum I'm experimenting with the jsonrpc api and using CURL on the command line.

This is my problem: I can't get media files with accented characters (ë, é, ü etc.)  to play from the command line using curl. How should I encode the filename in this command?

Code:
curl -X POST -H "content-type:application/json" ://192.168.178.227:8080/jsonrpc -d {\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"Player.Open\",\"params\":{\"item\":{\"file\":\""://mypc/E/TV/Series NEW/1978 - Wuthering Heights (BBC, Drama, History, Emily Brontë)/Episode 01.mkv"\"}}}\"

The result is a parse error:

Code:
{"error":{"code":-32700,"message":"Parse error."},"id":null,"jsonrpc":"2.0"}

Some remarks:
  • The file plays fine if I select it 'on the TV' directly with the remote on my EM7680. I see the ë in the list, not garbled
  • The file plays fine if I select it in the WebInterface
  • The file plays fine if I replace the ë character in the foldername to e on mypc (so it reads bronte) and also apply that change to the curl command
Reply
#2
Hi Maxol,

Could you try to replace the accented character with the unicode equivalent?   ë => \u00eb

Code:
curl -X POST -H "content-type:application/json" http://192.168.178.227:8080/jsonrpc -d {\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"Player.Open\",\"params\":{\"item\":{\"file\":\""smb://ronpc/E/TV/Series NEW/1978 - Wuthering Heights (BBC, Drama, History, Emily Bront\u00eb)/Episode 01.mkv"\"}}}\"
Reply
#3
(2022-02-16, 19:23)Maxol Wrote:
Code:
curl -X POST -H "content-type:application/json" http://192.168.178.227:8080/jsonrpc -d {\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"Player.Open\",\"params\":{\"item\":{\"file\":\""smb://ronpc/E/TV/Series NEW/1978 - Wuthering Heights (BBC, Drama, History, Emily Bront\u00eb)/Episode 01.mkv"\"}}}\"

I tried that and it worked! Excellent, thank you very much!
Reply
#4
You're welcome.

Thread marked solved.
Reply
#5
Code:
curl -X POST -H "content-type:application/json; charset=utf-8" ://192.168.178.227:8080/jsonrpc -d {\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"Player.Open\",\"params\":{\"item\":{\"file\":\""://mypc/E/TV/Series NEW/1978 - Wuthering Heights (BBC, Drama, History, Emily Brontë)/Episode 01.mkv"\"}}}\"

Maybe this (from stack overflow)?

scott s.
.
Reply
#6
(2022-02-16, 23:41)scott967 Wrote:
Code:
curl -X POST -H "content-type:application/json; charset=utf-8" ://192.168.178.227:8080/jsonrpc -d {\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"Player.Open\",\"params\":{\"item\":{\"file\":\""://mypc/E/TV/Series NEW/1978 - Wuthering Heights (BBC, Drama, History, Emily Brontë)/Episode 01.mkv"\"}}}\"
No, tried that before I came up with the \u00eb. Charset didn't work...
Reply

Logout Mark Read Team Forum Stats Members Help
CURL and media files with accented characters (ë, é, ü etc.)0