File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 1+ require 'open-uri'
12require 'yt/models/base'
23
34module Yt
@@ -73,7 +74,7 @@ def avatar_url
7374 # @option params [Boolean] :self_declared_made_for_kids The video’s made for kids self-declaration.
7475 # @return [Yt::Models::Video] the newly uploaded video.
7576 def upload_video ( path_or_url , params = { } )
76- file = URI . open ( path_or_url )
77+ file = URI . parse ( path_or_url ) . open
7778 session = resumable_sessions . insert file . size , upload_body ( params )
7879
7980 session . update ( body : file ) do |data |
Original file line number Diff line number Diff line change @@ -546,7 +546,7 @@ def claim
546546 # @raise [Yt::Errors::RequestError] if path_or_url is not a valid path
547547 # or URL.
548548 def upload_thumbnail ( path_or_url )
549- file = URI . open ( path_or_url ) rescue StringIO . new
549+ file = URI . parse ( path_or_url ) . open rescue StringIO . new
550550 session = resumable_sessions . insert file . size
551551
552552 session . update ( body : file ) do |data |
You can’t perform that action at this time.
0 commit comments