
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
I created this gem to simplify request and responses from DailyMotion Cloud API.
With this gem, you can :
Add this line to your application's Gemfile:
gem 'dm_cloud', "0.0.60" #stable version
or
gem 'dm_cloud' # edge version
And then execute:
$ bundle
Or install it yourself as:
$ gem install dm_cloud
First, your will need to specify your :user_id, :api_key and your security level.
I used a file in APP_ROOT/config/initializers/conf.rb
.
You can note the securitylevel, for more information about it, take a look at lib/dm_cloud/signing.rb
.
# DAILYMOTION CLOUD SETTINGS
require 'dm_cloud'
DMC_USER_ID = 'your user id'
DMC_SECRET = 'your api key'
DMC_SECURITY_LEVEL = :none
DmCloud.configure( {
:user_key => DMC_USER_ID,
:secret_key => DMC_SECRET,
:security_level => DMC_SECURITY_LEVEL
})
Description of security levels :
Second part, get you embed url :
It will return a string containing the iframe with the DailyMotion Cloud player.
DmCloud::Streaming.embed('your video id looks like a secret key')
Or how to get your direct url :
It will return a string containing the direct link to your file.
DmCloud::Streaming.url('your video id', ['asset_name'], {options})
The next parts will come soon, just need some time to finish it
and create corresponding tests.
If you need to list your video you can use this method :
DmCloud::Media.list({:page => 1, :per_page => 10})
It will return videos information and more :
result to yaml :
'{"result": {
"list": [{
"embed_url": "http://api.DmCloud.net/player/embed/:your_id/:media_id",
"assets": {
"source": {
"status": "ready",
"video_fps": 25.0,
"file_extension": "mp4",
"video_fps_mode": "CFR",
"container": "MPEG-4",
"audio_samplerate": 44100,
"video_interlaced": false,
"video_rotation": 0.0,
"video_bitrate": 1000618,
"created": 1347641702,
"audio_nbr_channel": 2,
"download_url": "http://cdn.DmCloud.net/route/http/:your_id/:media_id/source-1347634502.mp4?filename=my_video_name-source-1347634502.mp4&auth=1351277028-3-672hcu1m-3fcab065b9bf103e70d3883aa8c657be",
"video_aspect": 1.7777777777777777,
"video_height": 576,
"audio_bitrate": 128017,
"audio_codec": "AAC LC",
"file_size": 119133958,
"duration": 839,
"video_codec": "AVC",
"video_width": 1024,
"global_bitrate": 1134696}},
"created": 1347641696,
"meta": { "title": "my video 1 title"},
"frame_ratio": 1.7740740740740739,
"id": "5053616094739936ec0006af" }],
"pages": 1,
"on_this_page": 3,
"per_page": 10,
"total": 3,
"page": 1}}'
As you can see, this give many information, you can submit a hash like this :
DmCloud::Media.list({:page => 1, :per_page => 10, :fields => {:meta => :title }, :assets => [:download_url, :created ]})
Your welcome to share and enhance this gem.
This is my first one (and not the last one) but I know some mistakes might be done by myself.
I do my best and I'm open to all ideas or comments about my work.
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that dm_cloud demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.