problem with particular website [SOLVED]

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
andy chung

problem with particular website [SOLVED]

Post by andy chung »

have already installed
- adobe flash player plugin
- ubuntu restricted extras

could play videos in most websites without problems.

but not below one,
http://cablenews.i-cable.com/webapps/pr ... d=12152381

any ideas? tks.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 4 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
grimdestripador
Level 6
Level 6
Posts: 1051
Joined: Fri Feb 16, 2007 2:26 am

Re: problem with particular website

Post by grimdestripador »

Solution:

To change your useragent in chromium. Click the wrench (or tripple lines) in the upper right hand corner. Select Tools. Select Developer Tools. Click the settings gear icon in the lower right. Click Overrides. Click User Agent Check Box. I selected Useragent for Firefox7--Windows.

Sucess!!!! I'm watching the wall street video you posted.


Explanation:
Looking into the site. I notice a javascript file is customized through php for each page load, named jw_player.php. When you go to a web site, your browser sends a user agent string. This site, customizes the content for the browser loaded. I can see why the page won't load, because they are looking for if linux and android appear in your user agent string. For example, my useragent string when using chromium is...
Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Ubuntu Chromium/24.0.1312.56 Chrome/24.0.1312.56 Safari/537.17
If you inpsect the source of jw_player.php. You notice that line 37 searches for both linux and android. It seems if the "&&" on line 37 was changed to "||" the site would work correctly.

Code: Select all

31#/*Device Detection START*/
32#function deviceDetection(){
33#	var num = 0;
34#	var userAgent = navigator.userAgent.toLowerCase();
35#	if ((userAgent.search("android") > -1)){ // Android
36#		return num=1;
37#	}else if ((userAgent.search("linux") > -1) && (userAgent.search("android") == -1)){ // Linux
38#		return num=2;
39#	}else if ((userAgent.search("ipad") > -1) || (userAgent.search("iphone") > -1) || (userAgent.search("ipod") > -1)){ // iPad/iPhone/iPodd
40#		return num=3;
41#	}else if ((userAgent.search("msie 7.0") > -1)){ // Internet Explorer 7.0 version
42#		return num=4;
43#	}
44#}
If you would like to send a bug report to them (The site is all in chineese, so am unable). Consider my following modification which is untested but expected to work.

Code: Select all

37#	}else if ((userAgent.search("linux") > -1) && ((userAgent.search("android") == -1) || (userAgent.search("i686")==-1))) { // Linux
Last edited by grimdestripador on Thu Apr 25, 2013 1:50 pm, edited 1 time in total.
andy chung

Re: problem with particular website

Post by andy chung »

thank you grimdestripador! worked for me. saved my day switching to windows back and fro. :lol:

have written to the site for the correction including the link of this thread via their contact us (in chinese) button.

have installed extensions in chrome (and firefox also) to change user agent more easily.
User avatar
grimdestripador
Level 6
Level 6
Posts: 1051
Joined: Fri Feb 16, 2007 2:26 am

Re: problem with particular website

Post by grimdestripador »

Now that i read, it seems i made a logic error when offering a solution to their code. I didn't notice the difference in use between ">-1" and "==-1". Looking at it now, it looks like the ==-1 represents 'not found'.

Either way, the solution of changing the useragent by acting like windows continues to work. I'll remember this in my bag-of-tricks, for when websites refuses to load. I've personally never had to change my user agent string before.
Locked

Return to “Sound”