Search code examples
ruby-on-railsrubyyoutube-dl

Different result from rails and irb for YoutubeDL.get


I'm using gem 'youtube-dl.rb'.

From irb, I can get full result, about video, but at the rails 4.2 - I can't.

irb

require 'youtube-dl.rb'     
a = YoutubeDL.get "https://www.youtube.com/watch?v=5dsGWM5XGdg", {skip_download: true}

Result https://pastebin.com/9SLbs5GF (With a lot of data).

rails c

require 'youtube-dl.rb'     
a = YoutubeDL.get "https://www.youtube.com/watch?v=5dsGWM5XGdg", {skip_download: true}

Result from rails console have only this:

 => #<YoutubeDL::Video:0x007fbc29de1498 @url="https://www.youtube.com/watch?v=5dsGWM5XGdg", @options=#<YoutubeDL::Options:0x007fbc29de1448 @store={:skip_download=>true}>, @download_options=#<YoutubeDL::Options:0x007fbc29de1150 @store={:color=>false, :progress=>false, :skip_download=>true}>, @last_download_output="[youtube] 5dsGWM5XGdg: Downloading webpage\n[youtube] 5dsGWM5XGdg: Downloading video info webpage\n[youtube] 5dsGWM5XGdg: Extracting video information\n[youtube] 5dsGWM5XGdg: Downloading MPD manifest\n"> 

How I Can get the same result for RoR?


Solution

  • Try to check youtube-dl.rb version inside your rails app and inside your machine enviro