Class: YoutubeAudio::Formats
- Inherits:
-
Object
- Object
- YoutubeAudio::Formats
- Defined in:
- lib/youtube_audio/formats.rb
Instance Attribute Summary collapse
- #url ⇒ String readonly
Instance Method Summary collapse
- #formats ⇒ Object
-
#initialize(url) ⇒ Formats
constructor
A new instance of Formats.
- #player_response ⇒ Object
Constructor Details
#initialize(url) ⇒ Formats
Returns a new instance of Formats.
9 10 11 |
# File 'lib/youtube_audio/formats.rb', line 9 def initialize(url) @url = url end |
Instance Attribute Details
#url ⇒ String (readonly)
6 7 8 |
# File 'lib/youtube_audio/formats.rb', line 6 def url @url end |
Instance Method Details
#formats ⇒ Object
13 14 15 |
# File 'lib/youtube_audio/formats.rb', line 13 def formats player_response.formats.select(&:audio?) end |
#player_response ⇒ Object
17 18 19 |
# File 'lib/youtube_audio/formats.rb', line 17 def player_response @player_response ||= ScriptParser.new(script_js).player_response end |