-
Notifications
You must be signed in to change notification settings - Fork 161
Open
Description
Hi!
We discovered that while uploading a video from the provided URL, the file is downloaded to disk, in the temporary directory.
This happening here:
Line 77 in 04662a7
| file = URI.open(path_or_url) |
This behavior interferes with the operation of pods in our cluster, which have a limit on ephemeral local storage usage.
To work around this limitation, we used the following draft patch, which allows streaming a file instead of downloading:
class Yt::Models::Account
def upload_video(path_or_url, params = {})
file = if path_or_url.to_s.start_with?('https://', 'http://')
# fix here
Down.open(path_or_url, rewindable: false)
else
File.open(path_or_url, 'r')
end
session = resumable_sessions.insert file.size, upload_body(params)
session.update(body: file) do |data|
Yt::Video.new(
id: data['id'],
snippet: data['snippet'],
status: data['status'],
auth: self
)
end
ensure
file.close if file.respond_to?(:close)
end
endPlease, add a streaming support in gem
kangkyu
Metadata
Metadata
Assignees
Labels
No labels