Class: Yt::Collections::ResumableSessions
- Defined in:
- lib/yt/collections/resumable_sessions.rb
Overview
Provides methods to upload videos with the resumable upload protocol.
Resources with resumable sessions are: accounts.
Instance Method Summary collapse
-
#insert(content_length, options = {}) ⇒ Object
Starts a resumable session by sending to YouTube the metadata of the video to upload.
Methods inherited from Base
Methods included from Actions::List
Constructor Details
This class inherits a constructor from Yt::Collections::Base
Instance Method Details
#insert(content_length, options = {}) ⇒ Object
Starts a resumable session by sending to YouTube the metadata of the video to upload. If the request succeeds, YouTube returns a unique URL to upload the video file (and eventually resume the upload).
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/yt/collections/resumable_sessions.rb', line 22 def insert(content_length, = {}) @headers = headers_for content_length body = {} snippet = .slice :title, :description, :tags body[:snippet] = snippet if snippet.any? status = [:privacy_status] body[:status] = {privacyStatus: status} if status do_insert body: body, headers: @headers end |