Jump to content

Videos download


Eusebio
 Share

Recommended Posts

The download file must be renamed to extension .flv and then you can see the video with flv viewer or convert to other formats (avi,mpg) with your prefered tools.

#include <INet.au3>
#include <IE.au3>
Local $sYouTubeLink="http://www.youtube.com/watch?v=lv4Potdpjhw"
Local $oIE
$sYouTubeLink=InputBox("Download YouTube videos","YouTube link:", $sYouTubeLink)
if stringlen($sYouTubeLink)=0 Then
    Exit
EndIf
$sCode=_INetGetSource ($sYouTubeLink)
$s_t=StringRegExp($sCode, "&t=(.*?)&", 3)
$s_v=stringmid($sYouTubeLink,stringinstr($sYouTubeLink,"v=")+2)
$sDownloadLink="http://youtube.com/get_video?video_id=" & $s_v & "&t=" & $s_t[0]
$oIE=_IECreate ($sDownloadlink,0, 0, 1)

The code could be better, you can change and post here.

I would like detect when cancel download button is pressed for abort/exit script.

Edited by Melba23
Title adjusted
WhoIsYouTube Video downloaderSoundex - SoundexEx - Levenshtein Distance (algorithms)[font="Arial"]I3osé[/font][font="Arial"]AutoIT[/font]
Link to comment
Share on other sites

Made the cancel button function like you asked. :lmao:

#include <INet.au3>
#include <IE.au3>
Local $sYouTubeLink="http://www.youtube.com/watch?v=lv4Potdpjhw"
Local $oIE
$sYouTubeLink=InputBox("Download YouTube videos","YouTube link:", $sYouTubeLink)
If @Error then Exit
if stringlen($sYouTubeLink)=0 Then
    Exit
EndIf
$sCode=_INetGetSource ($sYouTubeLink)
$s_t=StringRegExp($sCode, "&t=(.*?)&", 3)
$s_v=stringmid($sYouTubeLink,stringinstr($sYouTubeLink,"v=")+2)
$sDownloadLink="http://youtube.com/get_video?video_id=" & $s_v & "&t=" & $s_t[0]
$oIE=_IECreate ($sDownloadlink,0, 0, 1)
Edited by SolidSnake
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

This looks very Cool. I cant wait to try it.

Did you know there is a site out there that does this.

maybe it would be smother to do a get method to there site and make them do all the work

Would you mind posting a link to the site? :lmao:

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

Hi!

Nice work! I've ReWritten it with a GUI and so one:

#include <GUIConstants.au3>
#include <inet.au3>

#Region ### START Koda GUI section ### Form=
GUICreate("You Tube", 223, 114, 193, 121, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
$DwnInput = GUICtrlCreateInput("http://www.youtube.com/watch?v=", 8, 24, 201, 21)
GUICtrlCreateLabel("You Tube Download Link:", 8, 8, 198, 15)
$start = GUICtrlCreateButton("&Start", 8, 48, 99, 25, 0)
$Progress = GUICtrlCreateProgress(8, 80, 202, 16)
$abb = GUICtrlCreateButton("A&bbort", 112, 48, 99, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $start
            GUICtrlSetState($start,$GUI_DISABLE)
            $dwnlink = GUICtrlRead($DwnInput)
            $sCode=_INetGetSource ($dwnlink)
            $s_t=StringRegExp($sCode, "&t=(.*?)&", 3)
            $s_v=stringmid($dwnlink,stringinstr($dwnlink,"v=")+2)
            $save = FileSaveDialog("Save SWF","","Flash(*.swf)",-1,$s_v)
            If StringRight($save,4) <> ".swf" Then $save&=".swf"
            _Download("http://youtube.com/get_video?video_id=" & $s_v & "&t=" & $s_t[0],$save,$Progress)
            GUIDelete()
            MsgBox(0,"","Done!")
            Exit
    EndSwitch
WEnd

;By GtaSpider
Func _Download($site,$punkt,$prog=0)
    $orisize = InetGetSize($site)
    InetGet($site,$punkt,1,1)
    If $prog = 0 Then ProgressOn("Download","")
    Do
        $msg = GUIGetMsg()
        If $msg = $abb Then
            If MsgBox(4,"","Abbort?") = 6 Then Exit
        EndIf
        $size1 = FileGetSize($punkt)
        $MBsize1 = FileGetSize($punkt)
;~      $Prozent = $size1 / $orisize  * 100
        $inetget = @InetGetBytesRead 
        $Prozent = (100 * $inetget ) / $orisize
        $decimalplace = Round ($Prozent)
        $decimalplaceMBsize1 = Round (@InetGetBytesRead / 1024)
        If $prog = 0 Then
            ProgressSet ($Prozent, $decimalplace  & "% " & "(" & $decimalplaceMBsize1 & ") Kb has been Downloaded.")
        Else
            GUICtrlSetData($prog,$Prozent)
        EndIf
    Until @InetGetActive = 0
    If $prog = 0 Then ProgressOff ()
    Return $punkt
EndFunc

Spider

www.AutoIt.de - Moderator of the German AutoIt Forum

 

Link to comment
Share on other sites

Nice file, I love it, one sugestion I had though, maby add this http://www.wimpyplayer.com/products/wimpy_...flv_player.html its a standalone flv player so maby could incorporate it to download them and be able to play them all in one nice program^^

[quote name='DaleHohm']You have a strange habit of posting error messages that don't match your code.[/quote][quote name='SmOke_N']Forget the learning... straight to the scripting :lol: (laugh.gif)[/quote]

Link to comment
Share on other sites

Hi Paulie,

You must put ".flv" extension to the download file. Then you can view the video with a flv player or use another tool for convert the file to other format like: avi,mpg... I use "cinemaforge 2.0" you can download it from this link: http://www.download.com/CinemaForge/3000-2...4-10496506.html

Eusebio.

Edited by Eusebio
WhoIsYouTube Video downloaderSoundex - SoundexEx - Levenshtein Distance (algorithms)[font="Arial"]I3osé[/font][font="Arial"]AutoIT[/font]
Link to comment
Share on other sites

Hi Paulie,

You must put ".flv" extension to the download file. Then you can view the video with a flv player or use another tool for convert the file to other format like: avi,mpg... I use "cinemaforge 2.0" you can download it from this link: http://www.download.com/CinemaForge/3000-2...4-10496506.html

Eusebio.

Now how do you get the flv file from a swf like this: http://www.cyberzerocool.com/projects

Note: there is no preloader so just wait a sec before you play it

Edited by zerocool60544
Check out ConsultingJoe.com
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Using @InetGetBytesRead and a timer, you could work it out.

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...