You Are Here:

Community: Developer Discussion Boards

#1 Old changing S60 browser user agent via python - 2008-07-02, 13:15

Join Date: Jul 2008
Posts: 6
gontofe
Offline
Registered User
Hey all,

I've been trying to access the iPhone version of the BBC iPlayer on my n95 without much success.

I have python installed, and stumbled across this script for changing the browser user agent, which seemed fairly promising, but I can't get it to work (I'm a complete newbie and don't have a clue where to start), anyone got any ideas:

http://www.unfed.org/sphpblog/index....y070728-021244

Mike
Reply With Quote

#2 Old Re: changing S60 browser user agent via python - 2008-07-02, 22:47

Join Date: Mar 2003
Posts: 115
Dansco
Offline
Regular Contributor
There is a patch on the net somewhere to turn your S60 into an iPhone phone agent but it needs signing I think.
Reply With Quote

#3 Old Re: changing S60 browser user agent via python - 2008-07-02, 23:32

Join Date: Jul 2008
Posts: 6
gontofe
Offline
Registered User
Well, don't really want to get into patching the browser if it's something I can't undo. As far as I understand this just sets up a proxy that uses a different user-agent string, which is run via Python on the phone itself.

Thought this might be the place to ask!!
Reply With Quote

#4 Old Re: changing S60 browser user agent via python - 2008-07-03, 20:20

Join Date: Mar 2003
Posts: 115
Dansco
Offline
Regular Contributor
Quote:
Originally Posted by gontofe View Post
Well, don't really want to get into patching the browser if it's something I can't undo. As far as I understand this just sets up a proxy that uses a different user-agent string, which is run via Python on the phone itself.

Thought this might be the place to ask!!
No what I meant was to extract the file and use python to copy/move it mate
Reply With Quote

#5 Old Red face Re: changing S60 browser user agent via python - 2008-07-03, 22:59

Join Date: Jul 2008
Posts: 6
gontofe
Offline
Registered User


I found the patch, not sure what you mean by "extract the file and use python to copy/move it". The patch needs signing and may not be undoable. What I wanted to do was just to get this python script that I've already found set up and working, because it would be as simple as if the script's running, I have the iphone user-agent, and if it's not, normal s60 operation resumes.

Do you understand what they mean about creating an access point with the details given? Surely that will never connect to the net... Hmm... Please help!
Reply With Quote

#6 Old Re: changing S60 browser user agent via python - 2008-07-04, 05:59

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by gontofe View Post
Do you understand what they mean about creating an access point with the details given? Surely that will never connect to the net... Hmm... Please help!
Create access point with the details given: This means you need to create a new access point with the settings you are provided like ip address, authentication type, data bearer, etc.

You would need to do this manually from the connection settings.
But I am not sure if your operator would support those settings and let you connect using it.

The best would be to ask your operator if it would support it first.

Or may be you could use GPRS or Internet connection provided by the operator too.

Best Regards,
Croozeus
Reply With Quote

#7 Old Re: changing S60 browser user agent via python - 2008-07-04, 06:15

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
Quote:
Originally Posted by gontofe View Post


I found the patch, not sure what you mean by "extract the file and use python to copy/move it". The patch needs signing and may not be undoable. What I wanted to do was just to get this python script that I've already found set up and working, because it would be as simple as if the script's running, I have the iphone user-agent, and if it's not, normal s60 operation resumes.

Do you understand what they mean about creating an access point with the details given? Surely that will never connect to the net... Hmm... Please help!
hi gontofe
you cant create your access point on your own the access point is provided by the carrier or service provider.


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#8 Old Re: changing S60 browser user agent via python - 2008-07-07, 00:05

Join Date: Jul 2008
Posts: 6
gontofe
Offline
Registered User
Well, thanks for all your replies, after a lot of fiddling about today, I've worked out that the only way I've even remotely got anything to work is to:

a) create a duplicate access point to my usual access point (T-mobile internet)
b) change its proxy and ports to 127.0.0.1 and 1234
c) change the settings file to match the actual settings
d) start proxy (now using yapn.py!!) using new access
e) open browser using new access point

This clearly works to a certain extent (user agent is now changed), but 99% of sites I visit throw up a 'timeout' error! What can I do?
Reply With Quote

#9 Old Re: changing S60 browser user agent via python - 2008-07-07, 05:51

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by gontofe View Post
Well, thanks for all your replies, after a lot of fiddling about today, I've worked out that the only way I've even remotely got anything to work is to:

a) create a duplicate access point to my usual access point (T-mobile internet)
b) change its proxy and ports to 127.0.0.1 and 1234
c) change the settings file to match the actual settings
d) start proxy (now using yapn.py!!) using new access
e) open browser using new access point

This clearly works to a certain extent (user agent is now changed), but 99% of sites I visit throw up a 'timeout' error! What can I do?
Hints:

Timeout error means - the GPRS or data connection did not respond within the timeout period,

Check out the a) and b) in your steps.
Changing the ports and proxy should be the definite cause.

Br,
Croozeus
Reply With Quote

#10 Old Re: changing S60 browser user agent via python - 2008-07-07, 12:12

Join Date: Jul 2008
Posts: 6
gontofe
Offline
Registered User
Well, currently using 149.254.201.132:8080 (the same as the T-Mobile access point) in the .conf file, and 127.0.0.1:1234 in the access point, as per the instructions.

Where could I be going wrong? These details are the same as the original access point, which is working!
Reply With Quote

#11 Old Re: changing S60 browser user agent via python - 2008-07-14, 22:59

Join Date: Mar 2003
Posts: 2
jofrepalau
Offline
Registered User
Hi,
I had a look at the script and I see is mono thread. PC web browsers are multithread, that means that while they download a web page they start downloading the images or associated files. If mobile web browsers are able to handle multiple connections at the same time, that script will produce several timeouts. I did several "proxy" scripts too and I had always to use multiple therads to solve this issues.
Jofre
Reply With Quote

#12 Old Re: changing S60 browser user agent via python - 2008-07-15, 00:04

Join Date: Jul 2008
Posts: 6
gontofe
Offline
Registered User
Well, it's working for some people, lol!

Can you share your proxy scripts? I'm only really looking to keep all connection details the same, but just change the user-agent...

Please let me know


Mike
Reply With Quote

#13 Old Re: changing S60 browser user agent via python - 2008-07-15, 05:45

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
Quote:
Originally Posted by jofrepalau View Post
Hi,
I had a look at the script and I see is mono thread. PC web browsers are multithread, that means that while they download a web page they start downloading the images or associated files. If mobile web browsers are able to handle multiple connections at the same time, that script will produce several timeouts. I did several "proxy" scripts too and I had always to use multiple therads to solve this issues.
Jofre
Hi jofrepalau
first of all welcome to the python discussion boards.
i think your point is really correct may be that is the only reason for getting a time out error.


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#14 Old Re: changing S60 browser user agent via python - 2008-07-15, 15:49

Join Date: Mar 2003
Posts: 2
jofrepalau
Offline
Registered User
give me some time to get used to Python and I´ll see if these can be ported
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
UA Profile and Accept headers for S60 3rd Ed. FP 1 Browser Nokia Ron General Browsing 5 2009-10-07 21:43
HTTP headers for S60 3rd Ed. Browser Nokia Ron General Browsing 16 2009-09-22 15:28
N80 User Agent issues roy_bhaskar General Symbian C++ 1 2007-08-24 23:04
Problems in the Browser( iBrCtlInterface) of S60 3rd Fp1 manasi_d General Symbian C++ 5 2007-06-27 14:35
a question about the user agent string jackchang1@gmail.com Mobile Java General 3 2005-09-19 13:06

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia