/getvid - download youtube video

By zonirc on Oct 26, 2007

My first time working with socket.........
Its been created when Im feel so tired to open the youtube pages and its source code and then find the video url there's.
So Ive decided to write a simple snippet in mirc to allow me just gave the page url where theres was a video that I want to downloading.

> File Information
>Name: /getvid
>Author: zonIRC
>Testing with: mIRC 6.21
>Description: A simple snippet that get the url of youtube video based on url specify.

>How To Install
>1) Open your mIRC editor by hit 'Alt+R'.
>2) Then hit 'Ctrl+L'.
>3) Select this file and click 'Open'.

>/getvid [-b] url

>[-b] to make snippet downloading the file by using your default browser.
>     when 'File Download' dialog opened, click 'Save' and choose where to
>     saved it(make sure you named it as .flv file since youtube used that
>     file format).
>url  the address of the file that you like to get.
>     'http://' and 'www.' are not essential.

>/getvid youtube.com/watch?v=wvMc84FZnI0
>this will opened @getvid and echoing the video URL, so if you want to get the file just
>double click on text after URL:. When you like to see the video on your browser, just
>double click on text after For:

>/getvid -b http://youtube.com/watch?v=wvMc84FZnI0
>this will automatically downloading the video file by using your default browser.

>1) Sais - for giving me a link for socket code(http://tinyurl.com/3cwfcv)
>2) puzzling - for advice me to send 'User-Agent'
>3) Riamus2 - where its code(http://tinyurl.com/3cwfcv) at that forum have
>             been used by me to learning a way to establish a connection.

alias getvid {
  ;/getvid [-b] [url]
  if (!$1) echo -ftsc info * /getvid: insufficient parameter
  else {
    set %openbrowser $iif($1 = -b,1)
    if ($iif(%openbrowser,$2-,$1-)) {
      set %getvid www. $+ $regsubex($v1,/^http://(www.)?/i,)
      if ($sock(getvid)) sockclose getvid
      sockopen getvid $gettok(%getvid,1,47) 80
    else echo -ftsc info * /getvid: url not specified.

on *:sockopen:getvid:{ 
  if (!$window(@getvid)) window @getvid
  sockwrite -n $sockname GET / $+ $gettok(%getvid,2,47) HTTP/1.1
  sockwrite -n $sockname Host: $gettok(%getvid,1,47)
  sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
  sockwrite -n $sockname $sockname Accept: */* $+ $crlf $+ $crlf
on *:sockread:getvid:{ 
  var %temp
  sockread %temp 
  if ($regsubex(%temp,/var fullscreenUrl = '\/watch_fullscreen/i,) != %temp) {
    var %vidurl = $+($gettok(%getvid,1,47),/get_video,$remove($left($v1,-2),$chr(9)))
    echo @getvid Video URL: %vidurl For: %getvid
    if (%openbrowser) url %vidurl
    sockclose getvid


Sign in to comment.
biase   -  May 14, 2008

lol... you guys really dunno how to use google to search for codec or other player to play this file. my real player works fine with this file... if u didnt like realplayer i suggest to download k-lite mega codec.

zonirc   -  Feb 11, 2008

thanx water_dragon
at least someone feel this one are useful :P
anyway this snippet will downloading a .flv file(which that was a youtube video file format) and that means you need a FLV player which like mountaindew suggesting you can try total video player or you can google for \'flv player\' or you can get a codec that supported the .flv player such as storm codec.

water_dragon you can renamed the file as any .xxx that you like, however you still need a FLV player to play it. Even if you rename it as .wmv(for example) and your player didnt support flv format then an error occured.

If you want to convert the downloaded file, once again u can follow what mountaindew said. Or you can try media converter(which im prefer :P), you can get it at http://www.mediaconverter.org/ (either you want used the online converter or download its free version)

For others, there was some major problem for the url this snippet echoing(at @getvid). Since any url that have a spaces are not being converted into url form so a clicking at it will not working(eventhough its work but its redirect the browser to a wrong url).... So its better used the \'-b\' switches for this moment(until Ive got a desire to recode this thing-got many video to download so cant have spare time to coding lol :P)

water_dragon   -  Feb 05, 2008

(changes 10/10 To 8/10 since hes just found somethink out that he never realised) still a good script tho

water_dragon   -  Feb 02, 2008

lol just do (sample) linkin park in the end.avi - save it as an avi file :P thats wot i done

guest598594   -  Feb 02, 2008

well i\'m guessing this downloads the flv files? if so, use total video player (i also reccoment total video converter, so that you can convert to mp4, wmv, mpg, etc.) and i think when you download the converter, the player comes with it.

water_dragon   -  Feb 02, 2008

never mind figured it out wicked script :) 10/10 i be useing this one alot now :D

water_dragon   -  Feb 02, 2008

Still cant find a program/player to play these Files :( any one got any suggestions?

water_dragon   -  Feb 01, 2008

iv got realplayer dont work

LucSatise   -  Feb 01, 2008

get realplayer ;p

water_dragon   -  Feb 01, 2008

it Downloads for me but wot do i use to play the file ? can anyone Tell me that 9/10 (10/10 if you can tell me how to play the file :P)

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.