- UID
- 7870
- 帖子
- 30
- 精华
- 0
- 贡献
- 0
- 推广
- 0
- 有效BUG
- 0
- 注册时间
- 2006-2-12
|
刚才看到有个网友问如何去掉内置的百度搜索,而且我自己也很想研究一下如何修改这个东西(ini里不能修改),于是用ResHacker打开TW的主程序看了看,发现不少好东西。
- var twSaveObjUrl%%s = "%%SaveObjUrl";
- var twObjectUID%%s = "%%ObjectUID";
- function GetBufferFromUrl( bufferUrl )
- {
- xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
- xmlHttp.open("GET",bufferUrl,false);
- xmlHttp.send(null);
- return xmlHttp.responseText;
- }
- function GetBufferInPost( bufferUrl,data)
- {
- xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
- xmlHttp.open("POST",bufferUrl,false);
- xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
- xmlHttp.send(data);
- return xmlHttp.responseText;
- }
- function youtubeMedia( )
- {
- strUrl = twSaveObjUrl%%s;
- if( -1 != strUrl.search( /http:\/\/.*youtube\.com\/.*/ ) )
- {
- strRet = "";
- if( -1 != strUrl.indexOf( "http://www.youtube.com/v/" ) )
- {
- strID = strUrl.replace( /http:\/\/www.youtube.com\/v\//g, "" );
- strUrl = external.twQueryHistory( "http://www.youtube.com/p.swf?" + "*" + strID + "*", false );
- strRet = strUrl.replace( /http:\/\/www.youtube.com\/p.swf\?/g, "http://www.youtube.com/get_video?" );
- }
- else
- {
- strRet = strUrl.replace( /.*\?/, "http://www.youtube.com/get_video?" );
- }
- external.twMediaPath( window, strRet );
- }
- }
- function l6roomsMedia( )
- {
- strUrl = twSaveObjUrl%%s;
- if( -1 != strUrl.search( /http:\/\/.*6rooms\.com\/.*vid=.*/ ) )
- {
- strID = strUrl.replace( /.*vid\=/g, "" );
- strBuffer = external.twQueryHistory( "http://www.6rooms.com/v2.php?" + "*" + strID + "*", true );
- if( strBuffer.length <= 0 )
- {
- strBuffer = GetBufferFromUrl( "http://www.6rooms.com/v2.php?" + strID );
- }
- if( strBuffer.length > 0 )
- {
- nStart = strBuffer.search( /\<file\>/g );
- nEnd = strBuffer.search( /\<\/.ile\>/ );
- strUrl = strBuffer.substring( nStart+6, nEnd );
- external.twMediaPath( window, strUrl );
- }
- }
- }
- function iaskMedia( )
- {
- strUrl = twSaveObjUrl%%s;
- if( -1 != strUrl.search( /http:\/\/.*iask\.com\/.*vid=.*/ ) )
- {
- strID = strUrl.replace( /.*vid\=/g, "" );
- strTempUrl = "http://v.iask.com/v_ask.php?vid=" + strID;
- strBuffer = external.twQueryHistory( strTempUrl + "*", true );
- if( strBuffer.length <= 0 )
- {
- strBuffer = GetBufferFromUrl( strTempUrl );
- }
- if( strBuffer.length > 0 )
- {
- strRet = strBuffer.replace( /.*urldown\=/g, "" );
- strTemp = decodeURIComponent( strRet );
- external.twMediaPath( window, strTemp );
- }
- }
- }
- /* code bY kkf @ 2006 .10.13
- kkf009@gmail.com
- */
- function l56Media()
- {
- strUrl=twSaveObjUrl%%s;
- if(-1!=strUrl.search(/http:\/\/www\.56\.com\/.*\.swf/))
- {
- var ObjUrl=document.getElementById(twObjectUID%%s)
- var swfType=strUrl.substr(strUrl.lastIndexOf("\/")+1);
-
- if( -1 != strUrl.indexOf( "v_player_blog_fp7_5" ) )
- strRet=ObjUrl.childNodes(1).value;
- else if( -1 != strUrl.indexOf( "v_player_site_fp7_5" ) )
- strRet=ObjUrl.childNodes(2).value;
- else
- strRet=ObjUrl.src;
- var tmp1=new Array();
- var tmp2=new Array();
- var tmp=new Array();
-
- tmp1=strRet.split("?");
- tmp2=(tmp1.length==2)?tmp1[1].split("&"):tmp1[0].split("&");
- var strVar="([^=&]+)=([^&]*)";
- var re=new RegExp(strVar,"");
-
- for(var i=0;i<=tmp2.length-1;i++)
- {
- try {
- tmp3=tmp2[i].match(re);
- tmp[tmp3[1]]=tmp3[2];
- }
- catch(e){}
- }
-
- strTemp="http:\/\/"+tmp["host"]+"\/flvdownload\/"+tmp["pURL"]+"\/"+tmp["sURL"]+"\/"+tmp["user"]+"@56.com_56flv_"+tmp["URLid"]+"\.flv";
- external.twMediaPath(window,strTemp);
- }
- }
- /* code bY kkf @ 2006 .10.20
- kkf009@gmail.com
- */
- function tudouMedia(){
- strUrl=twSaveObjUrl%%s;
- if(-1!=strUrl.search(/http:\/\/www\.tudou\.com\/.*/)){
- var srcObj = document.getElementById(twObjectUID%%s)
- strRet = srcObj.childNodes(2).value
- strBuffer = GetBufferInPost("http://www.tudou.com/player/info.php",strRet);
- strBuffer = strBuffer.replace( /.*flv\|(http:.*\.flv).*$/,"$1")
- external.twMediaPath(window,strBuffer )
- }
- }
- youtubeMedia();
- l6roomsMedia();
- iaskMedia( );
- l56Media();
- tudouMedia();
复制代码
这些代码大概是用于快速保存用的吧(Alt+左键),居然收集了这么多,可见开发组的辛苦努力了,同时也省心了不少,不用嗅探地址了。赞一个
- [General]
- K0=http://*.google.com/*?q=*
- S0=try{col=document.getElementsByName('q');external.SetSearchKey( %max_security_id,col[0].value );}catch (e) {}
- K1=http://*.baidu.com/*?*=*
- S1=try{col=document.getElementsByName('wd');var str;if( col.length )str= col[0].value;else{col=document.getElementsByName('word');if( col.length ){str = col[0].value;}}if( str.length != 0 ){external.SetSearchKey( %max_security_id,col[0].value );}} catch (e) {}
复制代码
这段不明白用处,似乎跟搜索引擎有关,不过删除掉百度的那段,打开TW还是会有,而且一切正常,请开发组指正,省的我乱改出问题了。先谢谢了。 |
|