Thinkai's Blog

Autohotkey|Python|php|aardio|VOIP|IT 爱好者

QQ影音视频批量获取剧情缩略图 Autohotkey 11521

作者为 发表

Autohotkey

QQ影音5.x新版代码: 

;ControlSend, ahk_parent, !s, ahk_class TXGuiFoundation ahk_exe QQPlayer.exe
;ExitApp
#Persistent
#SingleInstance
SetTitleMatchMode, 2
;配置信息
;播放器路径
IfExist, D:\Program Files (x86)\Tencent\QQPlayer\qqplayer.exe
    QQplayer_path = D:\Program Files (x86)\Tencent\QQPlayer\qqplayer.exe
IfExist, c:\Program Files (x86)\Tencent\QQPlayer\qqplayer.exe
    QQplayer_path = c:\Program Files (x86)\Tencent\QQPlayer\qqplayer.exe
IfExist, D:\Program Files\Tencent\QQPlayer\qqplayer.exe
    QQplayer_path = D:\Program Files\Tencent\QQPlayer\qqplayer.exe
IfExist, c:\Program Files\Tencent\QQPlayer\qqplayer.exe
    QQplayer_path = D:\Program Files\Tencent\QQPlayer\qqplayer.exe
if QQplayer_path =
    {
    FileSelectFile, QQplayer_path, , qqplayer.exe, 请指定QQ影音主程序所在, QQPlyer.exe(*.exe)
    }
;QQ影音5.x更新,连拍张数再播放器设置里面,图片保存在个人图片文件夹下QQplayerPic文件夹内
filter = .rm,.rmvb,.mp4,.wmv,.avi,.mkv,.flv,.f4v,.ts,.3gp,.dat,.vob,.wm,.asf,.rp,.m1v,.m2p,.m2t,.m2ts,.m2v,.mp2v,.mpeg,.tp,.m4v,.m2b,.m4p,.mpeg4,.mov

FileSelectFolder, folder, , 2, 请选择一个批量剧情连拍的视频文件夹路径
if folder <>
    {
    Loop, %folder%\*.*, 0, 0
    {
		if A_LoopFileName Contains %filter%
        {
			run, `"%QQplayer_path%`" `"%A_LoopFileFullPath%`"
			WinWait, ahk_class TXGuiFoundation ahk_exe QQPlayer.exe
			WinGetTitle, oldtitle, ahk_class TXGuiFoundation ahk_exe QQPlayer.exe
			ToolTip, Found
			Loop, 10
			{
				sleep, 100
				WinGetTitle, Tt, ahk_class TXGuiFoundation ahk_exe QQPlayer.exe
				if Tt <> %oldtitle%
					Break
			}
			Sleep, 1000
			ToolTip, Ready
			ControlSend, ahk_parent, {Space}, ahk_class TXGuiFoundation ahk_exe QQPlayer.exe
			ToolTip, Pause
			Sleep, 1000
			;ControlSend, ahk_parent, !s, ahk_class TXGuiFoundation ahk_exe QQPlayer.exe
			ControlSend, ahk_parent, {Alt Down}s{Alt Up}, ahk_class TXGuiFoundation ahk_exe QQPlayer.exe
			ToolTip, MuiltiShot
			Sleep, 30000 ;等待30秒
			Pause
        }
    }
    MsgBox, 64, 提示, 剧情连拍批处理完毕!
    }
Return

 QQ影音老版本代码:

#Persistent
#SingleInstance
SetTitleMatchMode, 2
;配置信息
;播放器路径
IfExist, D:\Program Files (x86)\Tencent\QQPlayer\qqplayer.exe
	QQplayer_path = D:\Program Files (x86)\Tencent\QQPlayer\qqplayer.exe
IfExist, c:\Program Files (x86)\Tencent\QQPlayer\qqplayer.exe
	QQplayer_path = c:\Program Files (x86)\Tencent\QQPlayer\qqplayer.exe
IfExist, D:\Program Files\Tencent\QQPlayer\qqplayer.exe
	QQplayer_path = D:\Program Files\Tencent\QQPlayer\qqplayer.exe
IfExist, c:\Program Files\Tencent\QQPlayer\qqplayer.exe
	QQplayer_path = D:\Program Files\Tencent\QQPlayer\qqplayer.exe
if QQplayer_path =
	{
	FileSelectFile, QQplayer_path, , qqplayer.exe, 请指定QQ影音主程序所在, QQPlyer.exe(*.exe)
	}
;保存路径
FileSelectFolder, SavePath, , 1, 选择截图保存的目录
;保存文件尾巴
InputBox, Filetail, 保存文件尾巴,请输入,留空不添加。
;筛选格式
filter = .rm,.rmvb,.mp4,.wmv,.avi,.mkv,.flv,.f4v,.ts,.3gp,.dat,.vob,.wm,.asf,.rp,.m1v,.m2p,.m2t,.m2ts,.m2v,.mp2v,.mpeg,.tp,.m4v,.m2b,.m4p,.mpeg4,.mov
;几格X
InputBox, a, 输入,横向几个预览
InputBox, b, 输入,纵向几个预览
oldtitle =
IfNotExist, %SavePath%
FileCreateDir, %SavePath%
;初始化完毕
FileSelectFolder, folder, , 2, 请选择一个批量剧情连拍的视频文件夹路径
if folder <>
	{
	run, %ComSpec% /c dir `"%folder%`" /A-D /b >`"%A_ScriptDir%\list.txt`", Hide
	Process, WaitClose, cmd.exe
	Loop
	{
	FileReadLine, line, %A_ScriptDir%\list.txt, %A_Index%
	if errorlevel
		Break
	if line Contains %filter%
		{
		run, `"%QQplayer_path%`" `"%folder%\%line%`"
		WinWait, QQ影音
		WinActivate, ahk_class QQPlayer Window
		WinGetActiveTitle, oldtitle
		Loop
		{
		sleep, 100
		WinGetActiveTitle, Tt
		if Tt <> %oldtitle%
			Break
		}
		Loop
		{
		WinActivate, ahk_class QQPlayer Window
		WinActivate, QQ影音
		WinGetActiveTitle, Title
		Send, !s
		WinWait, 另存为, , 1
		If errorlevel <> 1
			Break
		}
		WinActivate, #32770
		StringReplace, Title, Title, [高清加速开启],
		StringReplace, Title, Title, %A_Space%- QQ影音
		ControlSetText, Edit1, %SavePath%, 另存为
		ControlSend, Button2, {lbutton}, 另存为
		send, {enter}
		ControlSetText, Edit1, %title%_%Filetail%, 另存为
		ControlSetText, Edit2, %a%, 另存为
		ControlSetText, Edit3, %b%, 另存为
		WinActivate, #32770
		Clipboard =
		ControlSend, Button2, {lbutton}, 另存为
		send, {enter}
		IfWinExist, 确认另存为
			{
			WinActivate, 确认另存为
			send, y
			}
		ClipWait, , 1
		}
	}
	MsgBox, 36, 提示, 剧情连拍批处理完毕,是否打图片保存开文件夹?
	IfMsgBox, Yes
	run, %SavePath%
	}
Return



来了就留个评论吧! 1个评论




友情链接:Autohotkey中文帮助Autohotkey官网Autohotkey中文网联系作者免GooglePlay APK下载

 主题设计 • skyfrit.com  Thinkai's Blog | 保留所有权利

60 queries in 2.519 seconds |