         console.log error
 
       if not alreadyExists
-        video = youtubedl url,['--format=webm'],{ cwd: __dirname }
+        video = youtubedl url,['--format='+videoFormat],{ cwd: __dirname }
         size = 0
         video.on 'info', (info)->
           console.log 'Download started'
-          console.log 'filename: ' + info._filename
-          console.log 'size: ' + info.size
+          console.log info
           size = info.size
         pos=0
         video.on 'data', (data) =>

fs = require 'fs'
blur = require './StackBlur.js'
youtubedl = require 'youtube-dl'
gif = require './gif.js'

qr = (selector) -> document.querySelector selector
style = (element) -> document.defaultView.getComputedStyle element

          console.log pos,size
          if pos==size
            console.log 'downloaded'
            @insertVideo.apply @,[savePath]
        video.pipe fs.createWriteStream(savePath)
      else
        @insertVideo savePath
    else
      @removeVideo()

