本地提取网络视频的工具
发布时间:2024-10-11
发布时间:2024-10-11
本地提取网络视频的工具
最近经常看网络视频,有些视频想要保存下来,所以做了个小工具.
原理就是在ie的临时文件夹里,搜索出看过的视频,然后复制出来.
代码没什么技术含量,希望大家指点下.
代码如下:
import mouse;
import win.ui;
import win.reg;
import fsys.file;
import win.inputBox;
import fsys;
import fsys.dlg;
import process;
import win.ui.menu;
/*DSG{{*/
var winform = win.form(parent=...; right=789;text="视频简易提取工具
";bottom=503 )
winform.add(
button2={ dr=1;bottom=416;right=774;left=669;dt=1;top=373;font=LOGFONT( name="宋体";h=-12 );z=3;text="导出...";cls="button" };
combobox={ dr=1;bottom=44;text="combobox";left=673;dt=1;top=24;font=LOGFONT( name="宋体";h=-12 );right=777;z=6;
items={ };mode="dropdown";edge=1;cls="combobox" };
button={ dr=1;bottom=138;text="搜索视频
";left=669;dt=1;top=95;font=LOGFONT( name="宋体";h=-
12 );z=2;right=774;cls="button" };
button4={ dr=1;bottom=234;right=774;left=669;dt=1;top=191;font=LOGFONT( name="宋体";h=-12 );z=5;text="删除";cls="button" };
listbox={ dr=1;dl=1;bgcolor=16777215;vscroll=1;right=654;left=7;dt=1;db=1;cls="listbox";bottom=468;text="listbox";
items={ };font=LOGFONT( name="宋体";h=-12 );z=1;edge=1;top=10 };
button3={ dr=1;bottom=327;text="清空
";left=669;dt=1;top=284;font=LOGFONT( name="宋体";h=-
12 );z=4;right=774;cls="button" }
)
/*}}*/
import win.ui.statusbar;
var stat = win.ui.statusbar( winform );
http://www.77cn.com.cnbobox.oncommand = function(id,event){
//win.msgbox( http://www.77cn.com.cnbobox.text );
if(http://www.77cn.com.cnbobox.selIndex=1){
stat.setText("搜索YouTube视频");
}
if(http://www.77cn.com.cnbobox.selIndex=2){
stat.setText("搜索56视频,优酷视频,激动网视频, 腾讯视频,爆米花网视频"); }
if(http://www.77cn.com.cnbobox.selIndex=3){
stat.setText("搜索六间房视频");
}
if(http://www.77cn.com.cnbobox.selIndex=4){
stat.setText("搜索搜狐视频,爱西柚视频,太平洋电脑网视频");
}
if(http://www.77cn.com.cnbobox.selIndex=5){
stat.setText("搜索3pg视频");
}
if(http://www.77cn.com.cnbobox.selIndex=6){
stat.setText("搜索fmv视频");
}
if(http://www.77cn.com.cnbobox.selIndex=7){
stat.setText("搜索新浪视频");
}
if(http://www.77cn.com.cnbobox.selIndex=8){
stat.setText("MP3文件");
}
if(http://www.77cn.com.cnbobox.selIndex=9){
stat.setText("WMA文件");
}
}
winform.button4.oncommand = function(id,event){
//win.msgbox( winform.button4.text );
if(winform.listbox.items[winform.listbox.selIndex]){
fsys.delete(winform.listbox.items[winform.listbox.selIndex]) winform.listbox.delete()
}
else {
win.msgbox("请选择要删除的文件","提示")
}
}//endproc
http://www.77cn.com.cnbobox.clear()
http://www.77cn.com.cnbobox.add("YouTube视频")
http://www.77cn.com.cnbobox.add("56视频,优酷视频,激动网视频, 腾讯视频,爆米花网视频") http://www.77cn.com.cnbobox.add("六间房视频")
http://www.77cn.com.cnbobox.add("搜狐视频,爱西柚视频,太平洋电脑网视频")
http://www.77cn.com.cnbobox.add("手机视频")
http://www.77cn.com.cnbobox.add("其它网站视频")
http://www.77cn.com.cnbobox.add("新浪视频")
http://www.77cn.com.cnbobox.add("MP3文件")
http://www.77cn.com.cnbobox.add("WMA文件")
http://www.77cn.com.cnbobox.selIndex=1
http://www.77cn.com.cnbobox.setFocus()
searchvideo=function(file){
/*var语句声明的变量作用域限于函数内部*/
var i = fsys.getSpecial( 0x0020 )
fsys.enum( i,file,
function(dir,filename){
if(filename){
winform.listbox.add(dir ++ filename)
}
}
}
winform.button3.oncommand = function(id,event){
//win.msgbox( winform.button3.text );
for(i=1;winform.listbox.count;1){
fsys.delete(winform.listbox.items[ i ])
}
winform.listbox.clear()
}//endproc
winform.listbox.oncommand = function(id,event){
//win.msgbox( winform.listbox.text );
if(winform.listbox.items[winform.listbox.selIndex]){
file = fsys.file(winform.listbox.items[winform.listbox.selIndex]) if(file){
size = fsys.formatSize(file.size)
stat.setText("文件大小: " ++ size ++"");
file.close()
}
}
if(event==2){
if(winform.listbox.items[winform.listbox.selIndex]){
if(io.exist("\Potplayer\PotPlayerMini.exe")){
process.execute("\Potplayer\PotPlayerMini.exe",winform.listbox.items[winform.listbox.selIndex])
}
}
}//endproc
winform.button2.oncommand = function(id,event){
//win.msgbox( winform.button2.text );
if(winform.listbox.items[winform.listbox.selIndex]){
if
(string.endWith(winform.listbox.items[winform.listbox.selIndex],".f4v",true)){ var filename = fsys.dlg.save("f4v文件|*.f4v||","保存文件" )
if (filename){
if (string.right(string.lower(filename),4)!=".f4v"){ filename += ".f4v"
fsys.copy(winform.listbox.items[winform.listbox.selIndex],filename)
fsys.delete(winform.listbox.items[winform.listbox.selIndex])
winform.listbox.delete()
}
}
}
elseif
(string.endWith(winform.listbox.items[winform.listbox.selIndex],".mp4",true)){ var filename = fsys.dlg.save("mp4文件|*.mp4||","保存文件" )
if (filename){
if (string.right(string.lower(filename),4)!=".mp4"){ filename += ".mp4"
fsys.copy(winform.listbox.items[winform.listbox.selIndex],filename)
fsys.delete(winform.listbox.items[winform.listbox.selIndex])
winform.listbox.delete()
}
}
}
elseif
(string.endWith(winform.listbox.items[winform.listbox.selIndex],".3pg",true)){ var filename = fsys.dlg.save("3pg文件|*.3pg||","保存文件" )
if (filename){
if (string.right(string.lower(filename),4)!=".3pg"){ filename += ".3pg"
fsys.copy(winform.listbox.items[winform.listbox.selIndex],filename)
fsys.delete(winform.listbox.items[winform.listbox.selIndex])
winform.listbox.delete()
}
}
}
elseif
(string.endWith(winform.listbox.items[winform.listbox.selIndex],".fmv",true)){ var filename = fsys.dlg.save("fmv文件|*.fmv||","保存文件" )
if (filename){
if (string.right(string.lower(filename),4)!=".fmv"){ filename += ".fmv"
fsys.copy(winform.listbox.items[winform.listbox.selIndex],filename)
fsys.delete(winform.listbox.items[winform.listbox.selIndex])
winform.listbox.delete()
}
}
}
elseif
(string.endWith(winform.listbox.items[winform.listbox.selIndex],".hlv",true)){
var filename = fsys.dlg.save("hlv文件|*.hlv||","保存文件" )
if (filename){
if (string.right(string.lower(filename),4)!=".hlv"){ filename += ".hlv"
fsys.copy(winform.listbox.items[winform.listbox.selIndex],filename)
fsys.delete(winform.listbox.items[winform.listbox.selIndex])
winform.listbox.delete()
}
}
}
elseif
(string.endWith(winform.listbox.items[winform.listbox.selIndex],".mp3",true)){ var filename = fsys.dlg.save("mp3文件|*.mp3||","保存文件" )
if (filename){
if (string.right(string.lower(filename),4)!=".mp3"){ filename += ".mp3"
fsys.copy(winform.listbox.items[winform.listbox.selIndex],filename)
fsys.delete(winform.listbox.items[winform.listbox.selIndex])
winform.listbox.delete()
}
}
}
elseif
(string.endWith(winform.listbox.items[winform.listbox.selIndex],".wma",true)){ var filename = fsys.dlg.save("wma文件|*.wma||","保存文件" )
if (filename){
if (string.right(string.lower(filename),4)!=".wma"){ filename += ".wma"
fsys.copy(winform.listbox.items[winform.listbox.selIndex],filename)
fsys.delete(winform.listbox.items[winform.listbox.selIndex])
winform.listbox.delete()
}
}
}
elseif
(string.endWith(winform.listbox.items[winform.listbox.selIndex],".flv",true)){ var filename = fsys.dlg.save("flv文件|*.flv||","保存文件" )
if (filename){
if (string.right(string.lower(filename),4)!=".flv"){ filename += ".flv"
fsys.copy(winform.listbox.items[winform.listbox.selIndex],filename)
fsys.delete(winform.listbox.items[winform.listbox.selIndex])
winform.listbox.delete()
}
}
}
elseif
(string.left(string.lower(winform.listbox.items[winform.listbox.selIndex],13)) = "videoplayback"){
var filename = fsys.dlg.save("flv文件|*.flv||","保存文件" )
if (filename){
if (string.right(string.lower(filename),4)!=".flv"){ filename += ".flv"
fsys.copy(winform.listbox.items[winform.listbox.selIndex],filename)
fsys.delete(winform.listbox.items[winform.listbox.selIndex])
winform.listbox.delete()
}
}
}
}
else {
win.msgbox("请选择要导出的文件","提示")
}
}//endproc
winform.button.oncommand = function(id,event){ //win.msgbox( winform.button.text ); winform.listbox.clear()
if(http://www.77cn.com.cnbobox.selIndex=1){
searchvideo("videoplayback*");
}
if(http://www.77cn.com.cnbobox.selIndex=2){
searchvideo("*.flv");
}
if(http://www.77cn.com.cnbobox.selIndex=3){
searchvideo("*.f4v");
}
if(http://www.77cn.com.cnbobox.selIndex=4){
searchvideo("*.mp4");
}
if(http://www.77cn.com.cnbobox.selIndex=5){ searchvideo("*.3pg");
}
if(http://www.77cn.com.cnbobox.selIndex=6){ searchvideo("*.fmv");
}
if(http://www.77cn.com.cnbobox.selIndex=7){ searchvideo("*.hlv");
}
if(http://www.77cn.com.cnbobox.selIndex=8){ searchvideo("*.MP3");
}
if(http://www.77cn.com.cnbobox.selIndex=9){ searchvideo("*.WMA");
}
}//endproc
winform.show()
win.loopMessage();
return winform;
上一篇:典型病毒分析报告