Class: SVT::Recorder::Play
Overview
Recorder for SVT Play. Takes the URL for a video on SVT Play and returns the URLs for all parts.
Usage:
recorder = SVT::Recorder::Play.new(url)
recorder.title # => The title of the video from SVT Play
# If you want to decide which bitrate you want to record check which
# are available, otherwise the highest bitrate will be choosen.
recorder.bitrates # => [696752, ... more bitrates ...]
recorder.part_urls(696752) # => [base_url, [part_names], bitrate]
Or for the quick fix:
SVT::Recorder::Play.record(url) # => [base_url, [part_names], bitrate, video_title]
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.record(url) ⇒ Object
Instantiate the class with
url
and get all part URL:s for the highest bitrate available.
Instance Method Summary collapse
-
#initialize(url) ⇒ Play
constructor
A new instance of Play.
Methods inherited from Base
#all_parts, #bitrates, #get_streams, #last_part, #part_urls, #parts, #parts?
Constructor Details
#initialize(url) ⇒ Play
Returns a new instance of Play.
29 30 31 32 33 34 35 |
# File 'lib/svt/recorder/play.rb', line 29 def initialize(url) video = SVT::Recorder.fetch_playlist(url, '#player') do |url| "#{File.join('http://www.svtplay.se', url)}?output=json" end super(video) end |