title: can't use 'get_video_info' of Youtube for high quality video
body: <p>I finally found a way to use a Youtube video in the HTML5 video tag thanks to this <a href="https://jsfiddle.net/350D/uq1vvavf/" rel="nofollow noreferrer">https://jsfiddle.net/350D/uq1vvavf/</a></p>
  
  <pre><code>var vid = "9PDcJeymhWM",
      streams,
      video_focused = true,
      video_tag = $("#video"),
      video_obj = video_tag.get(0);
  $.getJSON("https://query.yahooapis.com/v1/public/yql", {
      q: "select * from csv where url='https://www.youtube.com/get_video_info?video_id=" + vid + "'",
      format: "json"
  }, function(data) {
      if (data.query.results &amp;&amp; !data.query.results.row.length) {
          streams = parse_youtube_meta(data.query.results.row.col0);
          video_tag.attr({
              src: streams['1080p'] || streams['720p']
          });
  
          document.addEventListener("visibilitychange", function() {
              video_focused = !video_focused ? video_obj.play() : video_obj.pause();
          });
      } else {
              $('pre').text('YQL request error...');
      }
  });
  
  function parse_youtube_meta(rawdata) {
      var data = parse_str(rawdata),
          streams = (data.url_encoded_fmt_stream_map + ',' + data.adaptive_fmts).split(','),
          result = {};
      $.each(streams, function(n, s) {
          var stream = parse_str(s),
              itag = stream.itag * 1,
              quality = false,
              itag_map = {
                  18: '360p',
                  22: '720p',
                  37: '1080p',
                  38: '3072p',
                  82: '360p3d',
                  83: '480p3d',
                  84: '720p3d',
                  85: '1080p3d',
                  133: '240pna',
                  134: '360pna',
                  135: '480pna',
                  136: '720pna',
                  137: '1080pna',
                  160: '144pna',
                  264: '1440pna',
                  139: "48kbps",
                  140: "128kbps",
                  141: "256kbps"
              };
          if (itag_map[itag]) result[itag_map[itag]] = stream.url;
      });
      return result;
  };
  
  function parse_str(str) {
      return str.split('&amp;').reduce(function(params, param) {
          var paramSplit = param.split('=').map(function(value) {
              return decodeURIComponent(value.replace('+', ' '));
          });
          params[paramSplit[0]] = paramSplit[1];
          return params;
      }, {});
  }
  </code></pre>
  
  <p>The only thing I struggle with right now is getting the quality right. Using the previous snippet I'm only able to get my video in 720p. I would like to play it as it plays on Youtube at 1080p50 . </p>
  
  <p>Any ideas how to get the higher quality version of the video? ( the video I'm trying to use is <a href="https://www.youtube.com/watch?v=aVussY7jIdo" rel="nofollow noreferrer">https://www.youtube.com/watch?v=aVussY7jIdo</a> )</p>