AutoHotkey Community

It is currently May 25th, 2012, 7:05 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: January 24th, 2007, 7:02 pm 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2248
Location: switzerland
first steps for ahk beginner:
1-Download and install (1.7MB) http://www.autohotkey.com/download/Auto ... nstall.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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 30th, 2007, 2:08 pm 
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 !!!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 27th, 2007, 5:54 am 
Offline

Joined: October 5th, 2006, 8:45 am
Posts: 476
whats the correct latest working script please?

I am confused with the two scripts at the first post...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 1st, 2007, 8:56 pm 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2248
Location: switzerland
@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


Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 29th, 2007, 12:24 pm 
How to get the correct FLV video,if YouTube change video address transmission.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 29th, 2007, 11:06 pm 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2248
Location: switzerland
@teapav
maybe try this link
how to download youtube videos 23 ways =
http://mashable.com/2007/05/05/download-youtube-video/


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Doubt!
PostPosted: May 30th, 2007, 10:09 am 
@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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2007, 1:21 pm 
Offline

Joined: October 5th, 2006, 8:45 am
Posts: 476
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2007, 8:15 pm 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2248
Location: switzerland
can define the download path in the script, example in script:
Code:
FLVF=%A_SCRIPTDIR%\_FLV_RECORDS


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2007, 9:17 pm 
Offline

Joined: March 9th, 2007, 2:47 am
Posts: 509
Location: Unknown
audacity can be used to record sounds, then you can exoprt into .wav


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2007, 11:32 pm 
Offline

Joined: March 19th, 2006, 5:52 am
Posts: 419
You can also export to mp3, if you download LAME and tell Audacity where LAME is saved.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2007, 8:10 am 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2248
Location: switzerland
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_Aufn ... nload.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/Rea ... native.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2007, 4:49 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
@Titan

Certain links result in a zero byte download :(

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 ?

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2007, 7:19 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5346
Location: UK
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2007, 7:45 pm 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2248
Location: switzerland
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 ===========================================


Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, Leef_me, tkmmkt, Yahoo [Bot] and 11 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group