Sign in to follow this  
Followers 0
punisa

challenge for the experts : )

6 posts in this topic

#1 ·  Posted (edited)

hello, I have a rather fun challenge for a script. I tried myself, but haven't succeed yet, I'll keep trying anyway.

What's it about? If you love British humor they you'll love developing this script :(

I just found yesterday a user on youtube who posted all Black Adder episodes and has them organized in one big playlist (link here: http://www.youtube.com/user/nirbateman ) You can find it under playlist (112 videos)

I have some "FLV get" firefox addons which work as expected, but it would be really fun to "somehow" make a script that would run through all of those videos and download them to specific folder.

I'm not sure how to start this, I know that there is a certain pattern and the loop could be created.

Any suggestions? :P

Edited by punisa

carpe diem

Share this post


Link to post
Share on other sites



If you can read the playlist just get the file locations and use INetGet().

I'm not sure how would I read the playlist, I presume get the actual FLV links? I dunno how, I only download the FLV files with a FLV getter.


carpe diem

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Func _download($code)
        $yourpath = @desktopdir & "\youtube videos"
    $innertxt = _INetGetSource("http://it.youtube.com/watch?v=" & StringReplace(GUICtrlRead($code), " ", ""))
    $t = _StringBetween($innertxt, "&t=", "&hl=")
    $url = "video_id=" & $code & "&t=" & $t[0]
    $t = _StringBetween($innertxt, "&title=", "';")
    $title = $t[0]
    $img_url = "http://i.ytimg.com/vi/" & $code & "/default.jpg"
    InetGet("http://youtube.com/get_video?" & $url, $yourpath & $title & ".flv", 0, 1)
    $size = InetGetSize("http://youtube.com/get_video?" & $url)
    ProgressOn("Downloading","Getting youtube videos")
    While 1
        ProgressSet(Floor(@InetGetBytesRead * 100 / $size))
    WEnd
    ProgressOff()
EndFunc   ;==>_download

this will do the job :P

Edited by torels

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

Func _download($code)
    $innertxt = _INetGetSource("http://it.youtube.com/watch?v=" & StringReplace(GUICtrlRead($code), " ", ""))
    $t = _StringBetween($innertxt, "&t=", "&hl=")
    $url = "video_id=" & $code & "&t=" & $t[0]
    $t = _StringBetween($innertxt, "&title=", "';")
    $title = $t[0]
    $img_url = "http://i.ytimg.com/vi/" & GUICtrlRead($code) & "/default.jpg"
    InetGet("http://youtube.com/get_video?" & $url, GUICtrlRead($path_edit) & $title & ".flv", 0, 1)
    $size = InetGetSize("http://youtube.com/get_video?" & $url)
    ProgressOn("Downloading","Getting youtube videos")
    While 1
        ProgressSet(Floor(@InetGetBytesRead * 100 / $size))
    WEnd
    ProgressOff
EndFunc   ;==>_download

this will do the job :P

Looks like a nice script : )

But, pardon my n00bnes sir, how would one use it?

BTW, autoit (scite) gave me an error so I turned "ProgressOff" into "ProgressOff()", is that correct?


carpe diem

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

yes it is :P

anyway

just call the function and write the youtube code (the 11 character one after the http://youtube.com/?watch=) as a parameter

I am working on a function to retrieve all elements in a playlist but it won't work XD

anyway copy again the code since I made some little changes

cheers!

Edited by torels

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
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
Sign in to follow this  
Followers 0