Jump to content

Webhooks plugin sending incomplete post data


Anthony Musgrove
 Share

Recommended Posts

Anthony Musgrove

Hi guys,

 

I'm trying to understand the inconsistencies I am experiencing with the webhooks plugin - I've enabled the plugin and set the URL to a PHP script that I would like to process the request, so that I can completely customise it for my home automation.

 

My issue is that when the webhook is called to my php script, I am logging the post body, and I am getting data such as this;

 

stereo","BitRate":150903,"Channels":2,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Profile":"LC","Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","Level":0}],"ImageTags":{"Primary":"29d4f51d4cb89131ea24d6b3fe87995f"},"BackdropImageTags":[],"ParentLogoImageTag":"39bd216083c07590b3ec8a163657fb28","ParentThumbItemId":"9261","ParentThumbImageTag":"3c156d34b3c12f6458a8f6edebcc0d1d","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":300000000,"Name":"Chapter 2"},{"StartPositionTicks":1175600000,"Name":"Chapter 3"},{"StartPositionTicks":2625200000,"Name":"Chapter 4"},{"StartPositionTicks":4006400000,"Name":"Chapter 5"},{"StartPositionTicks":4760400000,"Name":"Chapter 6"},{"StartPositionTicks":6024000000,"Name":"Chapter 7"},{"StartPositionTicks":7292800000,"Name":"Chapter 8"},{"StartPositionTicks":7704400000,"Name":"Chapter 9"},{"StartPositionTicks":8679200000,"Name":"Chapter 10"},{"StartPositionTicks":9898000000,"Name":"Chapter 11"},{"StartPositionTicks":11832000000,"Name":"Chapter 12"},{"StartPositionTicks":13275200000,"Name":"Chapter 13"},{"StartPositionTicks":14042800000,"Name":"Chapter 14"},{"StartPositionTicks":15691200000,"Name":"Chapter 15"},{"StartPositionTicks":16136400000,"Name":"Chapter 16"},{"StartPositionTicks":16550800000,"Name":"Chapter 17"}],"MediaType":"Video","Width":720,"Height":576},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--05de95fd-ee4e-4895-922e-613adc221947--
tereo","BitRate":150903,"Channels":2,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Profile":"LC","Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","Level":0}],"ImageTags":{"Primary":"29d4f51d4cb89131ea24d6b3fe87995f"},"BackdropImageTags":[],"ParentLogoImageTag":"39bd216083c07590b3ec8a163657fb28","ParentThumbItemId":"9261","ParentThumbImageTag":"3c156d34b3c12f6458a8f6edebcc0d1d","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":300000000,"Name":"Chapter 2"},{"StartPositionTicks":1175600000,"Name":"Chapter 3"},{"StartPositionTicks":2625200000,"Name":"Chapter 4"},{"StartPositionTicks":4006400000,"Name":"Chapter 5"},{"StartPositionTicks":4760400000,"Name":"Chapter 6"},{"StartPositionTicks":6024000000,"Name":"Chapter 7"},{"StartPositionTicks":7292800000,"Name":"Chapter 8"},{"StartPositionTicks":7704400000,"Name":"Chapter 9"},{"StartPositionTicks":8679200000,"Name":"Chapter 10"},{"StartPositionTicks":9898000000,"Name":"Chapter 11"},{"StartPositionTicks":11832000000,"Name":"Chapter 12"},{"StartPositionTicks":13275200000,"Name":"Chapter 13"},{"StartPositionTicks":14042800000,"Name":"Chapter 14"},{"StartPositionTicks":15691200000,"Name":"Chapter 15"},{"StartPositionTicks":16136400000,"Name":"Chapter 16"},{"StartPositionTicks":16550800000,"Name":"Chapter 17"}],"MediaType":"Video","Width":720,"Height":576},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--3387e85f-7dea-469a-a7fd-9ffe47ef85b5--
":"stereo","BitRate":150903,"Channels":2,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Profile":"LC","Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","Level":0}],"ImageTags":{"Primary":"29d4f51d4cb89131ea24d6b3fe87995f"},"BackdropImageTags":[],"ParentLogoImageTag":"39bd216083c07590b3ec8a163657fb28","ParentThumbItemId":"9261","ParentThumbImageTag":"3c156d34b3c12f6458a8f6edebcc0d1d","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":300000000,"Name":"Chapter 2"},{"StartPositionTicks":1175600000,"Name":"Chapter 3"},{"StartPositionTicks":2625200000,"Name":"Chapter 4"},{"StartPositionTicks":4006400000,"Name":"Chapter 5"},{"StartPositionTicks":4760400000,"Name":"Chapter 6"},{"StartPositionTicks":6024000000,"Name":"Chapter 7"},{"StartPositionTicks":7292800000,"Name":"Chapter 8"},{"StartPositionTicks":7704400000,"Name":"Chapter 9"},{"StartPositionTicks":8679200000,"Name":"Chapter 10"},{"StartPositionTicks":9898000000,"Name":"Chapter 11"},{"StartPositionTicks":11832000000,"Name":"Chapter 12"},{"StartPositionTicks":13275200000,"Name":"Chapter 13"},{"StartPositionTicks":14042800000,"Name":"Chapter 14"},{"StartPositionTicks":15691200000,"Name":"Chapter 15"},{"StartPositionTicks":16136400000,"Name":"Chapter 16"},{"StartPositionTicks":16550800000,"Name":"Chapter 17"}],"MediaType":"Video","Width":720,"Height":576},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--c4225f28-4ebe-4caa-ae31-fac92b342554--
ubtitle","Index":2,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0}],"ImageTags":{"Primary":"b5cf4d4d268a385e16d4503161389a74"},"BackdropImageTags":[],"ParentLogoImageTag":"07e5dfbfdee3e1bdd9b18cd5fe8b1827","ParentThumbItemId":"4583","ParentThumbImageTag":"8d58ab5440b8d524d7ceb4ae08aef2f6","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--15aaebfc-2b83-4b50-9a0a-e9e692ee7567--
title","Index":2,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0}],"ImageTags":{"Primary":"b5cf4d4d268a385e16d4503161389a74"},"BackdropImageTags":[],"ParentLogoImageTag":"07e5dfbfdee3e1bdd9b18cd5fe8b1827","ParentThumbItemId":"4583","ParentThumbImageTag":"8d58ab5440b8d524d7ceb4ae08aef2f6","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--2a8af2a7-e9cf-4e31-a713-5a2cd7d7a73f--
title","Index":2,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0}],"ImageTags":{"Primary":"b5cf4d4d268a385e16d4503161389a74"},"BackdropImageTags":[],"ParentLogoImageTag":"07e5dfbfdee3e1bdd9b18cd5fe8b1827","ParentThumbItemId":"4583","ParentThumbImageTag":"8d58ab5440b8d524d7ceb4ae08aef2f6","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--a3dfaee8-ae83-4ac9-8fbb-77d90fba197f--
itle","Index":2,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0}],"ImageTags":{"Primary":"b5cf4d4d268a385e16d4503161389a74"},"BackdropImageTags":[],"ParentLogoImageTag":"07e5dfbfdee3e1bdd9b18cd5fe8b1827","ParentThumbItemId":"4583","ParentThumbImageTag":"8d58ab5440b8d524d7ceb4ae08aef2f6","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--b3897b57-cd20-40fb-b228-0b5f6387954c--
Subtitle","Index":2,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0}],"ImageTags":{"Primary":"b5cf4d4d268a385e16d4503161389a74"},"BackdropImageTags":[],"ParentLogoImageTag":"07e5dfbfdee3e1bdd9b18cd5fe8b1827","ParentThumbItemId":"4583","ParentThumbImageTag":"8d58ab5440b8d524d7ceb4ae08aef2f6","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--a2ba4e51-7c4a-4891-9190-1a8e4abce52b--
1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--fb055e7f-79e6-4e02-972b-151228558d11--
80,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--e0aefa23-29b2-438e-9ba8-61b0f8d28264--
80,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--776b3211-146f-447c-ab09-d6d2ffb74596--
0,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--07436667-7f2b-4bf2-9157-534ca7434ab8--
:1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--7be1bb81-5dbe-4724-a7ee-bfaf6fd08c9e--
extSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0},{"Codec":"mov_text","CodecTag":"tx3g","Language":"eng","TimeBase":"1/1000","CodecTimeBase":"0/1","DisplayTitle":"English (Default MOV_TEXT)","DisplayLanguage":"English","IsInterlaced":false,"BitRate":105,"IsDefault":true,"IsForced":false,"Type":"Subtitle","Index":3,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0},{"Codec":"mjpeg","ColorSpace":"bt470bg","TimeBase":"1/90000","CodecTimeBase":"0/1","IsInterlaced":false,"BitDepth":8,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":300,"Width":300,"RealFrameRate":90000,"Profile":"192","Type":"EmbeddedImage","Index":4,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuvj444p","Level":-99,"IsAnamorphic":false}],"ImageTags":{"Primary":"de98cf81b4787fc85e7caec59ecf4b29"},"BackdropImageTags":[],"ParentLogoImageTag":"07e5dfbfdee3e1bdd9b18cd5fe8b1827","ParentThumbItemId":"4583","ParentThumbImageTag":"8d58ab5440b8d524d7ceb4ae08aef2f6","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--e2e75835-71c8-407d-8f31-6b02c2de456e--
tSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0},{"Codec":"mov_text","CodecTag":"tx3g","Language":"eng","TimeBase":"1/1000","CodecTimeBase":"0/1","DisplayTitle":"English (Default MOV_TEXT)","DisplayLanguage":"English","IsInterlaced":false,"BitRate":105,"IsDefault":true,"IsForced":false,"Type":"Subtitle","Index":3,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0},{"Codec":"mjpeg","ColorSpace":"bt470bg","TimeBase":"1/90000","CodecTimeBase":"0/1","IsInterlaced":false,"BitDepth":8,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":300,"Width":300,"RealFrameRate":90000,"Profile":"192","Type":"EmbeddedImage","Index":4,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuvj444p","Level":-99,"IsAnamorphic":false}],"ImageTags":{"Primary":"de98cf81b4787fc85e7caec59ecf4b29"},"BackdropImageTags":[],"ParentLogoImageTag":"07e5dfbfdee3e1bdd9b18cd5fe8b1827","ParentThumbItemId":"4583","ParentThumbImageTag":"8d58ab5440b8d524d7ceb4ae08aef2f6","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--eecdb6f9-def9-4749-b00d-c385fc63da0e--
tSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0},{"Codec":"mov_text","CodecTag":"tx3g","Language":"eng","TimeBase":"1/1000","CodecTimeBase":"0/1","DisplayTitle":"English (Default MOV_TEXT)","DisplayLanguage":"English","IsInterlaced":false,"BitRate":105,"IsDefault":true,"IsForced":false,"Type":"Subtitle","Index":3,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0},{"Codec":"mjpeg","ColorSpace":"bt470bg","TimeBase":"1/90000","CodecTimeBase":"0/1","IsInterlaced":false,"BitDepth":8,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":300,"Width":300,"RealFrameRate":90000,"Profile":"192","Type":"EmbeddedImage","Index":4,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuvj444p","Level":-99,"IsAnamorphic":false}],"ImageTags":{"Primary":"de98cf81b4787fc85e7caec59ecf4b29"},"BackdropImageTags":[],"ParentLogoImageTag":"07e5dfbfdee3e1bdd9b18cd5fe8b1827","ParentThumbItemId":"4583","ParentThumbImageTag":"8d58ab5440b8d524d7ceb4ae08aef2f6","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--72a52cd8-129c-458e-9822-13f77b94d486--
SubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0},{"Codec":"mov_text","CodecTag":"tx3g","Language":"eng","TimeBase":"1/1000","CodecTimeBase":"0/1","DisplayTitle":"English (Default MOV_TEXT)","DisplayLanguage":"English","IsInterlaced":false,"BitRate":105,"IsDefault":true,"IsForced":false,"Type":"Subtitle","Index":3,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0},{"Codec":"mjpeg","ColorSpace":"bt470bg","TimeBase":"1/90000","CodecTimeBase":"0/1","IsInterlaced":false,"BitDepth":8,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":300,"Width":300,"RealFrameRate":90000,"Profile":"192","Type":"EmbeddedImage","Index":4,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuvj444p","Level":-99,"IsAnamorphic":false}],"ImageTags":{"Primary":"de98cf81b4787fc85e7caec59ecf4b29"},"BackdropImageTags":[],"ParentLogoImageTag":"07e5dfbfdee3e1bdd9b18cd5fe8b1827","ParentThumbItemId":"4583","ParentThumbImageTag":"8d58ab5440b8d524d7ceb4ae08aef2f6","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--9e2b0f1d-56e1-4edc-afab-f31ab4ae3ca8--
TextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0},{"Codec":"mov_text","CodecTag":"tx3g","Language":"eng","TimeBase":"1/1000","CodecTimeBase":"0/1","DisplayTitle":"English (Default MOV_TEXT)","DisplayLanguage":"English","IsInterlaced":false,"BitRate":105,"IsDefault":true,"IsForced":false,"Type":"Subtitle","Index":3,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","Level":0},{"Codec":"mjpeg","ColorSpace":"bt470bg","TimeBase":"1/90000","CodecTimeBase":"0/1","IsInterlaced":false,"BitDepth":8,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":300,"Width":300,"RealFrameRate":90000,"Profile":"192","Type":"EmbeddedImage","Index":4,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuvj444p","Level":-99,"IsAnamorphic":false}],"ImageTags":{"Primary":"de98cf81b4787fc85e7caec59ecf4b29"},"BackdropImageTags":[],"ParentLogoImageTag":"07e5dfbfdee3e1bdd9b18cd5fe8b1827","ParentThumbItemId":"4583","ParentThumbImageTag":"8d58ab5440b8d524d7ceb4ae08aef2f6","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--0c290461-7a5c-440f-b3b9-b5e08f097bd8--
":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--4bf71a63-d851-4efa-87d1-dbb760410606--
Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--618ccfd2-c415-4f63-9b73-1a3a9739dc09--
Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--78b23955-882b-4408-9e91-bb35a95df35e--
Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--a2d41341-02ed-454b-8807-c447c7df18a4--
":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--26d09ed5-0d0f-48a0-9150-c8de54b33a3f--
:"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--88b84a41-1d30-4c47-bbb6-1123bb993663--
"Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--a7bd2fa4-13a0-4cef-a8fc-926ed34e237a--
2,"Height":320},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--11b4eac4-12a8-433a-be21-569201149142--
"Height":320},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--a752a896-3e65-4037-9d32-fc7ac40fa609--
"Height":320},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--48dbe3b1-eb4f-4625-b209-d623d27d917d--
Height":320},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--d09895c4-b832-4623-a1eb-00763c0f9544--
32,"Height":320},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--b8046e80-8732-4ad9-bc3e-84bbffe88c15--
ame":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--654c6fc3-fafd-43fc-b113-c951849ec85c--
e":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--702950a4-d7d1-4f70-a348-34dac833fd4c--
":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--8da033dd-1e9a-4158-9c30-81b7cce732c8--
00000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"}],"MediaType":"Video","Width":720,"Height":404},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--f8c3b2d1-c857-49a3-b2a7-3f39b2527724--
0000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"}],"MediaType":"Video","Width":720,"Height":404},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--53a0d807-ade1-4170-823e-ee1e4ed8b29b--
0000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"}],"MediaType":"Video","Width":720,"Height":404},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.110","Client":"Emby for Chromecast","DeviceName":"Bedroom TV","DeviceId":"QmVkcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"3e0beb182371310ed90c87dfa23484a1"}}
--e3a92a2a-214c-4f21-a687-d541b3cc003e--
 
and;
 
y Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},
 
"Session":
{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}
}
 
2bebc8ac2de300c842383a35c9b09","ParentThumbItemId":"9479","ParentThumbImageTag":"9c7ad64c4081281ddd092160f16cc926","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--85a4a979-d4da-409d-bca7-2e94227300ea--
 
 
 
Notice how the post data is incomplete, each time missing a portion of the data from the beginning of the data body.   My PHP code is rather simple, and is as follows :-
 
$post_data = file_get_contents('php://input');
$post_data .= "\r\n";

file_put_contents("/home/medius/public_html/emby_hook_log.txt", $post_data, FILE_APPEND);
 
 

Thanks for the insight and assistance!

 

(Emby is completely uptodate, and so is webhooks plugin)

Link to comment
Share on other sites

Anthony Musgrove

Seems now its consistent, but consistently missing the first part of the JSON data:

 

Just toggling the pause button:

 

ebc8ac2de300c842383a35c9b09","ParentThumbItemId":"9479","ParentThumbImageTag":"9c7ad64c4081281ddd092160f16cc926","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}

--bfb7eed4-4e9d-4129-8bb1-1d0954a6ab1c--2bebc8ac2de300c842383a35c9b09","ParentThumbItemId":"9479","ParentThumbImageTag":"9c7ad64c4081281ddd092160f16cc926","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}--08eeec48-e133-45bd-abd3-dabef8fb0dcf--ebc8ac2de300c842383a35c9b09","ParentThumbItemId":"9479","ParentThumbImageTag":"9c7ad64c4081281ddd092160f16cc926","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}--79458326-06f2-4bd2-a7cc-4b8b2c5654a7--2bebc8ac2de300c842383a35c9b09","ParentThumbItemId":"9479","ParentThumbImageTag":"9c7ad64c4081281ddd092160f16cc926","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}--394eaeb6-0417-4342-ac31-9cdc1fda2343--
 
ebc8ac2de300c842383a35c9b09","ParentThumbItemId":"9479","ParentThumbImageTag":"9c7ad64c4081281ddd092160f16cc926","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}--bfb7eed4-4e9d-4129-8bb1-1d0954a6ab1c--2bebc8ac2de300c842383a35c9b09","ParentThumbItemId":"9479","ParentThumbImageTag":"9c7ad64c4081281ddd092160f16cc926","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}--08eeec48-e133-45bd-abd3-dabef8fb0dcf--ebc8ac2de300c842383a35c9b09","ParentThumbItemId":"9479","ParentThumbImageTag":"9c7ad64c4081281ddd092160f16cc926","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}--79458326-06f2-4bd2-a7cc-4b8b2c5654a7--2bebc8ac2de300c842383a35c9b09","ParentThumbItemId":"9479","ParentThumbImageTag":"9c7ad64c4081281ddd092160f16cc926","Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}--394eaeb6-0417-4342-ac31-9cdc1fda2343--
 
Link to comment
Share on other sites

That looks like Playback progress event data.

 

You are probably looking to grab the PlaybackStarted events. The progress data will continue to flow and make calls to your php script during playback.

 

Does that help at all?

Edited by chef
Link to comment
Share on other sites

Anthony Musgrove

Hm not really.   For example, check this txt log out:

 

apter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--b7b64543-6074-4654-99e5-20dbc7fd2bbf--

pter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--21505498-fce4-44ed-83e3-822a3a9d60e2--

"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"}],"MediaType":"Video","Width":1280,"Height":720},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--63f6a34f-5b35-4798-b6fe-e0028a58f526--

 

See how its missing a segment at the beginning of each call?  I'm assuming it should be {"Chapter 3"}, but look at the individual calls, apter 3"} at the start of the line.  This is raw post body data straight to the webhook URL.  I'm kinda lost as to why its missing.

Link to comment
Share on other sites

Anthony Musgrove

Even starting a movie:

 

:["8982b9b841e8547ac506e9bc3702311e"],"Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"},{"StartPositionTicks":18000000000,"Name":"Chapter 7"},{"StartPositionTicks":21000000000,"Name":"Chapter 8"},{"StartPositionTicks":24000000000,"Name":"Chapter 9"},{"StartPositionTicks":27000000000,"Name":"Chapter 10"},{"StartPositionTicks":30000000000,"Name":"Chapter 11"},{"StartPositionTicks":33000000000,"Name":"Chapter 12"},{"StartPositionTicks":36000000000,"Name":"Chapter 13"},{"StartPositionTicks":39000000000,"Name":"Chapter 14"},{"StartPositionTicks":42000000000,"Name":"Chapter 15"},{"StartPositionTicks":45000000000,"Name":"Chapter 16"},{"StartPositionTicks":48000000000,"Name":"Chapter 17"},{"StartPositionTicks":51000000000,"Name":"Chapter 18"}],"MediaType":"Video","Width":1920,"Height":1080},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--859729f4-260c-4241-8844-93ae85d453fa--

"8982b9b841e8547ac506e9bc3702311e"],"Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"},{"StartPositionTicks":18000000000,"Name":"Chapter 7"},{"StartPositionTicks":21000000000,"Name":"Chapter 8"},{"StartPositionTicks":24000000000,"Name":"Chapter 9"},{"StartPositionTicks":27000000000,"Name":"Chapter 10"},{"StartPositionTicks":30000000000,"Name":"Chapter 11"},{"StartPositionTicks":33000000000,"Name":"Chapter 12"},{"StartPositionTicks":36000000000,"Name":"Chapter 13"},{"StartPositionTicks":39000000000,"Name":"Chapter 14"},{"StartPositionTicks":42000000000,"Name":"Chapter 15"},{"StartPositionTicks":45000000000,"Name":"Chapter 16"},{"StartPositionTicks":48000000000,"Name":"Chapter 17"},{"StartPositionTicks":51000000000,"Name":"Chapter 18"}],"MediaType":"Video","Width":1920,"Height":1080},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--ffdd4819-b7f8-4c9a-812c-0f82c5392eb3--

 

First line has a colon, second line doesn't, and I'm fairly certain theres data missing from the start of the hook data.

Link to comment
Share on other sites

Anthony Musgrove

My apologies, I just wrote a quick socket server to eliminate the PHP issue.  Seems that PHP is chopping off a massive portion of data from reading the way I am (using file_get_contents), my socket server shows the entire packet, so I am so sorry I have posted this question; server data:

 

--4e6789b6-70fa-4abd-a5f3-c9769e147c34
Content-Type: application/json; charset=utf-8
Content-Disposition: form-data
 
{"Event":"playback.pause","User":{"Name":"Anthony","ServerId":"1d7e0f909f2748a981e8a3a0dd65d589","ConnectUserName":"newymods","ConnectLinkType":"LinkedUser","Id":"5c43ee81df634188b03c8f06804b609a","HasPassword":true,"HasConfiguredPassword":true,"HasConfiguredEasyPassword":false,"LastLoginDate":"2020-01-16T21:40:03.0490163+00:00","LastActivityDate":"2020-01-17T15:40:43.7167793+00:00","Configuration":{"PlayDefaultAudioTrack":true,"DisplayMissingEpisodes":false,"GroupedFolders":[],"SubtitleMode":"Default","DisplayCollectionsView":false,"EnableLocalPassword":false,"OrderedViews":["c248dc0bec4b0ce8fb01231d1f12c5c1","c01b88698fd9efa036e1af78f11fecc3","f137a2dd21bbc1b99aa5c0f6bf02a805","7e64e3196
57a9516ec78490da03edccb","1071671e7bffa0532e930debee501d2e","6c2a057148b4d7c20a207c789aba6d07","484cf52875118e03bd7effc72621bec0"],"LatestItemsExcludes":["c01b88698fd9efa036e1af78f11fecc3"],"MyMediaExcludes":[],"HidePlayedInLatest":true,"RememberAudioSelections":true,"RememberSubtitleSelections":true,"EnableNextEpisodeAutoPlay":true},"Policy":{"IsAdministrator":true,"IsHidden":false,"IsHiddenRemotely":true,"IsDisabled":false,"BlockedTags":[],"IsTagBlockingModeInclusive":false,"EnableUserPreferenceAccess":true,"AccessSchedules":[],"BlockUnratedItems":[],"EnableRemoteControlOfOtherUsers":true,"EnableSharedDeviceControl":true,"EnableRemoteAccess":true,"EnableLiveTvManagement":true,"EnableLiveTvAccess":true,"EnableMediaPlayback":true,"EnableAudioPlaybackTranscoding":true,"EnableVideoPlaybackTranscoding":true,"EnablePlaybackRemuxing":true,"EnableContentDeletion":true,"EnableContentDeletionFromFolders":[],"EnableContentDownloading":true,"EnableSubtitleDownloading":true,"EnableSubtitleManagement":true,"EnableSyncTra
nscoding":true,"EnableMediaConversion":true,"EnabledDevices":[],"EnableAllDevices":true,"EnabledChannels":[],"EnableAllChannels":true,"EnabledFolders":[],"EnableAllFolders":true,"InvalidLoginAttemptCount":0,"EnablePublicSharing":true,"RemoteClientBitrateLimit":0,"AuthenticationProviderId":"Emby.Server.Implementations.Library.DefaultAuthenticationProvider","ExcludedSubFolders":[],"DisablePremiumFeatures":false,"SimultaneousStreamLimit":0}},"Item":{"Name":"The Lion King 1½","OriginalTitle":"The Lion King 1½","ServerId":"1d7e0f909f2748a981e8a3a0dd65d589","Id":"11239","DateCreated":"2019-12-03T12:41:59.0000000+00:00","PresentationUniqueKey":"f2005782b58cb57501266a52dfcc3373","Container":"mp4","PremiereDate":"2004-02-05T13:00:00.0000000+00:00","ExternalUrls":[{"Name":"IMDb","Url":"https://www.imdb.com/title/tt0318403"},{"Name":"TheMovieDb","Url":"https://www.themoviedb.org/movie/11430"},{"Name":"TheMovieDbCollection","Url":"https://www.themoviedb.org/collection/94032"},{"Name":"Trakt","Url":"https://trakt.tv/mo
vies/tt0318403"}],"CriticRating":76,"Path":"/home/medius/media/Movies/The.Lion.King.1.1.2.2004.1080p.BluRay.x264.YIFY.mp4","OfficialRating":"AU-G","Overview":"Timon the meerkat and Pumbaa the warthog are best pals and the unsung heroes of the African savanna. This prequel to the smash Disney animated adventure takes you back -- way back -- before Simba's adventure began. You'll find out all about Timon and Pumbaa and tag along as they search for the perfect home and attempt to raise a rambunctious lion cub.","Taglines":["You Don't Know The ½ Of It!"],"Genres":["Family","Comedy","Animation"],"CommunityRating":6.6,"RunTimeTicks":53032730000,"ProductionYear":2004,"ProviderIds":{"Tmdb":"11430","Imdb":"tt0318403","TmdbCollection":"94032"},"IsFolder":false,"ParentId":"5","Type":"Movie","Studios":[{"Name":"Disney Television Animation","Id":12104}],"GenreItems":[{"Name":"Family","Id":35},{"Name":"Comedy","Id":566},{"Name":"Animation","Id":632}],"PrimaryImageAspectRatio":0.666666666666667,"MediaStreams":[{"Codec":"h2
64","CodecTag":"avc1","Language":"und","ColorPrimaries":"bt709","ColorSpace":"bt709","TimeBase":"1/24000","CodecTimeBase":"1001/48000","VideoRange":"SDR","DisplayTitle":"1080p H264","NalLengthSize":"4","IsInterlaced":false,"IsAVC":true,"BitRate":1906505,"BitDepth":8,"RefFrames":1,"IsDefault":true,"IsForced":false,"Height":1080,"Width":1920,"AverageFrameRate":23.9760246,"RealFrameRate":23.9760246,"Profile":"High","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuv420p","Level":41,"IsAnamorphic":false},{"Codec":"aac","CodecTag":"mp4a","Language":"eng","TimeBase":"1/48000","CodecTimeBase":"1/48000","DisplayTitle":"English AAC stereo (Default)","DisplayLanguage":"English","IsInterlaced":false,"ChannelLayout":"stereo","BitRate":93821,"Channels":2,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Profile":"LC","Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStre
am":false,"Protocol":"File","Level":0}],"ImageTags":{"Primary":"6c518fe590fe623c7b03a208153d0ece","Logo":"2ecf17c59a65bce53e38b6ac4fe04df3","Thumb":"3b50801a4a59ccb1f1fd11deee5f61c9"},"BackdropImageTags":["8982b9b841e8547ac506e9bc3702311e"],"Chapters":[{"StartPositionTicks":0,"Name":"Chapter 1"},{"StartPositionTicks":3000000000,"Name":"Chapter 2"},{"StartPositionTicks":6000000000,"Name":"Chapter 3"},{"StartPositionTicks":9000000000,"Name":"Chapter 4"},{"StartPositionTicks":12000000000,"Name":"Chapter 5"},{"StartPositionTicks":15000000000,"Name":"Chapter 6"},{"StartPositionTicks":18000000000,"Name":"Chapter 7"},{"StartPositionTicks":21000000000,"Name":"Chapter 8"},{"StartPositionTicks":24000000000,"Name":"Chapter 9"},{"StartPositionTicks":27000000000,"Name":"Chapter 10"},{"StartPositionTicks":30000000000,"Name":"Chapter 11"},{"StartPositionTicks":33000000000,"Name":"Chapter 12"},{"StartPositionTicks":36000000000,"Name":"Chapter 13"},{"StartPositionTicks":39000000000,"Name":"Chapter 14"},{"StartPositionTicks":4
2000000000,"Name":"Chapter 15"},{"StartPositionTicks":45000000000,"Name":"Chapter 16"},{"StartPositionTicks":48000000000,"Name":"Chapter 17"},{"StartPositionTicks":51000000000,"Name":"Chapter 18"}],"MediaType":"Video","Width":1920,"Height":1080},"Server":{"Name":"Emby Server","Id":"1d7e0f909f2748a981e8a3a0dd65d589"},"Session":{"RemoteEndPoint":"192.168.1.113","Client":"Emby for Chromecast","DeviceName":"Loungeroom TV","DeviceId":"TG91bmdlcm9vbSBUVg11","ApplicationVersion":"2.1.0","Id":"95269c73df843edf15320cc36ddbd159"}}
--4e6789b6-70fa-4abd-a5f3-c9769e147c34--
Link to comment
Share on other sites

Anthony Musgrove

So far I have realised that the webhook requests are not compatible with PHP, as is, on all my PHP installs, I am receiving this error when attempting to process the HTTP request:

 

 PHP Warning:  File Upload Mime headers garbled in Unknown on line 0
 
It appears that the request headers aren't following some kind of strict standard that PHP requires, so that kinda sucks.  Time to download the webhooks source code and find where the headers aren't following these strict standards, then I'll submit a fix on github.  cheers guys!  
Link to comment
Share on other sites

Anthony Musgrove

Turns out it is possibly due to the plugin utilising HttpClient - perhaps it needs to be rewritten using WebRequest as per https://stackoverflow.com/questions/18580345/how-to-send-data-and-a-image-using-httpclient-w-post

 

It's all to do with the format that HttpClient is sending the multipart data in, and PHP cannot make use of it.  I would really like to help rewrite the plugin using WebRequest, as I can see great benefits of having it compatible with PHP.   It's an easy scripting language that can make use of so many things; for me personally, my emby server runs on a debian box, with a local PHP install that I am going to send the webhooks to, which will allow me to control my custom engineered home automation things.  

 

Could you please direct me to the latest source code for the WebHook 1.8.0 plugin, so that I can port it over to WebRequest rather than HttpClient?  Thanks so much.

Link to comment
Share on other sites

Anthony Musgrove

So after much research, it seems that the request body isn't including a 'filename' or 'segment name' for the data, so in the PHP source code, the reason why this error occurs is per:

 

/* Return with an error if the posted data is garbled */   if (!param && !filename) {   sapi_module.sapi_error(E_WARNING, "File Upload Mime headers garbled");   goto fileupload_done;   }

 

And with the actual request sent by Emby Webhooks, it doesn't contain a param or filename for each segment; eg

 

Emby sends:

 

POST / HTTP/1.1
User-Agent: Emby Server/4.3.1.0
Accept-Encoding: deflate
Content-Type: multipart/form-data; boundary="2fa14921-760a-4347-bb07-09c28b1393a9"
Content-Length: 6509
Host: 192.168.1.117
 
--2fa14921-760a-4347-bb07-09c28b1393a9
Content-Type: application/json; charset=utf-8
Content-Disposition: form-data
[json data]
--2fa14921-760a-4347-bb07-09c28b1393a9
 
 
Whereas, by rfc1341 standards, it should be:
 
--2fa14921-760a-4347-bb07-09c28b1393a9
Content-Type: application/json; charset=utf-8
Content-Disposition: form-data; name="something"
 
[json data]
--2fa14921-760a-4347-bb07-09c28b1393a9
 
 
Notice the name (parameter)?  And for each boundary section, it should contain a different name; it reflects either a filename, or some type of unique name for the data.
 
Now, because you're using C#'s HttpClient, you can add the parameter name pretty easily; and it will make WebHooks compatible with PHP.  This will open a whole new portion of consumers for WebHooks as they will be simple and easy to integrate with a simple and easy to use scripting language endpoint;
 
 
I refer to the above link for example; 
 
form.Add(new HttpStringContent(txtFirst.Text), "first");
 
which then translates in the HTTP request to:
 
Content-Disposition: form-data; name="first"
 
 
HttpClient allows for the file/segment name to be specified.  Can we please get that to occur so it follows standards that will allow for webhooks to be consumed in this way?
 
Thank you again so very much.
Anthony
Edited by AnthonyJM
Link to comment
Share on other sites

Anthony Musgrove

Absolute legend Luke, jee you guys work fast.  I am so so impressed.  The update 1.0.9 is now working magically with PHP.  I absolutely love your work.

 

Warmest regards, Anthony

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi guys, I also want to use webhooks for my home automation stuff (Home-Assistant).

But it seems that the Content-Type header is incomplete. The multipart boundary is missing from the header.

 
mitmproxy output:

User-Agent:       Emby Server/4.3.1.0
Content-Type:     multipart/form-data   <-- boundary missing!
Content-Length:   278
Connection:       keep-alive
Host:             192.168.10.150
Accept-Encoding:  deflate
 
--c31c95a0-7b8e-4957-bad6-332063147b7d
Content-Type: application/json; charset=utf-8
Content-Disposition: form-data; name=data
 
{"Event":"system.webhooktest","Server":{"Name":"Emby Server","Id":"688f270fc7e54a6da947f20dd0ac8c29"}}
--c31c95a0-7b8e-4957-bad6-332063147b7d--
 
HTTP libraries like Python's aiohttp will fail to parse this request. 
I don't know if this is a platform specific issue (I am on FreeBSD), since the request @ posted actually includes the boundary in the header.
Edited by derstrassi
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...