Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

YouTube MP4 download & convert video to MP3


  • Please log in to reply
152 replies to this topic
semi225599
  • Members
  • 269 posts
  • Last active: Dec 27 2011 09:23 PM
  • Joined: 12 Jun 2010
What regex script? the one i posted?
-r "/([^\\/:\*\?<>\|\042])/g"
it works fine

  • Guests
  • Last active:
  • Joined: --
sry no i mean the other way to download a youtube video by creating a get_video url NOT using cclive.. (the first script)

garry
  • Members
  • 2845 posts
  • Last active: Apr 21 2014 04:25 PM
  • Joined: 19 Apr 2005
thank you semi225599 and thank you all for your help
I just tried cclive again ( see first page, first example )

David4
  • Guests
  • Last active:
  • Joined: --
You could have a look at http://de.autohotkey.../topic5493.html I posted my updated script.

BeSimpler
  • Guests
  • Last active:
  • Joined: --
I believe in just looking in the Temporary Internet Files to Download such MP4's from all sites.

I have a script for viewing filetypes currently in the temporary internet files, but I am not so sure that it is suitable for anyone elses computer. Originally made for getting mp3's from sites, also with the COM library to fetch the song info in the Javascript or Flash objects in the current page that's playing the file. But most everything you might want, you can probably get them with a torrent.

garry
  • Members
  • 2845 posts
  • Last active: Apr 21 2014 04:25 PM
  • Joined: 19 Apr 2005
@David4, thank you for this good example with format selection
( I put your link to first page)

@BeSimpler
I tried once with index.dat and mozilla cache
<!-- m -->http://www.autohotke...pic.php?t=25556<!-- m -->

lack of programming ... need much time to change script ... should delete all
thank David4 for his script

BeSimpler
  • Guests
  • Last active:
  • Joined: --
Hmmm???
For IE. Im on Win XP
Gui,Add,ListView,x0 y0 w600 h400 vLV,FileName|LastModified|Folder
Loop,%A_Temp%orary Internet Files\*.mp3,,1
{
    StringSplit,Folder,A_LoopFileDir,\
    LV_Add("",A_LoopFileName,A_LoopFileTimeModified,Folder%Folder0%)
}
LV_ModifyCol(2,"SortDesc")
Gui,Show
Return

GuiClose:
ExitApp


Cristi ®
  • Guests
  • Last active:
  • Joined: --
MODIFIED=26.12.2010
original script from David4
http://de.autohotkey...p?p=63114#63114
I made some modifications to your script, thanks david

[code=auto:0]#SingleInstance Force
#NoEnv
SendMode Input
SetBatchLines -2
SetWorkingDir %A_ScriptDir%

Check:
ifexist tube.ico
Menu, Tray,Icon,tube.ico
Menu, Tray, Tip, Youtube Downloader 1.4


;check if connected to internet
Connected(fl = 0x40) {
Return, DllCall("Wininet.dll\InternetGetConnectedState", "UInt *", fl, "UInt", 0)
}
If Connected() <> 1
return


;DON'T ADD END \
dl_dir=%A_ScriptDir%\Downloaded
IfNotExist, %dl_dir%
FileCreateDir, %dl_dir%
tmp=%A_Temp%\url.youtube.temp

if Clipboard not contains http://www.youtube.com/watch?v=
clipboard =
;


Gui, +ToolWindow -Caption +AlwaysOnTop
Gui, Color, 330066, 330066
Gui, Font, s8 cYellow, bold, Calibri
Gui, Add, text, GMove x6 y6 w119 h20, Youtube Downloader 1.4
Gui, Add, edit, x6 y30 w300 h20 vurl, %clipboard%
Gui, Add, button, x324 y30 w80 h20 gStart, Parse Url
Gui, Show, Center w420 h70, Download Progress
WinSet, Region, 0-0 W420 H70 R20-20, Download Progress
WinSet, Transparent, 195, Download Progress
return


Start:
Gui, Submit
if SubStr(url,1,4)<>"http"
url=http://%url%
UrlDownloadToFile, %URL%, %tmp%
FileRead, F1, %tmp%
RegExMatch(F1,"title>.+?YouTube.+?a;(.+?)\&#.+?<", title)
if StrLen(title0) < 5
RegExMatch(F1,"title>.+?YouTube.+?- (.+?)(\R|<)", title)
Gui, Destroy
stringreplace,title,title1,",,all
stringreplace,title,title, &,&,all
stringreplace,title,title,:,-,all
stringreplace,title,title,?,,all
stringreplace,title,title,",',all
stringreplace,title,title,|,_,all
stringreplace,title,title,/,_,all
stringreplace,title,title,\,_,all
stringreplace,title,title,Ão,Ü,all
stringreplace,title,title,Ã-,Ö,all
stringreplace,title,title,Ã",Ä,all
stringreplace,title,title,ü,ü,all
stringreplace,title,title,ö,ö,all
stringreplace,title,title,ä,ä,all
stringreplace,title,title,ÃY,ß,all
stringreplace,title,title,*,,all
stringreplace,title,title,・,_,all

stringreplace,title,title,《æ˜çŸ³æ¦ã€‹å¼ç‡•®‰¾½°

Cristi ®
  • Guests
  • Last active:
  • Joined: --
there is a problem with hd movies can't download in low format, and i can't figure why, or how to find the download link for fmt5 fmt18

garry
  • Members
  • 2845 posts
  • Last active: Apr 21 2014 04:25 PM
  • Joined: 19 Apr 2005
hi Cristi ® , ( can login and correct script) , thank you for the nice script / gui
don't really understand script and regex
your script works , must compare what done, I'm confused ....
is it Gui,submit,nohide after the label Start (?)
just added a filter for title

[code=auto:0]MODIFIED=20101227

#SingleInstance Force
#NoEnv
SendMode Input
SetBatchLines -2
SetWorkingDir %A_ScriptDir%

Check:
ifexist tube.ico
Menu, Tray,Icon,tube.ico
Menu, Tray, Tip, Youtube Downloader 1.4


;check if connected to internet
Connected(fl = 0x40) {
Return, DllCall("Wininet.dll\InternetGetConnectedState", "UInt *", fl, "UInt", 0)
}
If Connected() <> 1
return



;----------------- examples ------------------
;F1=http://www.youtube.com/watch?v=lH8Xcqvs3JM ;fmt=35 China tango (flv)
;F1=http://www.youtube.com/watch?v=siJLeHAnZIk ;fmt=37-(1920*1080 size=37088) fmt=22-(1280*720 size=21400)
;F1=http://www.youtube.com/watch?v=YRiXEBU3W40 fmt=18 Jim Reeves four walls
;---------------------------------------------




;DON'T ADD END \
dl_dir=%A_ScriptDir%\Downloaded
IfNotExist, %dl_dir%
FileCreateDir, %dl_dir%
tmp=%A_Temp%\url.youtube.temp

if Clipboard not contains http://www.youtube.com/watch?v=
clipboard =
;


Gui, +ToolWindow -Caption +AlwaysOnTop
Gui, Color, 330066, 330066
Gui, Font, s8 cYellow, bold, Calibri
Gui, Add, text, GMove x6 y6 w119 h20, Youtube Downloader 1.4
Gui, Add, edit, x6 y30 w300 h20 vurl, %clipboard%
Gui, Add, button, x324 y30 w80 h20 gStart, Parse Url
Gui, Show, Center w420 h70, Download Progress
WinSet, Region, 0-0 W420 H70 R20-20, Download Progress
WinSet, Transparent, 195, Download Progress
return


Start:
Gui, Submit,nohide
if SubStr(url,1,4)<>"http"
url=http://%url%
UrlDownloadToFile, %URL%, %tmp%
FileRead, F1, %tmp%
RegExMatch(F1,"title>.+?YouTube.+?a;(.+?)\&#.+?<", title)
if StrLen(title0) < 5
RegExMatch(F1,"title>.+?YouTube.+?- (.+?)(\R|<)", title)
Gui, Destroy
stringreplace,title,title1,",,all
stringreplace,title,title, &,&,all
stringreplace,title,title,:,-,all
stringreplace,title,title,?,,all
stringreplace,title,title,",',all
stringreplace,title,title,|,_,all
stringreplace,title,title,/,_,all
stringreplace,title,title,\,_,all
stringreplace,title,title,Ão,Ü,all
stringreplace,title,title,Ã-,Ö,all
stringreplace,title,title,Ã",Ä,all
stringreplace,title,title,ü,ü,all
stringreplace,title,title,ö,ö,all
stringreplace,title,title,ä,ä,all
stringreplace,title,title,ÃY,ß,all
stringreplace,title,title,*,,all
stringreplace,title,title,・,_,all

stringreplace,title,title,《æ˜çŸ³æ¦ã€‹å¼ç‡•®‰¾½°

Cristi®
  • Members
  • 45 posts
  • Last active: Mar 14 2014 12:04 PM
  • Joined: 29 Nov 2007
i can't edit my previous guest posts, but i want to say something garry, the script has a problem with hd movies like this for example:
http://www.youtube.com/watch?v=siJLeHAnZIk
THis video has 4 modes 240p 320p 720p and 1080p but this script can download only in 720p and 1080p mode, and i can't figure how to fix this :roll: :?:

garry
  • Members
  • 2845 posts
  • Last active: Apr 21 2014 04:25 PM
  • Joined: 19 Apr 2005
hi Cristi®,
I tried script from David4 , it's same
remark ( i have just a netbook, 1080p not works (processor slow) , 720p works fine)
you can ask him again in german forum
<!-- m -->http://de.autohotkey.../topic5493.html<!-- m -->

EDIT 20101230 :
made a testscript on first page with ahk commands ( instead of regex)

nimda
  • Members
  • 4368 posts
  • Last active: Jan 15 2014 02:47 PM
  • Joined: 26 Dec 2010
I have a work in progress one which works by hobocopying the fla*.tmp file from %a_temp%, (use Google chrome) then using ffmpeg to create an MP3, MP4, etc.
Downside: you need hobocopy.exe and ffmpeg.exe

Is there a way to compile 3rd party EXE's into an AHK EXE?
If so, please link me to a page saying how or pm me vague instructions.

garry
  • Members
  • 2845 posts
  • Last active: Apr 21 2014 04:25 PM
  • Joined: 19 Apr 2005

Is there a way to compile 3rd party EXE's into an AHK EXE?

see command fileinstall
FileInstall, wget.exe, wget.exe, 1

it's also possible to use commandline parameters in script
example to convert downloaded video files to MP3
outxx=c:\dest
Loop,c:\test\*.*,0,1
   {
   ALF= %A_LoopFileFullPath%
   SplitPath, ALF, name, dir, ext, name_no_ext, drive
   if (ext="mp4" or ext="flv")
      runwait,%comspec% /c ffmpeg.exe -i "%ALF%" -ab 192k "%outxx%\%name_no_ext%.mp3"
   }
run,%outxx%
return


Cristi®
  • Members
  • 45 posts
  • Last active: Mar 14 2014 12:04 PM
  • Joined: 29 Nov 2007
hi garry, i played a little with ur new test script
MODIFIED=20101230 
;------------------- 
;   remark = this is a test script 
;  - click on desired fmt to download 
#SingleInstance Force
#NoEnv
#Persistent
#NoEnv 
SetBatchlines -1
SendMode Input 
SetTitleMatchMode, 2 
SetWorkingDir, %a_scriptdir% 
Transform,S,chr,32   ;SPACE 
DetectHiddenWindows On
;check if connected to internet 
Connected(fl = 0x40){ 
Return, DllCall("Wininet.dll\InternetGetConnectedState", "UInt *", fl, "UInt", 0) 
} 
If Connected() <> 1 
{ 
Msgbox, Internet Not Connected !
ExitApp
} 
;======================================================================================= 
;RECXX        =c:\_A_INPUT 
; IfNotExist, %RECXX% 
;   FileCreateDir, %RECXX% 

RECXX=%A_ScriptDir% 
Menu, Tray, Tip, Youtube Downloader 1.5

;F1=http://www.youtube.com/watch?v=lH8Xcqvs3JM    ;fmt=35 China tango   (flv) 
F1=http://www.youtube.com/watch?v=X5BioJLIdag    ;fmt=37 chinese 1080HD Widescreen 


Gui,1:default 
Gui,1:+AlwaysOnTop +ToolWindow -Caption
Gui,1:Color, 750075, 750075
Gui,1:Font,S8 CYellow , Arial
Gui, 1:add, Text, x7 y7 w179 h15 gMove, YouTube Downloader 1.5
Gui, 1:add, Text, x7 y32 w30 h18 , URL:
Gui, 1:add, Edit, x36 y29 w305 h18 vDownURL, %F1%
Gui, 1:add, Button, x348 y28 w60 h20 gStart_Parsing vParseBtn, Parse

Gui, 1:add, Text, x7 y63 w178 h18 , Video Name:
Gui, 1:add, Edit, x86 y60 w290 h17 vVideoName, %title%
Gui, 1:add, Text, x21 y85 w256 h17 , Uploader:
Gui, 1:add, Edit, x86 y82 w290 h18 ReadOnly vUploader, %username%

Gui,1:Add,Radio, x273 y138 Disabled,FMT=37[1920x1080]
Gui,1:Add,Radio, x137 y138 Disabled,FMT=22[1280x720]
Gui,1:Add,Radio, x273 y111 Disabled,FMT=35[640x380] 
Gui,1:Add,Radio, x5 y137 Disabled,FMT=34[640x360]
Gui,1:Add,Radio, x137 y111 Disabled,FMT=18[480x360]
Gui,1:Add,Radio, x5 y113 Disabled,FMT=5[320x240]


Gui, 1:add, Text, x200 y7 w259 h15 vStatus gMove, F1: Show/Hide Program

Gui, 1:add, Button, x7 y168 w401 h31 vText22 Disabled gStartDownload, 1.Select FMT   2.Edit Name   3.Start Download
Gui, 1:add, Progress, x7 y210 w401 h17 vPRBAR c0000ff -Smooth,
Gui, 1:Show, Center w414 h60, YouTube-Download-1.5
WinSet, Region, 0-0 w414 h60 R6-6, YouTube-Download-1.5
return

GuiClose: 
ExitApp 
return



;----------Toogle Hide KEY-------------
F1::
GuiEscape:
toggle:=!toggle
if toggle
WinHide, YouTube-Download-1.5
Else,
WinShow, YouTube-Download-1.5
return

Move:
PostMessage, 0xA1, 2,,, A
return
;---------------------------------------


Start_Parsing:
Gui, Submit, NoHide
GuiControl,, Status
if VideoName <>
return
F11  =%A_scriptdir%\YTB1.txt
   UrlDownloadToFile, %DownURL%, %F11%                        ;<<<<<<<<<<<<<<<< 
   Fileread,AA,%F11% 
   stringreplace,AA,AA,`n,`r`n,all 
   filedelete, %F11% 
   Fileappend,%AA%`r`n,%F11% 
;----------------------------------------------



;------------------------------ -------------------
CONTEN   =var swfConfig 
xx2      ="fmt_url_map": 
xx3      =fmt_stream_map 
xx4      =document.title = 
xx5      ='VIDEO_ID': 
xx6      ='VIDEO_USERNAME': 
searchfor=37|,22|,34|,18|,5| 



;----------------------------------------------- 
   Loop,Read, %F11% 
      { 
      LR=%A_LoopReadLine% 

      if LR contains %xx4% 
            stringmid,title,LR,28,110 
      if LR contains %xx5% 
            stringmid,videoid,LR,14,11 
      if LR contains %xx6% 
            stringmid,username,LR,20,80 
			
      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%, 
                H%A_Index%= 
                T%A_index%= 
                } 
             ;break 
            } 
       } 
;--------------------------------------------------- 


if username=
{
GuiControl,, Status, Video Not found !
return
}

gosub, titlesearch
stringreplace, username, username,`'`,,,all

;msgbox,Title=%title%`nVideoid=%videoid%`nUsername=%username% 

stringreplace,hss,hss,%xx2%,,all 
stringreplace,hss,hss,",,all 
stringreplace,hss,hss,%s%,,all 
stringreplace,hss,hss,\,,all 

loop,parse,hss,`, 
   { 
   if A_LoopField contains %xx3% 
      break 
   G%A_Index%  := A_LoopField 
   asf=
   stringmid,asr,A_Loopfield,1,2
stringreplace, asr, asr,|,,,all
 
  }
hss=
GuiControl,1:,VideoName, %title%
GuiControl,1:,Uploader, %username%
Gui,1:Show, Center w414 h205, YouTube-Download-1.5
WinSet, Region, 0-0 w414 h205 R6-6, YouTube-Download-1.5

sleep, 500
;msgbox, %a%`n %b%`n %c%`n %d%`n %e%
stringSplit,A,G1,| 
stringSplit,B,G2,| 
stringSplit,C,G3,| 
stringSplit,D,G4,| 
stringSplit,E,G5,| 


string=a1,b1,c1,d1,e1
Loop, Parse, string, `,
{
InsItem := %A_LoopField%
if InsItem =
break
if InsItem = 37
 Gui,1:Add,Radio, x273 y138 vFRM%InsItem% gfrmSet,FMT=%InsItem%[1920x1080]
if InsItem = 22
 Gui,1:Add,Radio, x137 y138 vFRM%InsItem% gfrmSet,FMT=%InsItem%[1280x720]
if InsItem = 35
 Gui,1:Add,Radio, x273 y111 vFRM%InsItem% gfrmSet,FMT=%InsItem%[640x380]
if InsItem = 34
 Gui,1:Add,Radio, x5 y137 vFRM%InsItem% gfrmSet,FMT=%InsItem%[640x360]
if InsItem = 18
 Gui,1:Add,Radio, x137 y111 vFRM%InsItem% gfrmSet,FMT=%InsItem%[480x360]
if InsItem = 5
 Gui,1:Add,Radio, x5 y113 vFRM%InsItem% gfrmSet,FMT=%InsItem%[320x240]
}
;msgbox, a1:%a1%`n%a2%`n b1:%b1%`n%b2%`n c1:%c1%`n%c2%`n d1:%d1%`n%d2%`n e1:%e1%`n%e2%
return


FRMSET:
Gui,1:submit, nohide
Loop, Parse, string, `,
{
InsItem := %A_LoopField%
If A_GuiControl contains %InsItem%
{
StringReplace, DLURL, A_LoopField, 1, 2
DLURL := %DLURL%
;msgbox, %A_GuiControl% = %insItem%`n`nDownload URL: %DLURL%
}
}
FRM = %A_GuiControl%
GuiControl, 1:Enable, Text22
return

StartDownload: 
gui,1:submit, nohide
GuiControl, 1:,PRBAR
GuiControl, 1:,Text22
GuiControl, 1:Disable, Text22
GuiControl, 1:Disable, ParseBtn
Gui,1:Show, Center w414 h235, YouTube-Download-1.5
WinSet, Region, 0-0 w414 h235 R6-6, YouTube-Download-1.5


if frm contains 5,35
  ext=flv 
    else 
      ext=mp4
LFile_Path=%recxx%\%Title%_%FRM%.%ext%
gosub,prbar1
clipboard=%DLURL%
urldownloadtofile,%DLURL%,%LFile_Path%

SetTimer,AAS4,off 
GuiControl,1:,Text22,100 `%
Sleep, 5000
reload
;CleanUp Now, replaced with reload

; GuiControl,1:, VideoName
; GuiControl,1:, Uploader
; GuiControl,1:, Status
; GuiControl,1:, Text22, 1.Select FMT   2.Edit Name   3.Start Download
; FileDelete, %A_scriptdir%\YTB1.txt
return 
;------------------------------------------ 

PRBAR1:
settimer,AAS4,500 
SIZE7:=HttpQueryInfo(DLURL,5)
        ;msgbox,%size7% 
        if (size7="timeout" or size7=0 or size7=-1) 
           { 
           settimer,AAS4,off 
           msgbox,URL not found 
           return 
           } 
GuiControl,1:+RANGE0-%SIZE7%,PRBAR     ;CHANGE processbar 
return 


AAs4: 
  Filegetsize,size1,%LFile_Path% 
  RES1:=Round((100*SIZE1)/SIZE7) 
  GuiControl,1:,PRBAR, %SIZE1% 
  GuiControl,1:,Text22,%RES1% `%
return 




;===========  TITLE ========================================= 
titlesearch: 
gui,1:submit,nohide 

             ; --- replace at least portuguese / german letters umlaut space=%s% -- 
             stringreplace,title,title,">,,all 

             stringreplace,title,title,",_,all 
             stringreplace,title,title,quot,_,all 
             stringreplace,title,title,&,_,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,é,e,all     ;é 
             stringreplace,title,title,Ã,a,all      ;à 

             ;stringreplace,title,title,:,_,all 
             ;stringreplace,title,title,?,_,all 
             ;stringreplace,title,title,",_,all 
             ;stringreplace,title,title,/,_,all 
             stringreplace,title,title,Ão,Ue,all    ;Ue 
             stringreplace,title,title,Ö,Oe,all    ;Oe 
             stringreplace,title,title,Ä,Ae,all    ;Ae 
             stringreplace,title,title,ü,ue,all    ;ue 
             stringreplace,title,title,ö,oe,all    ;oe 
             stringreplace,title,title,ä,ae,all    ;ae 
             ;stringreplace,title,title,・,_,all 

             stringreplace,title,title,_,%s%,all 
StringTrimLeft, title,title, 1
StringTrimRight, title,title, 2
;-- remove special characters like chinese 
title := RegExReplace(title, "\W", " ") 
title := RegExReplace(Title,"\x20{2,}"," ")    ; remove double spaces

;title=%title%


;---------- GOSUB remove special characters from video name ---------------------- 
autotrim,off 
new2= 
Loop,Parse,TITLE 
         { 
         A:=(Asc(A_LoopField)) 
         B:=chr(a) 
         ;if (B="_" OR B="-")     ;allow _-underscore 
         if (B="_" OR B=" " OR B="-")     ;allow also 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% 
         } 
    title=%new2% 
    autotrim,on 

return 
;=========================================================== 


;===========  end TITLE ============================================== 




;-------------------------- FUNCTION GETSIZE before download ------------------------- 
;http://www.autohotkey.com/forum/topic10510.html 
; Olfen PhiLho 
;SIZE:=HttpQueryInfo(URL, 5) 
;msgbox,262144,MESSAGE,SIZE = %SIZE% Byte 



/* 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; HttpQueryInfo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
QueryInfoFlag: 

HTTP_QUERY_RAW_HEADERS = 21 
Receives all the headers returned by the server. 
Each header is terminated by "\0". An additional "\0" terminates the list of headers. 

HTTP_QUERY_CONTENT_LENGTH = 5 
Retrieves the size of the resource, in bytes. 

HTTP_QUERY_CONTENT_TYPE = 1 
Receives the content type of the resource (such as text/html). 

Find more at: http://msdn.microsoft.com/library/en-us/wininet/wininet/query_info_flags.asp 

Proxy Settings: 

INTERNET_OPEN_TYPE_PRECONFIG                    0   // use registry configuration 
INTERNET_OPEN_TYPE_DIRECT                       1   // direct to net 
INTERNET_OPEN_TYPE_PROXY                        3   // via named proxy 
INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY  4   // prevent using java/script/INS 


; Examples: 
; url1 = http://www.autohotkey.com 
; url2 = http://www.autohotkey.com/download/AutoHotkeyInstall.exe 
; MsgBox % HttpQueryInfo(url1) 
; MsgBox % HttpQueryInfo(url2, 5) 
; MsgBox % HttpQueryInfo(url2, 1) 

USAGE= 
Example for size: 

#Include dlfilesize.ahk 
;------ Jim reeves Mexican Joe ---- 
url=http://www.youtube.com/watch?v=YSx_kgXQJDg 
SIZE:=HttpQueryInfo(URL, 5) 
MsgBox,64,Info,Dateigröße = %SIZE% Byte 

*/ 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 


HttpQueryInfo(URL, QueryInfoFlag=21, Proxy="", ProxyBypass="") { 
hModule := DllCall("LoadLibrary", "str", "wininet.dll") 

If (Proxy != "") 
AccessType=3 
Else 
AccessType=1 

io_hInternet := DllCall("wininet\InternetOpenA" 
, "str", "" ;lpszAgent 
, "uint", AccessType 
, "str", Proxy 
, "str", ProxyBypass 
, "uint", 0) ;dwFlags 
If (ErrorLevel != 0 or io_hInternet = 0) { 
DllCall("FreeLibrary", "uint", hModule) 
return, -1 
} 

iou_hInternet := DllCall("wininet\InternetOpenUrlA" 
, "uint", io_hInternet 
, "str", url 
, "str", "" ;lpszHeaders 
, "uint", 0 ;dwHeadersLength 
, "uint", 0x80000000 ;dwFlags: INTERNET_FLAG_RELOAD = 0x80000000 // retrieve the original item 
, "uint", 0) ;dwContext 
If (ErrorLevel != 0 or iou_hInternet = 0) { 
DllCall("FreeLibrary", "uint", hModule) 
return, -1 
} 

VarSetCapacity(buffer, 1024, 0) 
VarSetCapacity(buffer_len, 4, 0) 

Loop, 5 
{ 
  hqi := DllCall("wininet\HttpQueryInfoA" 
  , "uint", iou_hInternet 
  , "uint", QueryInfoFlag ;dwInfoLevel 
  , "uint", &buffer 
  , "uint", &buffer_len 
  , "uint", 0) ;lpdwIndex 
  If (hqi = 1) { 
    hqi=success 
    break 
  } 
} 

IfNotEqual, hqi, success, SetEnv, res, timeout 

If (hqi = "success") { 
p := &buffer 
Loop 
{ 
  l := DllCall("lstrlen", "UInt", p) 
  VarSetCapacity(tmp_var, l+1, 0) 
  DllCall("lstrcpy", "Str", tmp_var, "UInt", p) 
  p += l + 1 
  res := res  . "`n" . tmp_var 
  If (*p = 0) 
  Break 
} 
StringTrimLeft, res, res, 1 
} 

DllCall("wininet\InternetCloseHandle",  "uint", iou_hInternet) 
DllCall("wininet\InternetCloseHandle",  "uint", io_hInternet) 
DllCall("FreeLibrary", "uint", hModule) 

return, res 
} 
;------------------------------------------------------------------ 
;======================== END SCRIPT =================================