mkweb / pupnp

PHP UPnP MediaGUI
15 stars 5 forks source link

Extracted Url for SCPDURL wrong for Samsung TV #7

Open gnanet opened 10 years ago

gnanet commented 10 years ago

Referring to the issue in miranda upnp about parsing the service list response where the SCPDURL is relative.

https://code.google.com/p/miranda-upnp/issues/detail?id=2

Same happens with pupnp the devices will never be displayed, and in the logs:

2014-08-02 23:17:46 - 127.0.0.1 - [INFO] Response: {"error":"Unable to load service XML: http:\/\/:52235\/RenderingControl1.xml"}

The reason is that the xml file shows the following snippet:

<serviceList>
  <service>
    <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
    <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
    <controlURL>/upnp/control/RenderingControl1</controlURL>
    <eventSubURL>/upnp/event/RenderingControl1</eventSubURL>
    <SCPDURL>RenderingControl1.xml</SCPDURL>
  </service>
</serviceList>

As you can see, the SCPDURL is relative. The path of the service information xml is http://:52235/dmr/SamsungMRDesc.xml, which means that the SCPDURL will become http://:52235/dmr/RenderingControl1.xml.

pupnp turns this url instead into http://:52235/RenderingControl1.xml, which is invalid.

gnanet commented 9 years ago

I have hardcoded some things for the URLs and my version works , but this hack is not a solution because it relies on the IP of my SamsungSmartTV