Class: YoutubeAudio::PlayerResponse
- Inherits:
-
Object
- Object
- YoutubeAudio::PlayerResponse
- Defined in:
- lib/youtube_audio/player_response.rb
Instance Method Summary collapse
- #formats ⇒ Object
-
#initialize(response_raw) ⇒ PlayerResponse
constructor
A new instance of PlayerResponse.
- #to_youtube_format(format_raw) ⇒ Object
Constructor Details
#initialize(response_raw) ⇒ PlayerResponse
Returns a new instance of PlayerResponse.
6 7 8 |
# File 'lib/youtube_audio/player_response.rb', line 6 def initialize(response_raw) @response_raw = response_raw end |
Instance Method Details
#formats ⇒ Object
10 11 12 13 14 |
# File 'lib/youtube_audio/player_response.rb', line 10 def formats (@response_raw&.dig('streamingData', 'adaptiveFormats') || []).map do |f| to_youtube_format(f) end end |