2016-02-27 28 views
-1

我檢查了所有處理YouTube-dl問題的問題,但未找到與我的問題相同的問題;爲什麼YouTube-dl只下載鏈接來自meteorjs應用程序中的YouTube?

當我在我的meteorjs應用程序中下載帶有節點YouTube-dl的YouTube視頻時,除了Firefox中打開的視頻在新標籤頁中下載它之外,其他所有方面都可以(在Chrome中)但是,當我嘗試從其他網站如Facebook下載視頻(鉻),Twitter或任何其他人,它拋出這個錯誤控制檯

Error: Internal server error [500] 

而這一次在終端

Exception while invoking method 'commandliiiine'Error: No video id found: https://www.facebook.com/sawtelghad/videos/1070722126318944/ 

這我在服務器

var ytdl = Meteor.npmRequire('ytdl-core'); 
    var Future = Meteor.npmRequire("fibers/future"); 

Meteor.methods({ 
    'commandliiiine': function(url){ 

     this.unblock(); 
     var future = new Future(); 

     ytdl.getInfo(url, function(err, result) { 

     future.return(result); 
     }); 

     return future.wait(); 
    } 
}); 

和代碼,這是在客戶端的代碼

Meteor.call('commandliiiine', url, function(error, result){ 
     if (result) { 
      Session.set('videoTitle', result.title); 
      Session.set('videoImage', result.thumbnail_url); 




     } else { 
      console.log('error:'+ error); 
     } 
     }); 

此YouTube-DL的版本,我用: 「ytdl芯」: 「0.7.9」

誰能幫助我解決這個問題!請

感謝的很多

+0

@Roemer,請你能告訴我什麼,爲什麼你編輯我的問題! – abdou

+0

我刪除了'Facebook'標籤,因爲您的問題與此無關。 – Roemer

+0

@Roemer所以,沒有視頻在Facebook上下載?? – abdou

回答

0

什麼是您的提交URL功能?

另外我已經檢查過Facebook並在結果對象中返回給客戶端,例如沒有任何thumbnail_url。

你的代碼更改爲:

Meteor.call('commandliiiine', url, function(error, result){ 
    if (result) { 
     console.log(result); 
    } else { 
     console.log('error:'+ error); 
    } 
    }); 

,開放的開發者控制檯上的Chrome瀏覽器,看看你的返回對象。您只能訪問爲每個視頻共享網站打印的對象鍵。

+0

在控制檯中沒有任何結果,它會拋出一個錯誤,正如我之前解釋的 – abdou

相關問題