streamio-cli 0.0.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,29 +1,46 @@
1
- # Streamio::Exporter
1
+ # Streamio CLI (Command Line Interface)
2
2
 
3
- TODO: Write a gem description
3
+ A gem for interacting with Streamio through the command line.
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ gem install streamio-exporter
8
8
 
9
- gem 'streamio-exporter'
9
+ ## Usage
10
10
 
11
- And then execute:
11
+ After installation you can use the streamio command from your
12
+ terminal. To get a list of available tasks run `streamio` without
13
+ any arguments.
12
14
 
13
- $ bundle
15
+ To get help on a specific task run `streamio help name_of_task`.
16
+ For example run `streamio help export` to get usage scenario
17
+ and available options for the export task.
14
18
 
15
- Or install it yourself as:
19
+ ### Export
16
20
 
17
- $ gem install streamio-exporter
21
+ You can use the export task to download all videos and audios
22
+ from your Streamio account. First use your terminal to navigate
23
+ to a directory where you wish the export to be downloaded to.
24
+ Then use the command together with your api username and password
25
+ found under Account Settings > API when logged in to streamio.com.
18
26
 
19
- ## Usage
27
+ streamio export -u api_username -p api_password
28
+
29
+ By default only the original files will be downloaded. If you
30
+ wish to include transcodings you may add the `-i` parameter.
31
+
32
+ streamio export -u api_username -p api_password -i
33
+
34
+ The export will use the following file structure for the downloads:
35
+
36
+ streamio-export/videos/<video_id>/<video_filename>
37
+ streamio-export/audios/<audio_id>/<audio_filename>
20
38
 
21
- TODO: Write usage instructions here
39
+ A json file containing the metadata of each resource will also
40
+ be availible:
22
41
 
23
- ## Contributing
42
+ streamio-export/videos/<video_id>/<video_id>.json
43
+ streamio-export/videos/<audio_id>/<audio_id>.json
24
44
 
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
45
+ Note that it is likely that you will need a developer to actually
46
+ make use of the exported material.
data/lib/streamio-cli.rb CHANGED
@@ -6,11 +6,11 @@ require 'streamio'
6
6
  require 'ruby-progressbar'
7
7
  require 'streamio-cli/version'
8
8
 
9
- module Streamio
9
+ module Streamio::CLI
10
10
  class SlowDownloadError < StandardError
11
11
  end
12
12
 
13
- class CLI < Thor
13
+ class App < Thor
14
14
  desc "export", "export data from target account"
15
15
  method_option :username, :desc => 'api username', :aliases => '-u', :required => true
16
16
  method_option :password, :desc => 'api password', :aliases => '-p', :required => true
@@ -34,12 +34,12 @@ module Streamio
34
34
  end
35
35
 
36
36
  def download_videos
37
- number_of_items = Video.count
37
+ number_of_items = ::Streamio::Video.count
38
38
  current_item = 0
39
39
  requests_needed = (number_of_items / 100) + 1
40
40
 
41
41
  requests_needed.times do |i|
42
- Video.all(:skip => i * 100, :limit => 100).each do |video|
42
+ ::Streamio::Video.all(:skip => i * 100, :limit => 100).each do |video|
43
43
  current_item += 1
44
44
  puts "\nVideo #{current_item} / #{number_of_items} - #{video.title} - #{video.id}"
45
45
 
@@ -59,12 +59,12 @@ module Streamio
59
59
  end
60
60
 
61
61
  def download_audios
62
- number_of_items = Audio.count
62
+ number_of_items = ::Streamio::Audio.count
63
63
  current_item = 0
64
64
  requests_needed = (number_of_items / 100) + 1
65
65
 
66
66
  requests_needed.times do |i|
67
- Audio.all(:skip => i * 100, :limit => 100).each do |audio|
67
+ ::Streamio::Audio.all(:skip => i * 100, :limit => 100).each do |audio|
68
68
  current_item += 1
69
69
  puts "\nAudio #{current_item} / #{number_of_items}: #{audio.title}"
70
70
 
@@ -130,4 +130,4 @@ module Streamio
130
130
  end
131
131
  end
132
132
 
133
- Streamio::CLI.start
133
+ Streamio::CLI::App.start
@@ -1,5 +1,5 @@
1
1
  module Streamio
2
- module Exporter
3
- VERSION = "0.0.1"
2
+ module CLI
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: streamio-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -103,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  segments:
105
105
  - 0
106
- hash: -340215124816893152
106
+ hash: -2975853809125404003
107
107
  required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  none: false
109
109
  requirements:
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  segments:
114
114
  - 0
115
- hash: -340215124816893152
115
+ hash: -2975853809125404003
116
116
  requirements: []
117
117
  rubyforge_project:
118
118
  rubygems_version: 1.8.24