Changeset 37418

Show
Ignore:
Timestamp:
05/08/10 01:48:18 (3 years ago)
Author:
anekos
Message:

Meow Meow Change!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/vimperator-plugins/trunk/stella.js

    r37407 r37418  
    10081008 
    10091009    fetch: function (filepath) { 
     1010      function _fetch (id, t) { 
     1011        let url = 
     1012          "http://youtube.com/get_video?video_id=" + id + 
     1013          "&t=" + decodeURIComponent(t) + 
     1014          (quality ? "&fmt=" + quality : ''); 
     1015        U.download(url, filepath, '.flv', self.title); 
     1016      } 
     1017 
    10101018      let self = this; 
     1019      let id = YouTubePlayer.getIDfromURL(U.currentURL); 
    10111020 
    10121021      // all(1080p,720p,480p,360p) -> 37, 22, 35, 34, 5 
    10131022      // FIXME 一番初めが最高画質だと期待 
    1014       let quality = content.wrappedJSObject.yt.config_.SWF_CONFIG.args.fmt_map.match(/^\d+/); 
     1023      let cargs = content.wrappedJSObject.yt.config_.SWF_CONFIG.args 
     1024      let quality = cargs.fmt_map.match(/^\d+/); 
     1025      let t = cargs.t; 
     1026 
     1027      // 時間が経っていると無効化されてしまっている 
     1028      //_fetch(t, id); 
    10151029 
    10161030      U.httpRequest( 
     
    10201034          // XXX t が変わるために、キャッシュを利用できない問題アリアリアリアリ 
    10211035          let [, t] = xhr.responseText.match(/swfHTML.*&t=([^&]+)/); 
    1022           let id = YouTubePlayer.getIDfromURL(U.currentURL); 
    1023           let url = 
    1024             "http://youtube.com/get_video?video_id=" + id + 
    1025             "&t=" + decodeURIComponent(t) + 
    1026             (quality ? "&fmt=" + quality : ''); 
    1027           U.download(url, filepath, '.flv', self.title); 
     1036          _fetch(id, t); 
    10281037        } 
    10291038      );