Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cpjamloki
Visitor

User-Agent string

Hi guys,
Can anybody describe
(1)what is User-Agent string in Roku?
(2)Can i get like : Roku/DVP-5.0 (025.00E08043A)
i mean how can i get output in the complete form like Roku/DVP-5.0 (025.00E08043A).
please give some example also, because i have found some information regarding this here in forum but not understanding completely.

Thanks in advance,
0 Kudos
9 REPLIES 9
cpjamloki
Visitor

Re: User-Agent string

If anybody have any idea please share your views,it will be helpful for forums user also.
0 Kudos
adamkaz
Channel Surfer

Re: User-Agent string

Full disclosure, this is reverse engineered from the devices that I have and not necessarily correct.

The user agent string shows that you are accessing content with a roku device and provides the SW build that you are running. For example:
Roku/DVP-5.0 (025.00E08043A)

Means you are running Version 5.0 build 8043. The green characters appear to never change. I'm guessing the 02 might indicate a particular device, but I'm not sure.
0 Kudos
RokuJoel
Binge Watcher

Re: User-Agent string

This should work:

di=createobject("roDeviceInfo")
version=di.GetVersion()
version_major=mid(version,3,1)
version_minor=mid(version,5,2)
version_build=mid(version,8,5)

if version_minor.toint() < 10 then
version_minor=mid(version_minor,2)
end if
userAgent="Roku/DVP-"+version_major+"."+version_minor+" ("+version+")"
0 Kudos
belltown
Roku Guru

Re: User-Agent string

You can also set the User-Agent string to anything you want, e.g:

ui = CreateObject ("roVideoScreen")
ui.AddHeader ("User-Agent", "Apple TV - version 42")
0 Kudos
RokuJoel
Binge Watcher

Re: User-Agent string

Ha!

- Joel
0 Kudos
pir8radio
Visitor

Re: User-Agent string

I know this is an old post, but I was looking for this same info, and this is the post that came up in a google search...

I have made some corrections to the original answer as well, I'm sure by now all device values have been discovered, but I will add the ones I know of.

Roku/DVP-5.0 (025.00E08043A)

Means you are running Version 5.0 build 8043. The green characters appear to never change. The 02 indicates the device type.
03 - Roku LT
04 - Roku 3
09 - Roku Stick
victorcui96
Reel Rookie

Re: User-Agent string

@pir8radiocan you link that google search post? Also do you know if different versions of Roku present different user agent strings? For example, do user agent strings for Roku premiere differ from the user agent strings for Roku ultra?

0 Kudos
mdale
Reel Rookie

Re: User-Agent string - generating a valid UA

This seems to produce 

Roku/DVP-9.99 (999.99E99999A)
 
Don't think that is accurate? Is there an updated way to generate the UA string? 
0 Kudos
renojim
Community Streaming Expert

Re: User-Agent string - generating a valid UA

@mdale, GetVersion() is deprecated.  Use GetOSVersion().

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.