Streamsb Ruby Client
Installation
Install the gem and add to the application's Gemfile by executing:
bundle add streamsb
If bundler is not being used to manage dependencies, install the gem by executing:
gem install streamsb
Alternatively, you can opt for Github's installation, add this to your gem file:
gem 'streamsb', github: 'ochiengotieno304/streamsb-ruby'
Usage
Initialize Streamsb Client
require "streamsb"
@client = Streamsb::Client.new(api_key: ENV['STREAMSB_API_KEY'])
Make API calls using the @client object
1. Account
1.1 Info
account_info = @client.account_info
1.2 Stats
account_info = @client.account_stats
2. File
2.1 File Info
file_info = @client.file_info(file_code)
-
file_code
: file codeREQUIRED
2.2 Rename File
rename_file = @client.rename_file(file_code, title, name)
-
file_code
: file codeREQUIRED
-
title
: new file titleREQUIRED
-
name
: new file nameREQUIRED
2.3 Clone File
clone_info = @client.clone_file(file_code)
-
file_code
: file codeREQUIRED
2.4 List Files
file_list = @client.list_files(page, per_page, fld_id, is_public, created, title)
-
page
: page numberOPTIONAL
, -
per_page
: results per pageOPTIONAL
-
fld_id
: folder idOPTIONAL
-
is_public
: show public (1) or private (0) files onlyOPTIONAL
-
created
: show only files uploaded after timestampOPTIONAL
-
title
: filter video titlesOPTIONAL
2.5 Get Direct All
direct_all = @client.get_direct_all(file_code)
-
file_code
: file codeREQUIRED
2.6 Get Direct Quality
direct_quality = @client.get_direct_quality(file_code, quality)
-
file_code
: file codeREQUIRED
-
quality
: video quality if exist, possible values:n
,h
,l
OPTIONAL
2.7 Set Folder
set_folder = @client.set_folder(file_code, folder_id)
-
file_code
: file codeREQUIRED
-
folder_id
: folder idREQUIRED
3. Folder
3.1 List Files
files = @client.folder_list(folder_id)
-
folder_id
: folder idREQUIRED
3.2 Create Folder
folder = @client.create_folder(name, folder_id)
-
name
: folder nameREQUIRED
-
folder_id
: parent folder idOPTIONAL
4. Upload File
4.1 Get Server
upload_server = @client.upload_server
4.2 Upload File
Note: Will be in later realeases
5. Upload Url
5.1 Add Url
url = @client.add_url(url)
-
url
: upload urlREQUIRED
5.2 List Url
urls = @client.list_url
5.3 Status
status = @client.url_status(file_code)
-
file_code
: file_codeREQUIRED
5.4 Action
Note: Will be in later releases
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/ochiengotieno304/streamsb-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Streamsb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.