UPDATE=20080203 /* DATE.....................2007-12-03 garry .........................Downloads YOUTUBE and automatically copies link and automatically rename RECORD to MP3 with FreeVideoToMp3Converter.exe .........................http://www.dvdvideosoft.com/download/FreeVideoToMp3Converter.exe How to use.............. start script, start youtube , copy youtube-video-link with rightclick or CTRL+C download starts automatically to c:\_YOUTUBE , automatically rename play video with black background and/ or record it to xy.mp3 saves URL ..................................................................................................... diverse links .......... http://www.muvibee.com plays 50 videos and downloads to mozillacache ........................ http://www.dvdvideosoft.com/guides/dvd/extract-audio-from-video-to-mp3.htm ........................ http://www.dvdvideosoft.com/free-dvd-video-software.htm ........................ http://www.songza.com .............. Free Video to MP3 Converter ........................................................... http://www.dvdvideosoft.com/download/FreeVideoToMp3Converter.exe http://www.dvdvideosoft.com/products/dvd/Free-Video-to-MP3-Converter.htm Use Free Video to MP3 Converter to extract audio from video files (*.avi, *mpg, *.mpg, *.mp4, *.m4v, *.mpeg, *.dvr-ms, *.wmv, *.asf, *.mov, *.qt, *.3gp, *.3g2 and *.flv) and save it as MP3 There are 3 pre-configured presets: - High Quality (MP3, 256kbps, 48000Hz, STEREO); - Standard Quality (MP3, 128kbps, 44100Hz, STEREO); - Economy Quality (MP3, 96kbps, 22050Hz, STEREO). and TRIM video ........................................................................................................ ;http://www.autohotkey.com/forum/topic14882.html */ ;---------------------------------------------------------------------- #NoEnv setworkingdir, %a_scriptdir% NAMELV =funHU_YTB_AUDIO_RECORD03 autotrim,off Settitlematchmode, 2 clipboard= MyPLAYER =%A_ProgramFiles%\K-Lite Codec Pack\Media Player Classic\mplayerc.exe ;DIRECTCUT =%A_scriptDir%\MP3DIRECTCUT\mp3directcut.exe ;record xy.ram to xy.mp3 and cut mp3 files MP3extract =%A_programfiles%\DVDVideoSoft\Free Video to Mp3 Converter\FreeVideoToMP3Converter.exe ;------------------------------------------------------ ;-- where to save downloaded videos and recorded MP3 ------- R3V=C:\_YOUTUBE ;<<<<<< save here ifnotexist,%R3V% FileCreateDir,%R3V% YOUTUBEINI=YOUTUBEINI.txt ifnotexist,%YOUTUBEINI% { IniWrite, %A_DESKTOP% , %FILERECYCLEINI% ,DefineFolder , KEY1 ;Predefined Folder IniWrite, %A_DESKTOP% , %FILERECYCLEINI% ,LastSelectedFolder , KEY1 ;Last Selected Folder } menu,S1,Add,&Set a predefined Folder,MH1 ifexist,%MP3extract% menu,S1,Add,MP3_Extractor,MH2 menu,S1,Add,&About,MH3 menu,myMenuBar,Add,Settings,:S1 gui,1:menu,MyMenuBar ;----------------------------------------------------- ;F1=http://www.funpic.hu/en.picview.php?id=32137 ;for test ;F1=http://www.youtube.com/watch?v=iCKMzrPy4t4 F1= F2= F3=ytbe.txt F4=urlkeep.txt MAXSIZE=20000 ;delete file below this size transform,S,chr,32 nothing=%S% %S% WA=%A_screenwidth% HA=%A_screenheight% SW :=(WA*95)/100 ;width guishow width SH :=(HA*90)/100 ;height TDY :=(SH*96)/100 ;Y position Textfield below when mplayerc starts Gui,1:Font, S10 CDefault, FixedSys Gui,1:add, text, x0 y0 h0 w0 vTEXT3 ,%text4% ;text is hidden , see settimer AAS4 Gui,1:Add, Text, x5 y25 w60 h20 ,URL-1 Gui,1:Add, Text, x5 y50 w60 h20 ,NAME Gui,1:Add, Text, x5 y75 w60 h20 ,URL-2 Gui,1:Add, Text, x5 y100 w60 h20 ,PROCESS Gui,1:Add, Edit, x65 y25 w530 h20 vF1,%F1% Gui,1:Add, Edit, x65 y50 w530 h20 vF2 readonly,%F2% Gui,1:Add, Edit, x65 y75 w530 h20 readonly, Gui,1:Add,Progress,x65 y100 w530 h20 vPRBAR cFF7200 Gui,1:Add,Text, x65 y100 w530 +0x200 +Center +BackgroundTrans vText22, Gui,1:Add, Button, x10 y130 w90 h25 gYOUTUBE ,YOUTUBE Gui,1:Add, Button, x110 y130 w90 h25 gFUNHU ,FUNPIC ;Gui,1:Add, Button, x310 y130 w90 h25 gCLEAR ,CLEAR Gui,1:Add,Button ,x370 y130 w110 h25 gSF ,FileSelect Gui,1:Add, Button, x500 y130 w90 h25 gBREAK ,BREAK Gui,1:Add,Button ,x13 y470 w90 h25 gVIDEO ,VIDEO Gui,1:Add,Button ,x105 y470 w90 h25 gMUSIC1 ,MUSIC1 Gui,1:Add,Button ,x213 y470 w90 h25 gPREDEF ,PREDEF Gui,1:Add,Button ,x305 y470 w90 h25 gMUSIC2 ,MUSIC2 Gui,1:Add,Button ,x410 y470 w90 h25 gURLS ,URLS Gui,1:Add,Button ,x510 y470 w90 h25 gFOLDER ,FOLDER ;Gui,1:Add,Button ,x510 y470 w90 h25 gPLAYSTOP,PLAY-STOP ;if use the ahk-command soundplay TEXT1a=RECORD (RightClick) ifexist,%MP3extract% Gui,1:add,Text, cRED x220 y500 w300 vTEXT1,%text1a% Gui,1:Add,Edit, x90 y520 w500 h25 readonly, Gui,1:Add,Edit, x90 y550 w500 h25 readonly, Gui,1:Add,Edit, x90 y580 w500 h25 readonly, ;Gui,1:Add,Button, x2 y520 w80 h25 gDELETE ,DELETE Gui,1:Add,Button ,x2 y520 w80 h25 gDNL1 ,DNL1 > Gui,1:Add,Button ,x2 y550 w80 h25 gRUN1 ,RUN1 > T1 :=570 T2 :=0 T3 :=0 T4 :=0 LSW:=T1+T2+T3+20 GSW:=LSW+30 Gui,1:Font, S12 CDefault, Verdana Gui,1:Add, ListView, x10 y170 grid r14 w%LSW% +hscroll altsubmit vA1 gA2,Name|URL1|URL2|DATE Gui,1:Font, CDefault, FixedSys LV_ModifyCol(1,T1) LV_ModifyCol(2,T2) LV_ModifyCol(3,T3) LV_ModifyCol(4,T4) GuiControl,1:Focus,F1 ;RES3=YTB 100 YTB1=YOUTUBE Gui,1:Show, x0 y0 h620 w%GSW% ,%YTB1% [100] ;<<< YOUTUBE 100 is downloadstatus gosub,video gosub,DDDD settimer,DDDD,1000 ;means goto start return ;------------------ END MENU -------------------------------------- /* PLAYSTOP: soundplay,xxyy.mp3 GuiControl,1:Disable,PLAY-STOP return */ /* MP3EXTRACT: run,%A_programfiles%\DVDVideoSoft\Free Video to Mp3 Converter\FreeVideoToMP3Converter.exe return */ ;------------------------------ MENU ------------------------------- MH1: ;preselect to search from MF= FileSelectFolder,MF,,3 if MF= return IniWrite, %MF% , %YOUTUBEINI% ,DefineFolder , KEY1 ;Predefined Folder return MH2: run,%mp3extract% return MH3: msgbox,%NAMELV%`nhttp://www.autohotkey.com return ;-------------------------------------------- SF: Gui,1:submit,nohide IniRead, DF , %YOUTUBEINI% , DefineFolder , KEY1 MF= FileSelectFolder,MF,%DF%,3 if MF= return IniWrite, %MF% , %YOUTUBEINI% ,LastSelectedFolder , KEY1 return ;------------------ LISTVIEW -------------------------------------- A2: Gui,1: Submit, NoHide Gui,1:ListView,A1 RN:=LV_GetNext("C") ;2 selected checked RF:=LV_GetNext("F") ;2 selected focused GC:=LV_GetCount() ;4 total if A_GuiEvent=Normal { if (RN="" OR RN=0) return C1= C2= C3= C4= LV_GetText(C1,A_EventInfo,1) LV_GetText(C2,A_EventInfo,2) LV_GetText(C3,A_EventInfo,3) LV_GetText(C4,A_EventInfo,4) GuiControl,1:Text,Edit4,%C1% if URLS=1 { GuiControl,1:Text,Edit5,%C2% GuiControl,1:Text,Edit6,%C3% return } if MUSIC=1 { run,%C3% ;soundplay,%C3% ;GuiControl,1:Enable,PLAY-STOP return } goto,black } if A_GuiEvent = RightClick { if (VIDEO="1" OR PREDEF="1") { LV_GetText(C3,A_EventInfo,3) ;C3=fullpath SplitPath,C3,name, dir, ext, name_no_ext, drive if ext=flv goto,record } if URLS=1 { goto,deletemultiple } return } return ;----------- END LISTVIEW -------------------------------------- ;------------------ DELETEMULTIPLE Lines in file F4 ------------------ DELETEMULTIPLE: C1x= RF = 0 RFL = Loop { RF:=LV_GetNext(RF) if RF=0 break RFL = %RF%|%RFL% LV_GetText(C1_Temp, RF, 1) C1x = %C1x%`n%C1_Temp% } if C1x != { MsgBox, 4, ,Want you delete these lines in textfile %F4%`n%C1x% ? IfMsgBox,No Return Else { Loop, parse, RFL, | { LV_Delete(A_LoopField) } filedelete,%F4% Loop % LV_GetCount() { BX1= BX2= BX3= BX4= LV_GetText(BX1,A_INDEX,1) LV_GetText(BX2,A_INDEX,2) LV_GetText(BX3,A_INDEX,3) LV_GetText(BX4,A_INDEX,4) fileappend,%BX1%;%BX2%;%BX3%;%BX4%`r`n,%F4% } } } gosub,filllist1 return ;------------------ END DELETE ------------------------------------ ;--------------- READ URLS-FILE ---------------------------------------- URLS: text1a=(Rightclick) delete lines PREDEF=0 VIDEO =0 MUSIC =0 URLS =1 R3XX =%A_scriptdir% GuiControl,1:Enable,RUN1 > GuiControl,1:Disable,PLAY-STOP GuiControl,1:Disable,URLS GuiControl,1:Enable ,VIDEO GuiControl,1:Enable ,MUSIC1 GuiControl,1:Enable ,MUSIC2 GuiControl,1:Enable,PREDEF GuiControl,1:Enable,DELETE GuiControl,1:Enable,DNL1 > GuiControl,1:Text,TEXT1,%text1a% GuiControl,1:Text,Edit4, GuiControl,1:Text,Edit5, GuiControl,1:Text,Edit6, filllist1: LV_Delete() loop,read,%F4% { LR=%A_loopreadline% if LR= continue C1= C2= C3= C4= stringsplit,C,LR,`; LV_Add("",C1,C2,C3,C4) C1= C2= C3= C4= } return ;--------------- END READ URLS ------------------------------------------ ;--------------- READ FOLDERS-CONTENT ------------------------------------ PREDEF: IniRead, MF , %YOUTUBEINI% , LastSelectedFolder , KEY1 PREDEF=1 VIDEO =0 MUSIC =0 URLS =0 R3XX=%MF% extx=flv,divx,mpg,avi GuiControl,1:Disable,PLAY-STOP GuiControl,1:Disable,PREDEF GuiControl,1:Disable,DELETE GuiControl,1:Disable,DNL1 > GuiControl,1:Disable,RUN1 > GuiControl,1:Enable,MUSIC1 GuiControl,1:Enable,MUSIC2 GuiControl,1:Enable,VIDEO GuiControl,1:Enable,URLS GuiControl,1:Text,TEXT1,RECORD (RightClick) goto,CONT03 VIDEO: text1a=RECORD (RightClick) VIDEO =1 MUSIC =0 URLS =0 PREDEF=0 R3XX=%R3V% extx=flv,divx,mpg,avi GuiControl,1:Disable,PLAY-STOP GuiControl,1:Disable,VIDEO GuiControl,1:Disable,DELETE GuiControl,1:Disable,DNL1 > GuiControl,1:Disable,RUN1 > GuiControl,1:Enable,MUSIC1 GuiControl,1:Enable,MUSIC2 GuiControl,1:Enable,URLS GuiControl,1:Enable,PREDEF GuiControl,1:Text,TEXT1,%text1a% goto,CONT03 ;--------------------------- MUSIC1: R3XX=%R3V% GuiControl,1:Disable,MUSIC1 GuiControl,1:Enable,MUSIC2 goto, skip04 MUSIC2: IniRead, MF , %YOUTUBEINI% , LastSelectedFolder , KEY1 GuiControl,1:Disable,MUSIC2 GuiControl,1:Enable,MUSIC1 R3XX=%MF% skip04: VIDEO =0 MUSIC =1 URLS =0 PREDEF=0 extx=mp3 GuiControl,1:Disable,PLAY-STOP GuiControl,1:Disable,DELETE GuiControl,1:Disable,DNL1 > GuiControl,1:Disable,RUN1 > GuiControl,1:Enable ,VIDEO GuiControl,1:Enable,URLS GuiControl,1:Enable,PREDEF GuiControl,1:Text,TEXT1,%nothing% CONT03: GuiControl,1:Text,Edit4, GuiControl,1:Text,Edit5, GuiControl,1:Text,Edit6, LV_Delete() I:=0 FSIZE:=0 Loop %R3XX%\*.*,,1 { LR=%A_LoopFileLongPath% SplitPath,LR,name, dir, ext, name_no_ext, drive if ext contains %extx% { I++ Filegettime,TM1,%LR%,C LV_Add("",A_loopfilename,TM1,LR) ;<< LR=FullPath } } LV_ModifyCol(2,"integer") LV_ModifyCol(2, "Sort") LV_Modify(LV_GetCount(), "Vis") ;scrollt nach unten return ;--------------- END READ FOLDERS-CONTENT ------------------------------------ FOLDER: run,%R3XX% return TEST: run,control desk.cpl,,3 return BREAK: reload return CLEAR: GuiControl,1:Focus,F1 GuiControl,1:Text,Edit1, GuiControl,1:Text,Edit2, GuiControl,1:Text,Edit3, GuiControl,1:,Text22, GuiControl,1:+cC8D0D4,PRBAR return FUNHU: run,http://www.funpic.hu/en.gallery.php?id=-2&s=dd&p=1 return YOUTUBE: run,http://www.youtube.com return ;-------------------------- RECORD --------------------------------- RECORD: gui,1:submit,nohide ifnotexist,%mp3extract% { msgbox,262144,,Download MP3Extract`r`nhttp://www.dvdvideosoft.com/download/FreeVideoToMp3Converter.exe return } if (RF="" OR RF=0) { msgbox,262144,,Select a row return } ifexist,%C3% { SplitPath,C3, name, dir, ext, name_no_ext, drive if ext=mp3 { msgbox, Don't record an mp3 file return } sleep,100 run,%mp3extract% winwaitactive,ahk_class TfrmMain,,5 if ErrorLevel { MsgBox, WinWait for %MP3extract% TfrmMain is timed out. return } else { send,%C3% return } return } return ;------------------ END RECORD ----------------------------------------------- ;--- run youtube -------- RUN1: Gui,1:submit,nohide if C2= return run,%C2% return ;=========================================================================== DDDD: Gui,1:submit,nohide URL1=%clipboard% if URL1 contains watch?v= goto,start2 if URL1 contains funpic goto,start2 return ;----------------------------------- START: gui,1:submit,nohide ;---------------------------------------- DNL1: Gui,1:submit,nohide if C2= return clipboard= URL1=%C2% START2: GuiControl,1:Text,Edit1,%URL1% clipboard= settimer,DDDD,off skip2: gui,1:submit,nohide ;start to search for name if URL1= { msgbox,URL is missing return } WinSetTitle,%YTB1% [100], ,%YTB1% [0] GuiControl,1:Text,Edit3, GuiControl,1:Text,Edit2, GuiControl,1:,PRBAR,%nothing% GuiControl,1:,Text22,%nothing% ;============================================================================ ;===================== FUNPIC =============================================== if URL1 contains funpic { ;-- search for URL --------------------------------- StringGetPos,VAR1,URL1,id= VAR1:=(VAR1+4) stringmid,NEW,URL1,VAR1,5 stringleft,N1,NEW,2 ;------- search for title ------------------- ;