Class: Onlyfans::Resources::Media::Uploads

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/media/uploads.rb,
sig/onlyfans/resources/media/uploads.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Uploads

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Uploads.

Parameters:



45
46
47
# File 'lib/onlyfans/resources/media/uploads.rb', line 45

def initialize(client:)
  @client = client
end

Instance Method Details

#get_status(upload, account:, request_options: {}) ⇒ Onlyfans::Models::Media::UploadGetStatusResponse::UnionMember0, ...

Check the status of a media upload. Poll this endpoint until status is completed or failed. This endpoint is free and does not cost any credits.

Possible statuses:

  • pending — Upload is queued
  • processing — Download/upload in progress
  • completed — Upload finished, media and credits_used are included
  • failed — Upload failed, error is included


28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/onlyfans/resources/media/uploads.rb', line 28

def get_status(upload, params)
  parsed, options = Onlyfans::Media::UploadGetStatusParams.dump_request(params)
   =
    parsed.delete(:account) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["api/%1$s/media/uploads/%2$s/status", , upload],
    model: Onlyfans::Models::Media::UploadGetStatusResponse,
    options: options
  )
end