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 Previous  1, 2, 3, 4, 5  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
garry



Joined: 19 Apr 2005
Posts: 2214
Location: switzerland

PostPosted: Wed Jan 24, 2007 6:02 pm    Post subject: Reply with quote

first steps for ahk beginner:
1-Download and install (1.7MB) http://www.autohotkey.com/download/AutoHotkeyInstall.exe
2-expand, mark, ctrl/C , open notepad, ctrl/v, save as xy.ahk
3- doubleclick xy.ahk, script runs
(with right mouse click can also compile to xy.exe)

this script (should make it better) :
run script, press button youtube, copy from youtube with rightclick video adress
download starts automatically
to record audio to MP3 needs to download freeware:
Audio_RECORD........http://ldb.tpv.ru/ MIXMP3 record audio to MP3

and flvplayer:

PLAY1.........http://www.videolan.org/vlc/ vlc.exe to play xy.flv
or
PLAY2.........http://keepvid.com/ flvplayer
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Jan 30, 2007 1:08 pm    Post subject: Reply with quote

An original link/URI at the address bar: http://www.myvideo.de/watch/636852

Code:
  <param name="movie" value="http://myvideo-054.vo.llnwd.net/d1/player/Playerv8c.swf?V=../movie1/d3/636852.flv&ID=636852&PHPSESSID=40b6afc68f7577e9a38b47c08f66c7f4" />
If you remove several parts from such a link (taken from the pages source code,) you do get the link to download a video from MyVideo.de.

Think about that you've to care about existing copyrights !!!
Back to top
user



Joined: 05 Oct 2006
Posts: 476

PostPosted: Tue Mar 27, 2007 4:54 am    Post subject: Reply with quote

whats the correct latest working script please?

I am confused with the two scripts at the first post...
Back to top
View user's profile Send private message
garry



Joined: 19 Apr 2005
Posts: 2214
Location: switzerland

PostPosted: Sun Apr 01, 2007 7:56 pm    Post subject: Reply with quote

@user
sorry for the late answer

-first example=download starts automatically when youtube movie adress copied
keeps link to download later again (when link exist)

-second example is smaller , copy the link from youtube movie to the edit-field (like http://www.youtube.com/watch?v=iCKMzrPy4t4 ) and press start-button
Back to top
View user's profile Send private message
teapav
Guest





PostPosted: Tue May 29, 2007 11:24 am    Post subject: Can the idea adapt for YouTube changed? Reply with quote

How to get the correct FLV video,if YouTube change video address transmission.
Back to top
garry



Joined: 19 Apr 2005
Posts: 2214
Location: switzerland

PostPosted: Tue May 29, 2007 10:06 pm    Post subject: Reply with quote

@teapav
maybe try this link
how to download youtube videos 23 ways =
http://mashable.com/2007/05/05/download-youtube-video/
Back to top
View user's profile Send private message
teapav
Guest





PostPosted: Wed May 30, 2007 9:09 am    Post subject: Doubt! Reply with quote

@garry
Thanks for reply.
I check the http://mashable.com/2007/05/05/download-youtube-video/,found the means analyse the video address through web's source almost;I want to look for an idea to get video data that can accommodate video's address vary.
Back to top
user



Joined: 05 Oct 2006
Posts: 476

PostPosted: Sun Jun 10, 2007 12:21 pm    Post subject: Reply with quote

afaik, flv file is stored in the cache folder
it possible to make a script that will automatically move the files to a C:\youtube-downloads folder?
Back to top
View user's profile Send private message
garry



Joined: 19 Apr 2005
Posts: 2214
Location: switzerland

PostPosted: Sun Jun 10, 2007 7:15 pm    Post subject: Reply with quote

can define the download path in the script, example in script:
Code:
FLVF=%A_SCRIPTDIR%\_FLV_RECORDS
Back to top
View user's profile Send private message
System Monitor



Joined: 09 Mar 2007
Posts: 509
Location: Unknown

PostPosted: Sun Jun 10, 2007 8:17 pm    Post subject: Reply with quote

audacity can be used to record sounds, then you can exoprt into .wav
Back to top
View user's profile Send private message Visit poster's website
TheIrishThug



Joined: 19 Mar 2006
Posts: 419

PostPosted: Sun Jun 10, 2007 10:32 pm    Post subject: Reply with quote

You can also export to mp3, if you download LAME and tell Audacity where LAME is saved.
Back to top
View user's profile Send private message Visit poster's website AIM Address
garry



Joined: 19 Apr 2005
Posts: 2214
Location: switzerland

PostPosted: Mon Jun 11, 2007 7:10 am    Post subject: Reply with quote

System Monitor, TheIrishThug,
thank you for the different audio recorders

note when record with mixmp3 must select in sndvol32 record stereo mix and set level low 10%

or use other audio recorders
--------------
MP3DIRECTCUT record/cut MP3
http://mpesch3.de1.cc/mp3dc.html
Audiorecord with MP3directcut, select in sndvol32 record stereo mix:
C2a=xy.ram
run,%C2a%
SplitPath,C2a, name, dir, ext, name_no_ext, drive
run,mp3directcut.exe %name_no_ext%.mp3 /rec
run,sndvol32
---------------
MP3RECORD No23Recorder MP3 OGG WAV
http://www.no23.de/no23web/MP3_OGG_Aufnahme_Player_Download.aspx
---------------
player for all (Audio/Video) also for FLV (except RAM,RM)
AUDIO/VIDEO_GOMPLAYER
http://www.gomplayer.com
http://www.gomplayer.com/codec/success.html?intCodec=10

PLAYER for RAM RM (Audio/Video) and many others
REALALTERNATIVE MEDIAPLAYERCLASSIC
http://www.free-codecs.com/download/Real_Alternative.htm
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Tue Aug 14, 2007 3:49 pm    Post subject: Reply with quote

@Titan

Certain links result in a zero byte download Sad

Here is one: http://www.youtube.com/watch?v=l-V-qlr0GTM

Code:
tf = %A_Temp%\ytg
url = http://www.youtube.com/watch?v=l-V-qlr0GTM

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%


@Garry

Many thanks for posting this! I am building something simpler ( around IE ) for me.
Downloading part is okay, but currently I am using VLC Player ( Whopping 32MB ) to play files.
Can you recommend me any other small footprint / no-install-required / freeware / standalone FLV player ?

Smile
Back to top
View user's profile Send private message Send e-mail
polyethene



Joined: 11 Aug 2004
Posts: 5248
Location: UK

PostPosted: Tue Aug 14, 2007 6:19 pm    Post subject: Reply with quote

It's much simpler now although I don't know if the current API will be permanent:

Code:
uri = http://www.youtube.com/watch?v=D2kJZOfq7zk

RegExMatch(uri, "(?<=v=)\w+", id)

FileSelectFile, file, S18
If file
   URLDownloadToFile, http://cache.googlevideo.com/get_video?video_id=%id%, %file%

_________________
GitHubScriptsIronAHK 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: 2214
Location: switzerland

PostPosted: Tue Aug 14, 2007 6:45 pm    Post subject: Reply with quote

thank you Titan , I don't understand regex here again a complicated script
thank you for the functions
I think flvplayer is standalone
now I can download
see links for player in the script

Code:
UPDATE=20070814
#NoEnv
SetBatchLines, 25ms
#SingleInstance force
#Persistent
setworkingdir, %a_scriptdir%

;http://www.autohotkey.net/~garry/Skan.jpg
;SMPLAYER  =http://smplayer.sourceforge.net/en/index.php
;FLVPLAYER =http://keepvid.com/
;GOMPLAYER =http://www.gomplayer.com/codec/success.html?intCodec=10

F53=ytbe.txt
F55=_YOUTB.csv     ;save links
AutoTrim Off
transform,S,chr,32

R3M=%A_scriptDir%\_VIDEO
ifnotexist,%R3M%
FileCreateDir,%R3M%


;example
CY1=http://www.youtube.com/watch?v=l-V-qlr0GTM    ;Skan
;CY1=http://www.youtube.com/watch?v=iCKMzrPy4t4

Gui,1:Font, S10 CDefault, FixedSys
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 vCY1,%CY1%               ;edit1
Gui,1:Add, Edit,   x65 y50  w530 h20 readonly,                ;edit2
Gui,1:Add, Edit,   x65 y75  w530 h20 readonly,                ;edit3

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, x65  y130 w90 h25 gSTART,Start
Gui,1:Add, Button, x160 y130 w90 h25 gCLEAR,CLEAR
Gui,1:Add, Button, x500 y130 w90 h25 gBREAK,BREAK
Gui,1:Add, Button, x160 y160 w90 h25 gYOUTUBE,YOUTUBE
GuiControl,1:Focus,CY1
Gui,1:Show, x0 y0 h190 w600,VIDEO DOWNLOAD %UPDATE%
return
;------------------------------------------------------------------------

BREAK:
reload
return

CLEAR:
   GuiControl,1:Focus,CY1
   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

;######################### YOUTUBE ########################################
start:
Gui,1:submit,nohide
name=
adress=
CY2=

;http://www.youtube.com/watch?v=l-V-qlr0GTM  ;Skan
;http://www.youtube.com/watch?v=iCKMzrPy4t4
;-------------- YOUTUBE NAME SEARCH ------------------------------------
UrlDownloadToFile,%CY1%,%F53%
B=var fs = window.open( "/watch_fullscreen?video_id=              ;Anfang
CA=&fs=                                                           ;ende
V=0
   Loop,Read,%F53%
      {
      LR=%A_LoopReadLine%

           ifinstring,LR,<title>
               {
            name=
            Loop Parse,LR,<> ,%A_Space%%A_Tab%
            If (A_Index & 2)
            Name=%A_LOOPFIELD%
                }

      IfInString,LR,%CA%
          {
          V++
             StringGetPos,VAR1,LR,%B%
             StringGetPos,VAR2,LR,%CA%
             VAR1:=(VAR1+51)
             VAR2:=(VAR2+1)
             VAR3:=(VAR2-VAR1)
             stringmid,ADRESS,LR,VAR1,VAR3
          }
      }
stringlen,len,name
dif:=(len-9)
stringmid,name,name,11,DIF
CY2=http://www.youtube.com/get_video?video_id=%ADRESS%          ;new download adress URL-2
;---------- remove special characters ----------------------
new2=
Loop,Parse,NAME
         {
         A:=(Asc(A_LoopField))
         B:=chr(a)
         if (B="_" OR B=" ")     ;allow _space   autotrim,off
         Goto,SKIP9
         if ((a<48 or a>57) AND A<65 OR A>90 AND A<97 OR A>122)
         continue
         SKIP9:
         new2=%new2%%b%
         }
  new2=%new2%.flv
;----- Find uri encoded characters such as %20 (space) and replace with ascii character ---
;----- TITAN 20070503 http://www.autohotkey.com/forum/topic18876.html ---------------------
  NEW2:=uridecode4(NEW2)
  uriDecode4(str)
      {
      pos = 1
      Loop
        If pos := RegExMatch(str, "i)(?<=%)[\da-f]{2}", hex, pos++)
           StringReplace, str, str, `%%hex%, % Chr("0x" . hex), All
       Else Break
      NEW2=%STR%
      Return,NEW2
      }
;--------------------------------------------------------------------------------------------
stringreplace,new2,new2,%S%,_,all
GuiControl,1:Text,Edit2,%NEW2%     ; name
GuiControl,1:Text,Edit3,%CY2%      ; URL2
if new2=Broadcast_Yourself.flv
   {
   GuiControl,1:,Text22,REMOVED
   return
   }

F54=%R3M%\%NEW2%

SIZE3:=HttpQueryInfo(CY2,5)
GuiControl,1:+RANGE0-%SIZE3%,PRBAR       ;CHANGE processbar

settimer,AAS4,250
URLDownloadToFile,%CY2%,%F54%    ;downloads to desktop
settimer,AAS4,OFF

Filegetsize,size5,%F54%
if size5<50000
    {
   Filedelete,%F54%
   GuiControl,1:,Text22,DELETED
   return
    }

GuiControl,1:+cFF7200,PRBAR

Fileappend,%NEW2%`;%CY1%`;%CY2%`;%F54%`;`r`n,%F55%           ;save name and download-link URL-2
GuiControl,1:,PRBAR, %SIZE3%
GuiControl,1:,Text22,FINISHED   100 `%      SIZE=%SIZE3%
run,%F54%                                    ;run xy.flv with default player like VLC/FLV-/GOMPLAYER

   GuiControl,1:Text,Edit1
   GuiControl,1:Text,Edit2,
   GuiControl,1:Text,Edit3,
   GuiControl,1:,Text22,


FileRead,AA,%F55%
Sort,AA,u                    ;sort and remove double lines
Filedelete,%F55%
Fileappend,%AA%,%F55%
return

;================= GOSUBS ==================================
AAS4:
  Filegetsize,size1,%F54%
  RES1:=Round((100*SIZE1)/SIZE3)
  GuiControl,1:,PRBAR, %SIZE1%
  GuiControl,1:,Text22,%RES1% `%      SIZE=%SIZE3%
return


;######################### END YOUTUBE ####################################
Guiclose:
exitapp


;############################### FUNCTION FOR YOUTUBE OLFEN #####################################
;================  BLOCK-A   DETECT URL-2 TYPE(1) SIZE(5) HEADERS(21)  =====================
/* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; HttpQueryInfo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;http://www.autohotkey.com/forum/topic10510.html&highlight=dllcall+wininet+internetclosehandle
;SIZE:=HttpQueryInfo(URL, 5)
;msgbox,262144,MESSAGE,SIZE = %SIZE% Byte

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
*/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

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 FUNCTION YOUTUBE ===========================================


Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5  Next
Page 2 of 5

 
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