var assert  = require('assert');
var https   = require('https');
var nock    = require('nock');
var ytdl    = require('..');


var videos = {
  'Regular video': 'http://www.youtube.com/watch?v=mgOS64BF2eU',
  'VEVO': 'http://www.youtube.com/watch?v=qQ31INpjXX0',
  'VEVO 2': 'http://www.youtube.com/watch?v=pJk0p-98Xzc',
  'Age restricted': 'https://www.youtube.com/watch?v=otfd2UTrP_Q',
};


describe('Try downloading videos without mocking', function() {
  before(function() {
    nock.restore();
    ytdl.cache = null;
  });

  for (var desc in videos) {
    var video = videos[desc];
    describe(desc, function() {
      it('Request status code is not 403 Forbidden', function(done) {
        ytdl.getInfo(video, {
          downloadURL: true,
          debug: false,
        }, function(err, info) {
          if (err) return done(err);

          var url = info.formats[0].url;
          var req = https.get(url);
          req.on('response', function(res) {
            assert.notEqual(res.statusCode, 403);
            req.abort();
            done();
          });
          req.on('error', done);
        });
      });
    });
  }
});

@@ -152,16 +152,18 @@
 r video'
+  
 : 'http:
@@ -210,16 +210,27 @@
   'VEVO'
+           
 : 'http:
@@ -279,16 +279,25 @@
 'VEVO 2'
+         
 : 'http:
@@ -358,16 +358,16 @@
 ted'
+ 
 : 'http
-s
 ://w
@@ -717,244 +717,66 @@
     
-ytdl.getInfo(video, %7B%0A          downloadURL: true,%0A          debug: false,%0A        %7D, function(err, info) %7B%0A          if (err) return done(err);%0A%0A          var url = info.formats%5B0%5D.url;%0A          var req = https.get(url);%0A          req
+var stream = ytdl(video, %7B debug: false %7D);%0A        stream
 .on(
@@ -799,26 +799,24 @@
 tion(res) %7B%0A
-  
           as
@@ -865,87 +865,38 @@
     
-  req.abort();%0A            done();%0A          %7D);%0A          req.on('error',
+res.destroy();%0A         
  done
+(
 );%0A 

redefine irl test a bit