Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Warn
- #NoEnv
- #SingleInstance, Force
- SetWorkingDir %A_ScriptDir%
- global winTitle
- winTitle := "ahk_class ConsoleWindowClass"
- Gui,2: -DPIScale
- Gui,2:Font,s12 CYellow,Lucida Console
- Gui,2: Color,Black, Black
- ;--------------------------
- PR=%A_ScriptDir%\APP\ffmpeg.exe
- PR2=%A_ScriptDir%\APP\youtube-dl.exe
- PR3=%A_ScriptDir%\APP\wget.exe
- PR4=%A_ScriptDir%\APP\nircmd.exe
- VLC=%A_ProgramFiles%\VideoLAN\VLC\vlc.exe
- AA=%A_Desktop% ; <<< Browse search fileselectfile from here
- ;---------------------------
- edcol1=white
- btcol =Gray
- Gui,2:Add, Edit, x5 y10 w700 h80 c%edcol1% vF1,
- ;-- 2 - buttons
- Gui,2:Add,Progress, x720 y10 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gBrowse ,Browse
- ;--------------
- Gui,2:Add,Progress, x720 y60 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gConvert2 ,Convert MP3
- ;--------------
- Gui,2:Add,Progress, x10 y100 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gConvert1 ,Convert MP4
- ;--------------
- Gui,2:Add,Progress, x175 y100 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gConvertD ,DeskTop Record
- ;--------------
- Gui,2:Add,Progress, x340 y100 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gConvertS ,Download-M3u8
- ;--------------
- ;-- CHOOSE EXTRAC VIDEO to PICTURES TIMINGS (if needed)
- Gui,2:Add, Text, x500 y106 w55 h30, P-Sec:
- Gui, 2:Add, DropDownList, x565 y100 w140 vTP ,-vf fps=1||-r 0.5 -f image2|-r 0.2 -f image2 |-r 0.01979 -f image2
- Gui,2:Add,Progress, x720 y100 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gConvertP ,Extrac-Picture
- ;--------------
- ;-- CHOOSE VIDEO TIMINGS (if needed)
- edcol1=white
- btcol =Gray
- Gui,2:Add, Text, x10 y156 w110 h30, Start Time:
- Gui,2:Add, Edit, x125 y150 w100 h30 c%edcol1% vT1,00:00:00
- Gui,2:Add, Text, x230 y156 w100 h30, End Time:
- Gui,2:Add, Edit, x330 y150 w100 h30 c%edcol1% vT2,00:00:00
- Gui,2:Add, Text, x435 y156 w160 h30, V-Qulity(1-50):
- Gui,2:Add, Edit, x600 y150 w90 h30 c%edcol1% vQ,30
- Gui,2:Add,Progress, x720 y150 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gConvertT ,Cut-Video
- ;--------------
- ;-- CHOOSE YOUTUBE TIMINGS (if needed)
- edcol1=white
- btcol =Gray
- Gui,2:Add, Text, x10 y200 w110 h30, Start Time:
- Gui,2:Add, Edit, x125 y200 w100 h30 c%edcol1% vTY1,00:00:00
- Gui,2:Add, Text, x230 y200 w100 h30, End Time:
- Gui,2:Add, Edit, x330 y200 w100 h30 c%edcol1% vTY2,00:00:00
- Gui,2:Add, Text, x435 y200 w160 h30, V-Qulity(18-22):
- Gui,2:Add, Edit, x600 y200 w90 h30 c%edcol1% vQY,17
- Gui,2:Add,Progress, x720 y200 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gConvertY ,Cut-YouTube
- ;--------------
- ;-- CHOOSE OVERLAY VIDEO (if needed)
- edcol1=white
- btcol =Gray
- Gui,2:Add, Edit, x5 y250 w700 h30 c%edcol1% vF3,
- Gui,2:Add,Progress, x720 y250 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gBrowse2 ,Browse
- Gui,2:Add, Text, x10 y300 w880 h30, Overlay:10: 10 , 540: 10 , 10: 400 , 540: 400 ... , Scale = 100 , 200 , 250 , 300 , ... Note: Only File.Ext (Video.mp4)
- Gui,2:Add, Text, x10 y356 w80 h30, Scale:
- Gui,2:Add, Edit, x110 y350 w80 h30 c%edcol1% vSC,100
- Gui,2:Add, Text, x230 y356 w100 h30, Overlay:
- Gui,2:Add, Edit, x330 y350 w340 h30 c%edcol1% vOV,10: 10
- Gui,2:Add,Progress, x720 y350 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gConvertO ,Overlay Video
- ;--------------
- ;-- CHOOSE WATERMARK VIDEO (if needed)
- Gui,2:Add, Text, x10 y400 w880 h30, WaterMark:25:25 , 10:10 , 540:10 , ... , Time To= 0,20 , 10,100 , 50,200 , ... Note: Only File.png ,jpg...
- Gui,2:Add, Text, x10 y456 w100 h30, Time To:
- Gui,2:Add, Edit, x100 y450 w120 h30 c%edcol1% vPT,0,20
- Gui,2:Add, Text, x230 y456 w200 h30, Water Mark Scale:
- Gui,2:Add, Edit, x430 y450 w240 h30 c%edcol1% vPV,25:25
- Gui,2:Add,Progress, x720 y450 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gConvertPW ,Water-M-Image
- ;--------------
- ;-- CHOOSE WATERMARK TEXT VIDEO (if needed)
- Gui,2:Add, Text, x10 y500 w880 h30, WaterMark:25:25 , 10:10 , 540:10 , ... , Time To= 0,20 , 10,100 , 50,200 , ... Note: Only File.png ,jpg...
- Gui,2:Add, Text, x10 y556 w80 h30, FONT:
- Gui,2:Add, Edit, x65 y550 w100 h30 c%edcol1% vFON,Ampher.ttf
- Gui,2:Add, Text, x170 y556 w200 h30, TEXT:
- Gui,2:Add, Edit, x220 y550 w160 h30 c%edcol1% vTEXT,Text Here OR File
- Gui,2:Add, Text, x390 y556 w200 h30, FColor:
- Gui,2:Add, Edit, x460 y550 w60 h30 c%edcol1% vFONC,Red
- Gui,2:Add, Text, x528 y556 w200 h30, FSize:
- Gui,2:Add, Edit, x590 y550 w40 h30 c%edcol1% vFONS,24
- Gui,2:Add, Text, x636 y556 w200 h30, X:
- Gui,2:Add, Edit, x660 y550 w40 h30 c%edcol1% vX,10
- Gui,2:Add, Text, x705 y556 w200 h30, Y:
- Gui,2:Add, Edit, x730 y550 w40 h30 c%edcol1% vY,10
- Gui,2:Add,Progress, x790 y550 w80 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gConvertTW ,V-Text
- ;--------------
- ;--------------------------
- Extensions1 := "mp3,m4a,wav,wma,flv,vob,mp4,mpg,wmv,avi,aiff,jpg,png,bmp,tif,gif,css,pdf,zip,rar,tar,vbs,ahk,au3,m3u,m3u8,txt,reg" ;- search url this extension
- ;f1=http://nwhiker.com/wallpaper/ ;- url which contains music files
- fd=%A_ScriptDir%\My-Downloads ;- where to download
- f2=%fd%\My-Doc.txt ;- if wanted write url from each music to a file
- ifnotexist,%fd% ;- create folder
- filecreatedir,%fd%
- ifexist,%f2% ;- delete text-file if exists
- filedelete,%f2%
- ;--------------
- Gui,2:Add, Text, x10 y606 w75 h30, YOUTUBE:
- Gui, 2:Add, DropDownList, x90 y600 w120 vYG ,-a D.txt||-x|-F |-f 17|-f 18|-f 22|best|bestvideo|bestaudio|worstvideo
- Gui,2:Add,Progress, x220 y600 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gYTDL ,YOUTUBE
- ;--------------
- Gui,2:Add,Progress, x385 y600 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gDOWN ,ALL-DOWNLAOD
- ;--------------
- Gui,2:Add, Text, x550 y606 w55 h30, WGET:
- Gui, 2:Add, DropDownList, x600 y600 w110 vWG ,-i D.txt||-c |-m |-r|
- Gui,2:Add,Progress, x720 y600 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gWGET ,WGET
- ;--------------
- Gui,2:Add, Text, x10 y656 w200 h30, LOOP:
- Gui,2:Add, Edit, x60 y650 w40 h30 c%edcol1% vLOP,10
- Gui,2:Add, Text, x110 y656 w110 h30, PER SEC:
- Gui,2:Add, Edit, x190 y650 w100 h30 c%edcol1% vSEC2,60000
- Gui,2:Add,Progress, x300 y650 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gSCR ,SCREENSHOT
- ;----------------------
- Gui,2:Add,Progress, x460 y650 w150 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gVL ,IPTV-PLAYER
- ;----------------------
- Gui,2:Add,Progress, x620 y650 w160 h27 Disabled Background%btcol%
- Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gCM ,EXECUTE COMMAND
- ;--------------
- GUI,2:show, NA x20 y20 W900 h700, Drag & Drop or Browse for Video-files / Najeeb Converter And Video Cutter And Downlaoder And Record DeskTop
- return
- ;----------------------------------------------------------
- 2GuiDropFiles:
- Loop, parse, A_GuiEvent, `n
- GuiControl,2:,F1,%A_LoopField%
- return
- ;----------------------------------------------------------
- 2GuiClose:
- ExitApp
- ;----------------------------------------------------------
- Browse:
- FileSelectFile, filename,1,%aa%,Select your file,*.flv;*.mpg;*.webm;*.3gp;*avi;*.vob;*.mov;*.wmv;*.mp4;*.m4a;*.mkv
- if filename =
- return
- GuiControl,2:,F1,%filename%
- return
- Browse2:
- FileSelectFile, filename,1,%aa%,Select your file,*.flv;*.mpg;*.webm;*.3gp;*avi;*.vob;*.mov;*.wmv;*.mp4;*.m4a;*.mkv
- if filename =
- return
- GuiControl,2:,F3,%filename%
- return
- ;-------------------------------
- Convert2:
- Gui,2:submit,nohide
- SplitPath,F1,name, dir, ext, name_no_ext, drive
- Filedest=%A_ScriptDir%\Downloads\ %name_no_ext%.mp3
- if (ext="mp4" or ext="flv" or ext="mpg" or ext="webm" or ext="3gp" or ext="avi" or ext="vob" or ext="m4a" or ext="mov" or ext="wmv" or ext="mkv")
- {
- runwait,%comspec% /k %pr% -i "%f1%" -acodec libshine "%Filedest%"
- ; run,%filedest%
- }
- else
- msgbox, 262208, ,Not a desired video-extension found
- return
- ;-------------------------------
- Convert1:
- Gui,2:submit,nohide
- SplitPath,F1,name, dir, ext, name_no_ext, drive
- Filedest=%A_ScriptDir%\Downloads\ %name_no_ext%.mp4
- if (ext="mp4" or ext="flv" or ext="mpg" or ext="webm" or ext="3gp" or ext="avi" or ext="vob" or ext="m4a" or ext="mov" or ext="wmv" or ext="mkv")
- {
- runwait,%comspec% /k %pr% -i "%f1%" -c:v copy -c:a copy -y "%Filedest%"
- ; run,%filedest%
- }
- else
- msgbox, 262208, ,Not a desired video-extension found
- return
- ;-------------------------------
- ConvertD:
- Gui,2:submit,nohide
- {
- runwait,%comspec% /k %pr% -f gdigrab -framerate 30 -i desktop "%A_ScriptDir%\Downloads\DESKTOP-RECORD.mp4"
- ; run,%filedest%
- }
- return
- ;-------------------------------
- ConvertS:
- Gui,2:submit,nohide
- {
- runwait,%comspec% /k %pr% -i "%f1%" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 18 "%A_ScriptDir%\Downloads\Stream.mp4"
- ; run,%filedest%
- }
- return
- ;-------------------------------
- ConvertT:
- Gui,2:submit,nohide
- {
- runwait,%comspec% /k %pr% -i "%f1%" -ss %T1% -to %T2% -bsf:a aac_adtstoasc -vcodec copy -c copy -crf %Q% "%A_ScriptDir%\Downloads\V-CUT.mp4"
- ; run,%filedest%
- }
- return
- ;-------------------------------
- ConvertY:
- Gui,2:submit,nohide
- {
- runwait,%comspec% /k %pr2% "%f1%" --external-downloader ffmpeg --external-downloader-args "-ss %TY1% -to %TY2%" -f %QY% "%A_ScriptDir%\Downloads\V-CUT.mp4"
- ; run,%filedest%
- }
- return
- ;-------------------------------
- ConvertO:
- Gui,2:submit,nohide
- ; runwait,%comspec% /k %pr% -i %f1% -vf "movie=%f3%, scale=%sc%: -1 [inner]; [in][inner] overlay =%ov%[out] C:\Users\Najeeb\Desktop\Downloads\Video-Overlay.mp4"
- ; run,%filedest%
- run cmd.exe
- WinWait, ahk_exe cmd.exe
- Send %pr% -i %f1% -vf "movie=%f3%, scale=%sc%: -1 [inner]; [in][inner] overlay =%ov% [out]" "Downloads\OUTPUT.mp4"{Enter}
- return
- ;-------------------------------
- ConvertP:
- Gui,2:submit,nohide
- ; runwait,%comspec% /k %pr% -i %f1% -vf "movie=%f3%, scale=%sc%: -1 [inner]; [in][inner] overlay =%ov%[out] C:\Users\Najeeb\Desktop\Downloads\Video-Overlay.mp4"
- ; run,%filedest%
- run cmd.exe
- WinWait, ahk_exe cmd.exe
- Send APP\ffmpeg.exe -i %f1% %tp% "Downloads\OUT-{asc 0037}d.jpg"{Enter}
- return
- ;-------------------------------
- ConvertPW:
- Gui,2:submit,nohide
- ; runwait,%comspec% /k %pr% -i "%f1%" -i "%f3%" -filter_complex "[0:v][1:v] overlay=%pv%:enable='between(t,%pt%)'" -pix_fmt yuv420p -c:a copy "%A_ScriptDir%\Downloads\V-CUT.mp4"
- ; run,%filedest%
- run cmd.exe
- WinWait, ahk_exe cmd.exe
- Send APP\ffmpeg.exe -i "%f1%" -i "%f3%" -filter_complex "[0:v][1:v] overlay=%pv%:enable='between(t,%pt%)'" -pix_fmt yuv420p -c:a copy "Downloads\Water-Mark-PIC.mp4"{Enter}
- return
- ;-------------------------------
- ConvertTW:
- Gui,2:submit,nohide
- ; runwait,%comspec% /k %pr% -i "%f1%" -i "%f3%" -filter_complex "[0:v][1:v] overlay=%pv%:enable='between(t,%pt%)'" -pix_fmt yuv420p -c:a copy "%A_ScriptDir%\Downloads\V-CUT.mp4"
- ; run,%filedest%
- run cmd.exe
- WinWait, ahk_exe cmd.exe
- Send APP\ffmpeg.exe -i %f1% -vf drawtext=fontfile=font\%fon%:text=%text%:fontcolor=%fonc%:fontsize=%fons%:x=%x%:y=%y% "Downloads\Text-Video.mp4"{Enter}
- return
- ;------------------------------------------
- DOWN:
- Gui,2:submit,nohide
- allx=
- httpQuery(allx,F1) ;- download url ( f1 ) to a variable ( allx )
- res=
- total1=0
- while pos := RegExMatch(allx, "<a href=.*?(?=(\\|&|>))", m, A_Index=1?1:pos+StrLen(m)) ;- search lines with url's in webpage ( F1 )
- {
- stringreplace,m,m,<a href=",,all ;- remove <a href="
- stringreplace,m,m,",,all ;- remove "
- new=%f1%%m% ;- URL found in F1
- SplitPath,new, name, dir, ext, name_no_ext, drive
- if ext in %Extensions1% ;- only url's which desired extension
- {
- total1++
- res .= new "`r`n" ;- add each found line to variable RES and add EndOfLine ASCII 13/10
- }
- }
- msgbox,%res% ;- show found url's
- i=0
- if res<> ;- if variable RES is not empty
- {
- fileappend,%res%,%f2% ;- create a textfile if needed , write variable RES to a file
- fileread,RES,%f2% ;- this woul'd read the text-file (F2) if you haven't variable RES yet <<< READ a TEXT-FILE
- Loop,parse,res,`n,`r ;- read variable RES with the url's
- {
- i++
- T=%A_LoopField% ;- read each line and then download it ( splashimage is only like a message-box to see what happens )
- SplitPath,t, name, dir, ext, name_no_ext, drive
- Splashimage,,w600 x10 y130 C01 CWsilver FS10 ZH0 M2,Download I=%i% / Total=%total1% files,Now downloading=`n%name%`nTO DESKTOP`n%fd%,Escape to break,Lucida Console
- urldownloadtofile,%t%,%fd%\%name%
- Splashimage,off
- }
- ifexist,%fd%
- run,%fd% ;- open folder when download is finished
- ;run,%f2% ;- open text-file
- }
- res= ;- clear variable RES
- allx= ;- clear variable allx
- httpQuery(byref Result, lpszUrl, POSTDATA="", HEADERS="")
- {
- WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
- WebRequest.Open("GET", lpszUrl)
- WebRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
- WebRequest.Send(POSTDATA)
- Result := WebRequest.ResponseText
- WebRequest := ""
- }
- return
- ;-------------------------------
- Stop(CtrlHwnd, GuiEvent, EventInfo, ErrLevel := "") {
- msgbox "This should stop it if winTitle exists"
- if WinExist(winTitle)
- {
- msgbox "winTitle Found"
- WinActivate
- Send q
- WinWaitClose
- Run % out
- }
- }
- ;------------------------------------------
- YTDL:
- Gui,2:submit,nohide
- {
- runwait,%comspec% /k %pr2% "%f1%" %yg%
- ; run,%filedest%
- }
- return
- ;------------------------------------------
- WGET:
- Gui,2:submit,nohide
- {
- runwait,%comspec% /k %pr3% "%f1%" %wg% -P "Downloads/"
- ; run,%filedest%
- }
- return
- ;------------------------------------------
- SCR:
- Gui,2:submit,nohide
- {
- runwait,%comspec% /k %pr4% loop %lop% %sec2% savescreenshot "~$folder.nircmd$\My-PICTURES\P~$loopcount$.png"
- ; run,%filedest%
- }
- return
- ;------------------------------------------
- VL:
- Gui,2:submit,nohide
- {
- Run, %vlc% %f1%
- ; run,%filedest%
- }
- return
- ;------------------------------------------
- CM:
- Gui,2:submit,nohide
- {
- Run, "%A_ScriptDir%\COMMANDER.ahk"
- ; run,%filedest%
- }
- return
- ;============ END SCRIPT ==============
- #R::Reload
- #S::Suspend
- #P::Pause
- #ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement