title: android youtube download url 403 forbidden
body: <p>there are some videos that can't download.</p>
  
  <p>I got download url by using this</p>
  
  <pre><code>http://www.youtube.com/get_video_info?video_id=itGNQbJwRSk
  </code></pre>
  
  <p>Is there anyone why below url is not available to download?</p>
  
  <p>total url:</p>
  
  <pre><code>http://r1---sn-a5m7lnek.googlevideo.com/videoplayback?expire=1391267516&amp;ms=au&amp;source=youtube&amp;sver=3&amp;upn=OzZzFV_-2o4&amp;id=8ad18d41b2704529&amp;itag=22&amp;mt=1391243224&amp;ipbits=0&amp;ratebypass=yes&amp;fexp=935622%2C914924%2C926515%2C916623%2C936910%2C936913&amp;sparams=gcr%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&amp;mv=m&amp;ip=183.101.166.55&amp;key=yt5&amp;gcr=kr&amp;signature=F303D0C863C27A6A46124A09E40F308BB67181E013.3FA3E17460DDF6ECA004D9E48B1356849534EBFFFF
  </code></pre>
  
  <p>separated url with each params:</p>
  
  <pre><code>http://r1---sn-a5m7lnek.googlevideo.com/videoplayback?
  
  expire=1391267516&amp;
  
  ms=au&amp;
  
  source=youtube&amp;
  
  sver=3&amp;
  
  upn=OzZzFV_-2o4&amp;
  
  id=8ad18d41b2704529&amp;
  
  itag=22&amp;
  
  mt=1391243224&amp;
  
  ipbits=0&amp;
  
  ratebypass=yes&amp;
  
  fexp=935622%2C914924%2C926515%2C916623%2C936910%2C936913&amp;
  
  sparams=gcr%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&amp;
  
  mv=m&amp;
  
  ip=183.101.166.55&amp;
  
  key=yt5&amp;
  
  gcr=kr&amp;
  
  signature=F303D0C863C27A6A46124A09E40F308BB67181E013.3FA3E17460DDF6ECA004D9E48B1356849534EBFFFF
  </code></pre>
  
  <p>and I used below codes in open stream</p>
  
  <pre><code>    u = new URL(url);
      HttpURLConnection huc = (HttpURLConnection)u.openConnection();//to know the size of video
      huc.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36");
      huc.setRequestProperty("Accept","*/*");
      huc.setRequestMethod("GET");
      huc.setDoOutput(false);
      int size = huc.getContentLength();      
      int status = huc.getResponseCode();
      Log.e("download", status+ huc.getResponseMessage());
      is = new BufferedInputStream(huc.getInputStream());
  </code></pre>
  
  <p>but it returns status = 403, size = -1.
  I couldn't find anything to help yet.</p>
  
  <p>Is there anyone have a idea?</p>