User Agent String Spoofing

Hi guys,



Quick question: How can I change the User Agent String for Plex in a Python script to stop it sending out the default?



When I get a connection to a server Console is saying



18:04:26 T:2964090880 M:394350592 DEBUG: Curl:: Debug GET /information/ HTTP/1.1

User-Agent: Plex Firefox/2.0.0.11



and I would like to change the Firefox/2.0.0.11 bit to another Useragent.



Is there an xbmc xmbcgui etc function?



Thanks!

There is a way to spoof user agent with a Plex Media Server plug-in, but I think you’re referring to the old-style XBMC plug-ins. There may be a way to do this, but we don’t really support these plug-ins, so I’m afraid I’m not sure :frowning:



Thanks for the response. What I am trying to do at the moment is extend the PlexAeon Cinema Mode to allow for genre-based streaming from Apple Trailers at the start of a movie. Although I am using xbmc commands in my Python script at the moment I would like to be able to move this over to a proper supported Plex implementation at some point as the theory would (hopefully) be the same.
How can I interact with the Media Server - is there somewhere you could direct me to read up on it :-)

Thanks again.

Plex’s plug-in system is totally different to XBMC’s. Our plug-ins are for the media server, not Plex itself. You can check out the code for any existing plug-ins by looking in “~/Library/Application Support/Plex Media Server/Plug-ins”, and there’s some documentation over at http://dev.plexapp.com. However, I’m not sure how much luck you’ll have in porting the Cinema Mode script over - Plex’s plug-ins focus more on providing content and metadata, they don’t have the same level of integration with the client as XBMC’s scripts do.



I see, in that case in what file is the user agent "Plex Firefox/2.0.0.11" defined for Plex? What file would I have to edit in the Plex system files to get this running on my machine at the moment?

Thanks


FileCurl.cpp:411

If it's helpful, we can read this from advanced settings in the future.


Thanks very much for that, I'll go and investigate. :D

The ability to read it from advanced settings would be a very useful addition.

Thanks again.

OK, I’ve compiled my own version of Plex with the user agent changed and the Cinema Mode works great.



Would it be possible for a change to be made that reads the user agent from the advancesettings.xml file? If so could it be something that will appear in a new version of Plex soon?



Thanks again.

It’s definitely on the list for the next version!



Sweet :lol:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.