Working on a URL Service where the video requires a Referer HTTP Header to be set.
The service returns a Callback when MediaObjectsForURL() is called and the callback method returns an ObjectContainer containing the URL of the video to be played.
Looking at the source code for ObjectContainer, there's an undocumented property http_headers which looks like it should do the trick.
does nothing in either OSX PMC or PMS 0.9.7.28's Transcoder.
It does look like the http_headers argument is parsed on some level though as using the same property to set the UA:
http_headers = {'User-Agent': 'Mozilla/25.0 (iPad; CPU OS 6_0_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A523 Safari/8536.25'}
will successfully work for the transcoder but not PMC.
Now, I'm not too worried for the PMC as that uses LibCurl and there are other ways of setting HTTP Headers in there (|arg=value appended to the URL).
But I really would like to know how to set HTTP Headers for the transcoder.... Anyone?
Did you make the Callback function @indirect? This is an example of how things should like like, more or less:
Sadly, yes, the callback already is @indirect decorated.
My code, looks pretty much the same as your example, with the main difference being that the returned ObjectContainer is constructed inline rather than via function calls.
I've taken a look through the built-in services and the ones that do use http-headers only seem to use it to set the User-Agent string. It does work for that (well for the transcoder at least, PMCs still do their own thing...) but not any other headers.