AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

youtube video save and audio record
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
garry



Joined: 19 Apr 2005
Posts: 1557
Location: switzerland

PostPosted: Wed Dec 13, 2006 10:29 am    Post subject: youtube video save and audio record Reply with quote

I'll should modify examples below they NOT WORK (youtube changes often )
easier example ( updated ) ,
download youtube and automatic rename to:

--namexy.mp4 ( if high quality exist )
or
--namexy.flv

and convert to :
--namexy.mp3

http://www.autohotkey.com/forum/topic34932.html
===============================================




MODIFIED=20080802

youtube often change, check testscript below
if you have no succes check the firewall (maybe blocks download)
or use the small testcript below


can try also (TV embed) :
http://www.autohotkey.com/forum/topic27264.html



Quote:

How to download youtube:
start this script, start Youtube, maybe push escape (minimize script)
copy video link with rightclick, script starts, watch video with black background
push button Download to download this video







Code:

MODIFIED=20080802 v02
NAME22  =20080802_IE_YTB

/*

How to use=
Download/play Youtube video by right click (copy link) in youtube

*/



#NoEnv
#SingleInstance force

SetBatchLines,-1
setworkingdir, %a_scriptdir%


ifnotexist,lbbrowse3.dll
   goto,LBBROWSE3


SetTitleMatchMode, 2
DetectHiddenText,on
DetectHiddenWindows, on
SetKeyDelay, 100

transform,S,chr,32
   transform,ten,chr,10
   transform,tre,chr,13
   CF=%TRE%%TEN%

INPUTINI=%a_scriptdir%\INPUTINI.txt

;---------- example start first jim reeves ---------------
ifnotexist,%inputini%
 IniWrite,http://www.youtube.com/watch?v=ztHcGoSS_vA , %inputini% ,SearchURL , KEY1


REC=C:\_RECORDED1                     ;<<<<<<    save here
ifnotexist,%R3V%
FileCreateDir,%R3V%


;-----------------------------------------------------------
lbbHandle := DllCall("LoadLibrary", "str", "lbbrowse3.dll")
;-------- 4GUI ---------------------------------------------
WA=%A_screenwidth%
HA=%A_screenheight%

SW1 :=(WA*99.5)/100    ;width    guishow width
SH1 :=(HA*95)/100      ;height
YB1 :=(SH1*96)/100     ;y-button last line
YB2 :=(SH1*92)/100     ;y-button last line-1
YB3 :=(SH1*88)/100     ;y-button last line-2
YB5 :=(SH1*70)/100     ;y-button last line-x

;-- position from picture -----
X1 :=(WA*23 )/100
Y1 :=(HA*10 )/100
WD :=(WA*53 )/100
HG :=(HA*52 )/100

;------------------------------
Gui,4:Color,000000
;Gui,4:Color,teal

Gui,4:add,button,x10   y%YB1% h20 w100 gATT11      ,YOUTUBE
Gui,4:add,button,x120  y%YB1% h20 w100 gDownload2  ,DOWNLOAD
Gui,4:add,button,x230  y%YB1% h20 w100 gRecorded   ,RECORDED

Gui,4:add,button,x10   y%YB2% h20 w100 gYTT1       ,SONG1
Gui,4:add,button,x560  y%YB2% h20 w100 gSTOP1      ,STOP

Gui,4:Font,S16 cyellow, Verdana
Gui,4:Add,Text,center x0  y%YB5%  w%SW1% vAL1,%new2%

Gui,4:Show, x0 y0 h%SH1% w%SW1%,%name22%_%MODIFIED%
WinGet, mainGuiHandle, ID, A

IniRead,URL1, %inputini% , Searchurl   , Key1

URLX=about:blank
DLLCall("lbbrowse3\CreateBrowser","uint",mainGuiHandle,"Int",X1,"Int",Y1,"Int",WD,"Int",HG,"Str",URLX,"Int",1)
DllCall("lbbrowse3\ShowStatusbar","int",0)
;DLLCall("lbbrowse3\MoveBrowser","Int",10,"Int",Y1,"Int",WD,"Int",HG)
OnExit, Cleanup

NOTHING=
if URL1<>%NOTHING%
  gosub,download1

settimer,AAS1,1500
Return



;------------ TEST -----------------------------------------
YTT1:
URL1=http://www.youtube.com/watch?v=B6W6WtJS6Dk      ;teresa teng pearly shells
gosub,download1
return



;----------------------- BUTTONS ---------------------------------
ATT11:
run,http://www.youtube.com/results?search_query=jim+reeves&search_type=
return

Recorded:
run,%R3V%
return
;-----------------------------------------------------------------





;========================  YOUTUBE =========================================
;------------- TIMER ------------------------------
AAS1:
URL1=%clipboard%
if URL1 contains http://www.youtube.com/watch?v=
    goto,download1
return
;---------------------------------------------------




STOP1:
GuiControl,4:Text,AL1,
AXX=about:blank
DllCall("lbbrowse3\Navigate", "str",AXX)
DLLCall("lbbrowse3\MoveBrowser","Int",0,"Int",0,"Int",0,"Int",0)
return





;------------------------------ GETTITLE and 2nd-URL ----------------------
DOWNLOAD1:
Gui,4:Show,restore
Gui,4:submit,nohide
    settimer,AAS1,OFF
;stringreplace,URL1a,URL1,/watch?v=,/v/,all
clipboard=
IniWrite,%URL1% , %inputini% ,SearchURL , KEY1



F1  =%A_scriptdir%\YTB1.txt
Splashimage,,b w600 h30  CWteal m9 b fs10 zh0,DOWNLOAD >>> %URL1%
UrlDownloadToFile,%URL1%,%F1%
Splashimage, off


   Fileread,AA,%F1%
   stringreplace,AA,AA,%TEN%,%CF%,all
   filedelete,%F1%
   Fileappend,%AA%`r`n,%F1%



CONTEN=var fullscreenUrl =
;VANAF1=watch_fullscreen?fs=1&e=h&video_id=
VANAF1=&video_id=
;UNTIL1=&hl=
UNTIL1=&title=
VANAF2=&title=
UNTIL2=';


V=0
   Loop,Read,%F1%
      {
      LR=%A_LoopReadLine%
      ifinstring,LR,%CONTEN%
             {
             StringGetPos,VAR1,LR,%VANAF1%
             StringGetPos,VAR2,LR,%UNTIL1%
             VAR1:=(VAR1+11)
             VAR2:=(VAR2+1)
             VAR3:=(VAR2-VAR1)
             VAR4=http://www.youtube.com/get_video?video_id=
             stringmid,ADRESS,LR,VAR1,VAR3
             URL2=%VAR4%%ADRESS%                         ;<<<< new adress URL2
             ;msgbox,url2=%URL2%
             ;return

             StringGetPos,VAR11,LR,%VANAF2%
             StringGetPos,VAR12,LR,%UNTIL2%
             VAR11:=(VAR11+8)
             VAR12:=(VAR12+1)
             VAR13:=(VAR12-VAR11)
             stringmid,TITLE,LR,VAR11,VAR13

             stringreplace,TITLE,TITLE,quot,%S%,all
             stringreplace,TITLE,TITLE,&quot,%S%,all
             stringreplace,TITLE,TITLE,&amp,%S%,all
             ;stringreplace,TITLE,TITLE,-,%S%,all
             stringreplace,TITLE,TITLE,ç,c,all
             stringreplace,TITLE,TITLE,é,e,all
             stringreplace,TITLE,TITLE,è,e,all
             stringreplace,TITLE,TITLE,ñ,n,all
             stringreplace,TITLE,TITLE,ã,a,all

             stringreplace,TITLE,TITLE,ç,c,all     ;ç
             stringreplace,TITLE,TITLE,ã,a,all     ;ã
             stringreplace,TITLE,TITLE,ö,oe,all    ;ö
             stringreplace,TITLE,TITLE,é,e,all     ;é
             stringreplace,TITLE,TITLE,Ã,a,all      ;à

             ;F2=%TITLE%.flv                             ;<<<< found name
               break
             }
        }

; ---  in name should be removed all special characters
gosub,removechr

GuiControl,4:Text,AL1,%new2%

   gosub,BACKGROUND1
   C3=%URL1%
   stringreplace,C3,C3,/watch?v=,/v/,all

   aa4=
   (
   <object width="%W2%" height="%H2%"> <param name="movie" value="%C3%"> </param> <embed src="%C3%" type="application/x-shockwave-flash" width="%W2%" height="%H2%"> </embed> </object>
   )

   gosub,skip2
   DLLCall("lbbrowse3\MoveBrowser","Int",X2,"Int",Y2,"Int",W2,"Int",H2)
   DllCall("lbbrowse3\Navigate", "str",M3)

settimer,AAS1,ON
return

;-----------------------------------------------------------------------------------


;-------------------------- DOWNLOAD YOUTUBE VIDEO ---------------------------------
DOWNLOAD2:
Gui,4:submit,nohide
YTBDNL:
if URL2=
   {
   msgbox, YOUTUBE URL to download is missing
   return
   }


;Splashimage,,b w600 h30  CWlime m9 b fs10 zh0,DOWNLOAD >>> %F2%
SplashImage,Download,CWLIME x%X20% y%Y27% h25 w700 m2,DOWNLOAD >>> %F2%
URLDownloadToFile,%URL2%,%REC%\%F2%
Splashimage, off

W3:=(W2)
H3:=(H2)


C3=file:///%REC%\%F2%
 stringsplit,GX,F2,`.
 name1=%GX1%

    ;-------- clear DLLHTML -----------
    W5=0
    H5=0
    DLLCall("lbbrowse3\MoveBrowser","Int",X2,"Int",Y2,"Int",W5,"Int",H5)
    ;DllCall("lbbrowse3\EnableBrowser","int",0)
    AX1=about:blank
    DllCall("lbbrowse3\Navigate", "str",AX1)
    sleep,100

goto,skip1
return
;----------------------------------------------------------------------------------





;---------- GOSUB remove special characters from video name ----------------------
REMOVECHR:
autotrim,off
new2=
Loop,Parse,TITLE
         {
         A:=(Asc(A_LoopField))
         B:=chr(a)
         if (B="_" OR B=" " OR B="-")     ;allow _space   autotrim,off
         Goto,SKIP8
         if ((a<48 or a>57) AND A<65 OR A>90 AND A<97 OR A>122)
         continue
         SKIP8:
         new2=%new2%%b%
         }


    stringmid,ANOW1,A_NOW,1,12    ;not readable chinese...
    if new2=
       {
       new3=_%ANOW1%.flv
       F2=%new3%
       return
       }


  new3=%new2%.flv
  F2=%new3%
  ifexist,%REC%\%F2%
      F2=_%ANOW1%_%F2%
return
;========================  END YOUTUBE ============================================





SKIP1:
TELEVISION:
GuiControl,2:Text,AL1,
gosub,background1

aa4=
(
  <center>
  <h1>%Name1%</h1>
      <param name="url" value="%C3%" />
      <param name="autostart" value="true" />
      <param name="uimode" value="mini" />
      <embed
        type="video/x-ms-wmv"
        src="%C3%"
        width="%W3%" height="%H3%"
        autostart="True"
        uimode="mini">
      </embed>
    </object>
)

gosub,SKIP2

DLLCall("lbbrowse3\MoveBrowser","Int",X2,"Int",Y2,"Int",W2,"Int",H2)
DllCall("lbbrowse3\Navigate", "str",M3)
return
;===============================================================================


;========================= SKIP2 =============================================
SKIP2:
Gui,2:submit,nohide
M3   =%A_scriptdir%\TEST.htm
ifexist,%M3%
   filedelete,%M3%

e1=
(
<HTML>
<HEAD>

<TITLE>MAP_TEST</TITLE>
</HEAD>
<BODY>

<style type="text/css">
  body {
       background-color: #008080;
       margin:  0px;
       padding: 0px;
       color: #fff;
       overflow-y: hidden;
       overflow-x: hidden;
       }
</style>

%AA4%

</BODY>
</HTML>
)

stringreplace,A,e1,%TEN%,%CF%,all
Fileappend,%A%`r`n,%M3%
return
;===============================================================================







BACKGROUND1:
;----  size from background-screen ------------------
X2 :=(X1)
Y2 :=(Y1)
W2 :=(WA*58)/100  ;width
H2 :=(HA*51)/100  ;height

;----- size from television inside background -------
W3 :=(WA*57)/100  ;width
H3 :=(HA*45)/100  ;height

;--------------------------------------
return












;---------- CLOSE -----------------------------------------------
cleanup:
4GuiClose:
  Gui, Destroy
  DllCall("lbbrowse3\DestroyBrowser")
  DllCall("FreeLibrary", "UInt", lbbHandle)
ExitApp
;------------------------------------------------------------------------------------------------






;======= Download lbbrowse3.dll  ==========================
LBBROWSE3:
{
   text31=
(
Download
-lbbrowse3.dll

from
http://www.alycesrestaurant.com/lbbrowse.htm

Want you download this program ?
)
msgbox, 262180, Start URL,%text31%
ifmsgbox,NO
   {
   exitapp
   return
   }
else
   {
   ;run,http://www.alycesrestaurant.com/lbbrowse.htm
   run,http://www.alycesrestaurant.com/zips/browsdll3.zip
   exitapp
   return
   }
}
;======================================================







;------------------- ESCAPE -------------------------------------
~esc::
Gui,4:Show,minimize
return









OTHER SCRIPTS=
Quote:

DATE.....................2007-12-11 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



Quote:
DATE.....................2007-12-03 garry
.........................Download YOUTUBE and RECORD to MP3

MP3DirectCut 2.03 .......http://www.mpesch3.de/
and also mpglib.dll and lame_enc.dll (F12) for record flv.. to MP3
http://www-users.york.ac.uk/~raa110/audacity/lame.html
http://www.autohotkey.net/~garry/WGETSTREAMMP3DIRECTCUT.zip

How to use..............


start script, start youtube ,
copy youtube-video-link with rightclick or CTRL+C
download starts automatically to c:\_YOUTUBE , automatically rename

can play video and/ or record it to xy.mp3 >> needs mp3directcut.exe/mpglib.dll/lame_enc.dll (see links above)
records to the same name then video





Download script :
version with videoToMP3converter [modified]
http://www.autohotkey.net/~garry/YOUTUBE03.ahk

with mp3directcut
http://www.autohotkey.net/~garry/funHU_YTB_AUDIO_RECORD02.ahk


other
http://www.autohotkey.com/forum/topic27264.html


---------------------------------------
Download videoToMP3converter:
http://www.dvdvideosoft.com/download/FreeVideoToMp3Converter.exe

Download mp3directcut.exe :
http://www.autohotkey.net/~garry/WGETSTREAMMP3DIRECTCUT.zip
--------------------------------------



TESTSCRIPT:
Code:

URL1=http://www.youtube.com/watch?v=siJLeHAnZIk    ;fmt=22 chinese 1080HD Widescreen
;URL1=http://www.youtube.com/watch?v=DJZv_U0zGGI   ;fmt=18 Ek verlang na jou
;URL1=http://www.youtube.com/watch?v=lH8Xcqvs3JM    ;fmt=35 China tango   (flv) needs httpquery here fmt=18
;URL1=http://www.youtube.com/watch?v=3ujBjUriUjI    ;jim reeves
;URL1=http://www.youtube.com/watch?v=WR59yE0w2P8   ;Solidao
;URL1=http://www.youtube.com/watch?v=zlfKdbWwruY   ;fmt=22 Matt
;URL1=http://www.youtube.com/watch?v=Zd8f9Zqap6U   ;US elect
;URL1=http://www.youtube.com/watch?v=wUPcimeiqLE   ;fmt=22 big buck bunny 720p
;URL1=http://www.youtube.com/watch?v=kRTZoHTK608   ;Yao Lee
;URL1=http://www.youtube.com/watch?v=n9l3bX-xWxQ   ;SULLE SALAISUUDEN KERTOA MÄ VOISIN
;URL1=http://www.youtube.com/watch?v=SH6wgK-A6Q8   ;Molbavello Dhou Goa India
;URL1=http://www.youtube.com/watch?v=QA7euN0KgWk   ;Lee Hsiang Lan / Li Xiang Lan / Shirley Yamaguchi / Yoshiko Otaka
;URL1=http://www.youtube.com/watch?v=IHzIItZKmD8   ;Ye Lai Xiang
;URL1=http://www.youtube.com/watch?v=qicARYcTe6w   ;hd=1 / fmt=22
;URL1=http://www.youtube.com/watch?v=J7noYuasI3k   ;vira velho
;URL1=http://www.youtube.com/watch?v=RVLJw-YL7y0


MODIFIED=20090823
;---- testscript ----------
;---- smaller with regex --
setworkingdir, %a_scriptdir%
   transform,S,chr,32
   transform,ten,chr,10
   transform,tre,chr,13
   CF=%TRE%%TEN%
   nothing=

F1=%A_scriptdir%\ytb3.txt

Splashimage,,b w600 h30  CWteal m9 b fs10 zh0,DOWNLOAD >>> %URL1%
UrlDownloadToFile,%URL1%,%F1%
Splashimage, off

   Fileread,AA,%F1%
   stringreplace,AA,AA,%TEN%,%CF%,all
   filedelete,%F1%
   Fileappend,%AA%`r`n,%F1%


HD4=0
SEARCHFOR=var isHDAvailable = true
   Loop,Read,%F1%
      {
      if A_LoopReadLine contains %SEARCHFOR%
             {
             HD4=1
             break
             }
      }

SEARCHFOR=<meta name="title" content=
   Loop,Read,%F1%
      {
      LR=%A_LoopReadLine%
      if LR contains %SEARCHFOR%
             {
             stringmid,LR2,LR,29,200
             title=%LR2%
             stringreplace,TITLE,TITLE,">,%nothing%,all
             title=%title%
             stringreplace,TITLE,TITLE,`&amp`;quot`;,%S%,all         ;`"
             stringreplace,TITLE,TITLE,`&amp`;amp`;,%S%and%S%,all    ;`&
             stringreplace,TITLE,TITLE,`',%nothing%,all
             stringreplace,TITLE,TITLE,`;,%nothing%,all

             ; ---- replace at least portuguese letters --
             stringreplace,TITLE,TITLE,&quot,%S%,all
             stringreplace,TITLE,TITLE,quot,%S%,all
             stringreplace,TITLE,TITLE,&amp,%S%,all
             stringreplace,TITLE,TITLE,ç,c,all
             stringreplace,TITLE,TITLE,é,e,all
             stringreplace,TITLE,TITLE,è,e,all
             stringreplace,TITLE,TITLE,ñ,n,all
             stringreplace,TITLE,TITLE,ã,a,all

             stringreplace,TITLE,TITLE,ç,c,all     ;ç
             stringreplace,TITLE,TITLE,ã,a,all     ;ã
             stringreplace,TITLE,TITLE,ö,oe,all    ;ö
             stringreplace,TITLE,TITLE,é,e,all     ;é
             stringreplace,TITLE,TITLE,Ã,a,all      ;à
             break
             }
      }
TITLE=%title%


t=
plid=
video_id=
add1=

CONTEN=var swfArgs
SEARCHFOR="t":,"plid":,"video_id":

   Loop,Read,%F1%
      {
      LR=%A_LoopReadLine%
      ifinstring,LR,%CONTEN%
             {
             Loop, Parse,LR ,`, ,`
                {
                H%A_Index%  := A_LoopField
                if H%A_Index% contains %searchfor%
                   T%A_Index%:=A_LoopField
                if T%A_Index%<>
                   HSS=%HSS%%A_LoopField%&
                if A_loopfield contains "t"
                   t=%A_LoopField%
                if A_loopfield contains "video_id"
                   video_id=%A_LoopField%
                if A_loopfield contains "plid"
                   plid=%A_LoopField%
                H%A_Index%=
                T%A_index%=
                }
             break
            }
       }

stringreplace,plid,plid,"plid":%S%,%nothing%,all
stringreplace,video_id,video_id,"video_id":%S%,%nothing%,all
stringreplace,t,t,"t":%S%,%nothing%,all
stringreplace,t,t,`%3D,%nothing%,all

stringreplace,t,t,",%nothing%,all
stringreplace,plid,plid,",%nothing%,all
stringreplace,video_id,video_id,",%nothing%,all


HSS2=video_id=%video_id%&l=%plid%&t=%t%
URL2a=http://www.youtube.com/get_video?%HSS2%

URL2=http://www.youtube.com/get_video?%HSS2%

if HD4=1
   add1= =&fmt=22
  else
   add1= =&fmt=18

URL2=http://www.youtube.com/get_video?%HSS2%%add1%
gosub,removechr
;msgbox,URL2=%URL2%`nF2=%F2%
;return

Splashimage,,b w800 h30  CWlime m9 b fs10 zh0,DOWNLOAD >>> %F2%
URLDownloadToFile,%URL2%,%F2%
Splashimage, off
run,%F2%
exitapp


;---------- GOSUB remove special characters from video name ----------------------
REMOVECHR:
autotrim,off
new2=

Loop,Parse,TITLE
         {
         A:=(Asc(A_LoopField))
         B:=chr(a)
         if (B="_" OR B=" " OR B="-")     ;allow _space   autotrim,off
         Goto,SKIP8
         if ((a<48 or a>57) AND A<65 OR A>90 AND A<97 OR A>122)
         continue
         SKIP8:
         new2=%new2%%b%
         }

    autotrim,on
    stringmid,ANOW1,A_NOW,1,12    ;if not readable chinese...
    anow1=%anow1%
    new2=%new2%
    if new2=
       {
          if fmtnew=35
            new3=_%ANOW1%.flv
          else
            new3=_%ANOW1%.mp4
       F2=%new3%
       return
       }


  if fmtnew=35
     new3=%new2%.flv
  else
    new3=%new2%.mp4
  F2=%new3%
  ifexist,%REC%\%F2%
      F2=_%ANOW1%_%F2%
return
;========================  END YOUTUBE ============================================



~esc::exitapp






other ideas
Quote:

How To .... download 50 music-videos while watching/listening them .....
===========================================================================

example run:
http://www.muvibee.com/watch/?q=jim+reeves&t=all
shows 50 videos
click on the first play button
they are saved to mozilla firefox cache
or
IE IndexDat

remark:
if you want just save ,click play and wait until progress bar is 100%
and then click the next video


can get the videos with script:
FireFoxCache-copy:
http://www.autohotkey.com/forum/topic25694.html


IE_indexDat-read/Firefox-Cache :
http://www.autohotkey.com/forum/topic25556.html


scripts to automatically save video when copied url in youtube and convert to MP3:
http://www.autohotkey.com/forum/topic14882.html

===========================================================================



FREEWARE=
Quote:

very good freeware instead of this script , I've combined with videoToMP3converter
http://www.dvdvideosoft.com/free-dvd-video-software.htm

* Free YouTube to iPod and PSP Converter 2.8.2.1(recently updated)
* Free Video to Flash Converter 3.1.2.1(recently updated)
* Free YouTube to MP3 Converter 2.4.2.1(recently updated)
* Free DVD Decrypter 1.2.2.1(just released)
* Free 3GP Video Converter 2.4.2.1(recently updated)
* Free Video Flip and Rotate 1.2.2.1(just released)
* Free YouTube Download 1.2.2.1(just released)
* Free YouTube Uploader 1.5.2.1(recently updated)
* Free Video to iPod and PSP Converter 2.4.2.1(recently updated)
* Free Video to iPhone Converter 1.3.2.1(recently updated)
* Free Video to MP3 Converter 2.8.2.1(recently updated)
* Free Fast MPEG Cut 2.4.2.1(recently updated)
* Free Video to JPG Converter 1.2.2.1(just released)
* Free YouTube to iPhone Converter 1.3.2.1(recently updated)


Last edited by garry on Sun Aug 23, 2009 12:18 pm; edited 31 times in total
Back to top
View user's profile Send private message
user



Joined: 05 Oct 2006
Posts: 424

PostPosted: Tue Dec 19, 2006 12:50 am    Post subject: Reply with quote

thank you for this Very Happy

but I really wanted to

1)autosave all youtube videos I visit (even if I dont want for them to download completely)

2)autorename them

thanks
Back to top
View user's profile Send private message
BETLOG



Joined: 27 Nov 2006
Posts: 219
Location: Queensland, Australia

PostPosted: Tue Dec 19, 2006 5:02 am    Post subject: Reply with quote

[edit] move along, nothing to see here, move along.

Last edited by BETLOG on Wed Jan 24, 2007 8:51 am; edited 1 time in total
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Mon Jan 01, 2007 11:23 pm    Post subject: Reply with quote

Quote:
Code:
#!/bin/sh
# Grab a video (in nasty Flash video format) from youtube.com.
# This is based on what http://keepvid.com/ does (at least, I assume it isn't
# doing anything smarter than this).

TF=/tmp/ytg.$$
trap "rm -f $TF" 0

url="$1"

if [ "$url" = "" ] ; then
   echo "Usage: youtubeget http://www.youtube.com/watch?..."
   exit 1
fi

v=`echo "$url" | sed 's,^.*v=\([^&]*\).*,\1,'`

agent="Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041219"
curl -A "$agent" "$url" >$TF
t=`grep '&t=' $TF | head -1 | sed 's,.*&t=\([^&"]*\)[&"].*,\1,'`
l=`grep '&l=' $TF | head -1 | sed 's,.*&l=\([^&"]*\)[&"].*,\1,'`

out="youtube-$v.flv"
echo "Downloading ID $v to $out..."
wget -O "$out" --referer "$url" -U "$agent" "http://www.youtube.com/get_video?video_id=$v&l=$l&t=$t"

[Took it from here]
Might give an idea how to get something less Gui related with AHK. Good luck. Cool
Back to top
Titan



Joined: 11 Aug 2004
Posts: 5042
Location: /b/

PostPosted: Tue Jan 02, 2007 1:01 am    Post subject: Reply with quote

Nice find BoBo, here's the AHK version:
Code:
tf = %A_Temp%\ytg
url = http://www.youtube.com/watch?v=7ss41lkJFZc

RegExMatch(url, "v=(\w+)", v)
UrlDownloadToFile, %url%, %tf%
FileRead, tf, %tf%
s := RegExMatch(tf, "&t=(.+?)&", t)
RegExMatch(tf, "&l=(.+?)&", l, s - 25)

FileSelectFile, file, S18
If file
   UrlDownloadToFile, http://www.youtube.com/get_video?video_id=%v1%&l=%l1%&t=%t1%, %file%

_________________
Chat (IRC)PlusNetScriptsIronAHK Contact by email not private message.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
garry



Joined: 19 Apr 2005
Posts: 1557
Location: switzerland

PostPosted: Tue Jan 02, 2007 8:53 pm    Post subject: Reply with quote

thank you all
what happens here ?
I'll never understand RegEx ... Smile
can you optimize this ? ( automatically rename )
thank you again
(moved to first position)


Last edited by garry on Wed Jan 03, 2007 3:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Jan 02, 2007 9:37 pm    Post subject: Reply with quote

Quote:
automatically rename
Replace the FileSelectFile section with a FileMove statement. Done.
Back to top
garry



Joined: 19 Apr 2005
Posts: 1557
Location: switzerland

PostPosted: Tue Jan 02, 2007 9:57 pm    Post subject: Reply with quote

script above works fine with automatically rename
but mine part is not so nice written ... Smile
Back to top
View user's profile Send private message
garry



Joined: 19 Apr 2005
Posts: 1557
Location: switzerland

PostPosted: Wed Jan 03, 2007 12:13 am    Post subject: Reply with quote

moved to first position
Back to top
View user's profile Send private message
garry



Joined: 19 Apr 2005
Posts: 1557
Location: switzerland

PostPosted: Wed Jan 03, 2007 8:40 pm    Post subject: Reply with quote

modified , while looking video, can record also audio to MP3 with mixmp3.exe
Back to top
View user's profile Send private message
garry



Joined: 19 Apr 2005
Posts: 1557
Location: switzerland

PostPosted: Fri Jan 05, 2007 4:55 pm    Post subject: Reply with quote

Titan modified RegEx code
Back to top
View user's profile Send private message
ManilaGurL



Joined: 24 Jan 2007
Posts: 2

PostPosted: Wed Jan 24, 2007 7:56 am    Post subject: Reply with quote

Hmm how do u make this thing work? Please help I badly need to save vids from youtube and record the audio too..
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Wed Jan 24, 2007 9:35 am    Post subject: Reply with quote

Quote:
Please help I badly need to save vids from youtube and record the audio too..
Run the script. If you don't know how, check the QuickStartTutorial. Good luck.
Back to top
ManilaGurL



Joined: 24 Jan 2007
Posts: 2

PostPosted: Wed Jan 24, 2007 10:31 am    Post subject: Reply with quote

Script? I don't see any script here or I just don't know it. Thanks anyway. Crying or Very sad
Back to top
View user's profile Send private message
Steve Wonder
Guest





PostPosted: Wed Jan 24, 2007 12:58 pm    Post subject: Reply with quote

Quote:
I don't see any script here
Shocked Me too!!!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group