Solved CURL and media files with accented characters (ë, é, ü etc.) - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228) +---- Thread: Solved CURL and media files with accented characters (ë, é, ü etc.) (/showthread.php?tid=367060) |
CURL and media files with accented characters (ë, é, ü etc.) - Maxol - 2022-02-16 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:
RE: CURL and media files with accented characters (ë, é, ü etc.) - Maxol - 2022-02-16 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"\"}}}\" RE: CURL and media files with accented characters (ë, é, ü etc.) - Maxol - 2022-02-16 (2022-02-16, 19:23)Maxol Wrote: I tried that and it worked! Excellent, thank you very much! CURL and media files with accented characters (ë, é, ü etc.) - Klojum - 2022-02-16 You're welcome. Thread marked solved. RE: CURL and media files with accented characters (ë, é, ü etc.) - scott967 - 2022-02-16 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. . RE: CURL and media files with accented characters (ë, é, ü etc.) - Maxol - 2022-02-17 (2022-02-16, 23:41)scott967 Wrote:No, tried that before I came up with the \u00eb. Charset didn't work... |