Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
xuncv committed Nov 11, 2022
1 parent f1b916d commit 1ff3dfe
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion default.aproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<project ver="10" name="WechatVideoSniffer" libEmbed="true" icon="..." ui="win" output="WechatVideoSniffer.exe" CompanyName="单位名称" FileDescription="WechatVideoSniffer" LegalCopyright="Copyright (C) 作者 2022" ProductName="WechatVideoSniffer" InternalName="WechatVideoSniffer" FileVersion="0.0.0.05" ProductVersion="0.0.0.05" publishDir="/dist/" dstrip="false">
<project ver="10" name="WechatVideoSniffer" libEmbed="true" icon="..." ui="win" output="WechatVideoSniffer.exe" CompanyName="单位名称" FileDescription="WechatVideoSniffer" LegalCopyright="Copyright (C) 作者 2022" ProductName="WechatVideoSniffer" InternalName="WechatVideoSniffer" FileVersion="0.0.0.06" ProductVersion="0.0.0.06" publishDir="/dist/" dstrip="false">
<file name="main.aardio" path="main.aardio" comment="main.aardio"/>
<folder name="资源文件" path="res" embed="true" local="false" ignored="false">
<file name="BasicFormatsForCore.dll" path="res\BasicFormatsForCore.dll" comment="res\BasicFormatsForCore.dll"/>
Expand Down
Binary file modified dist/WechatVideoSniffer.exe
Binary file not shown.
35 changes: 31 additions & 4 deletions main.aardio
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ import win.ui;
mainForm = win.form(text="WechatVideoSniffer";right=959;bottom=591)
mainForm.add(
btnClear={cls="button";text="清空列表";left=797;top=540;right=889;bottom=580;z=5};
btnCopyUrl={cls="button";text="复制链接";left=797;top=177;right=889;bottom=211;z=6};
btnDown={cls="button";text="下载选中";left=794;top=120;right=885;bottom=157;z=4};
btnSniffer={cls="button";text="监听";left=794;top=14;right=885;bottom=51;z=1};
btnStop={cls="button";text="停止";left=794;top=70;right=885;bottom=107;z=2};
listview={cls="listview";left=17;top=15;right=787;bottom=584;edge=1;z=3}
listview={cls="listview";left=17;top=15;right=787;bottom=584;edge=1;hscroll=1;z=3}
)
/*}}*/

import dotNet

import win.clip
mainForm.listview.insertColumn( "URL",-1 )
dotNet.reference({
"FiddlerCore4" = $"res\FiddlerCore4.dll";
Expand Down Expand Up @@ -43,10 +44,27 @@ UninstallCertificate = function(){
}
return true;
}

// 视频链接过滤规则
var urls = {}
filterUrl = function(url){
if(string.find(url,"^https\:\/\/finder<mp>*\.video\.qq\.com\/251\/20302\/") or string.find(url,"mpvideo\.qpic\.cn") ){
// 去除无用链接格式
if(!!string.match(url,"token=\w+")){
if(!urls[url]){
urls[url] = true
return true;
}
}
}
return false;
}


AttachListening = function(){
Fiddler.FiddlerApplication.BeforeRequest = function(s){
s.bBufferResponse = false;
if(string.find(s.fullUrl,"^https\:\/\/finder<mp>*\.video\.qq\.com\/251\/20302\/") or string.find(s.fullUrl,"mpvideo\.qpic\.cn") ){
if(filterUrl(s.fullUrl)){
mainForm.listview.addItem( {s.fullUrl} )
}
}
Expand Down Expand Up @@ -84,12 +102,13 @@ mainForm.btnStop.oncommand = function(id,event){

mainForm.btnClear.oncommand = function(id,event){
mainForm.listview.clear()
urls = {}
}

mainForm.btnDown.oncommand = function(id,event){
var index = mainForm.listview.selIndex
if(index>0){
var url = mainForm.listview.getItemText(index,1,1024)
var url = mainForm.listview.getItemText(index,1,10240)
mainForm.btnDown.text = "下载中"
mainForm.btnDown.disabled = true
thread.invokeAndWait(
Expand All @@ -113,5 +132,13 @@ mainForm.onClose = function(hwnd,message,wParam,lParam){
UninstallFiddler()
}

mainForm.btnCopyUrl.oncommand = function(id,event){
var index = mainForm.listview.selIndex
if(index>0){
var url = mainForm.listview.getItemText(index,1,10240)
win.clip.write(url)
}
}

mainForm.show();
return win.loopMessage();

0 comments on commit 1ff3dfe

Please sign in to comment.