hello, i’m trying to create a simple plugin that opens a predefined list of streams, one of these streams requires to access it with a different user-agent from plex default one.
is there a way for me to change it from plugin code?
Thank you very much in advance
Francesco
yes would love to know if that works too
I think this is what you need:
def Start():<br />
...<br />
...<br />
HTTP.SetHeader('User-agent', 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5')<br />
I think you need a different approach. The code Sander posted would set the header for HTTP requests made from Python, but the way I read your post it seemed like you want to set the user agent when starting a stream from Plex. I’m not at home right now, and can’t remember exactly what the code is, but check the Apple Movie Trailers plug-in for an example (Apple doesn’t like you accessing the trailers from players that aren’t QuickTime, apparently).
Ah yes, you probably need this (MediaContainer.userAgent):
def Start():<br />
...<br />
...<br />
MediaContainer.title1 = 'Apple Movie Trailers'<br />
MediaContainer.content = 'Items'<br />
MediaContainer.userAgent = 'Apple Mac OS X v10.6.1 CoreMedia v1.0.0.10B504'<br />
MediaContainer.art = R('art-default.png')<br />
HTTP.SetCacheTime(CACHE_INTERVAL)
hmmm.... i need to send another user agent, when connecting to *.mov streams, globally, if necessary. where can i change that?!
thx
Hi!
Exactly as I posted ;) MediaContainer.userAgent configures the user agent string for requests that the videoplayer does (opening/streaming video files)
allright, do i have to work in the source and the recompile it? actually i'm not getting the point. sorry. very new to plex.
No - this is code for a media server plug-in, as detailed in the original post.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.