flatiron-video-uploader 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94927c84d5cb6ac70d63b7540b1e1c0acd96a98a
4
- data.tar.gz: 0cd6d26a77e639a831a3fa0fa09f447b9706f769
3
+ metadata.gz: 31f4fd677a9a04faa4a1cdc06198f4c6bdc8aa68
4
+ data.tar.gz: b821fc5ebb8f193b6a54ccc962ace10b5a5af0e9
5
5
  SHA512:
6
- metadata.gz: 0c7dd727bf77a0ee613592066f4aed699b9b7e1b20e1adf5ba00030d5ef77862ce4842819835c08153db07e07a801b972f9204bc192fa95715d933958ffdd256
7
- data.tar.gz: 9cc881381e02e9d43c38e0bf266a0ef0ec0cf4d2373b39c4df7b2e138c76bc0a99e1431bd79a75d2fc7a423a36e8f953f94cbed195dda3db2a3705a08b6d3241
6
+ metadata.gz: 90f4e0ccdef641c424f22510e9348747d73f5fb55665ee608972fa373483563437454e78139b980ea6eed101a3f45671032c892f1816054e99fbeda292bb6f97
7
+ data.tar.gz: ec70af348d8139dd0c2d0a2e9f75f3c934ef976df3b393b0af6898087894b3c3c060ff60f79c8d2828d0c842e7daef747ba6184152ddb1ee5bf9b5f2e0b95f8f
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.add_development_dependency "bundler", "~> 1.7"
20
20
  spec.add_development_dependency "rake", "~> 10.0"
21
- spec.add_development_dependency "pry", "~> 0.10"
21
+ spec.add_development_dependency "pry-byebug"
22
22
  spec.add_runtime_dependency "httparty", "~> 0.13"
23
23
  spec.add_runtime_dependency "faraday", "~> 0.9"
24
24
  spec.add_runtime_dependency "thor", "~> 0.19"
@@ -1,9 +1,11 @@
1
+ require 'pry-byebug'
1
2
  Faraday.default_adapter = :httpclient
2
3
  module FlatironVideoUploader
3
4
  class Runner
4
5
  GRANT_TYPE = "http://oauth.net/grant_type/device/1.0"
5
6
  THOR_SHELL = Thor::Shell::Basic.new
6
7
  def self.upload_video(file,batch)
8
+
7
9
  begin
8
10
  `ffmpeg > /dev/null 2>&1`
9
11
  rescue
@@ -130,7 +132,7 @@ module FlatironVideoUploader
130
132
  )
131
133
 
132
134
  topics << batch unless batch.empty?
133
- begin
135
+ # begin
134
136
  body = {
135
137
  :snippet => {
136
138
  :title => video_title,
@@ -142,16 +144,21 @@ module FlatironVideoUploader
142
144
  }
143
145
 
144
146
  puts "\n\nOK, about to upload the video. This will take a while"
145
- videos_insert_response = client.execute!(
147
+ video_to_upload = Google::APIClient::UploadIO.new(file, 'video/*')
148
+ video_to_upload.chunk_size =10000000
149
+ videos_insert_response = client.execute(
146
150
  :api_method => youtube.videos.insert,
147
151
  :body_object => body,
148
- :media => Google::APIClient::UploadIO.new(file, 'video/*'),
152
+ :media => video_to_upload,
153
+ :retries => 3,
149
154
  :parameters => {
150
155
  :uploadType => 'resumable',
151
- :part => body.keys.join(',')
156
+ :part => body.keys.join(','),
152
157
  }
153
158
  )
154
- videos_insert_response.resumable_upload.send_all(client)
159
+ while !videos_insert_response.resumable_upload.complete? do
160
+ videos_insert_response = client.execute(videos_insert_response.resumable_upload)
161
+ end
155
162
  puts "Uploaded wooooooooo. The id is #{videos_insert_response.data.id}"
156
163
  puts "\n\n"
157
164
  puts "#"*30
@@ -162,9 +169,10 @@ module FlatironVideoUploader
162
169
  puts "#"*30
163
170
 
164
171
  TerminalNotifier.notify("Finished Uploading Video to Youtube. Click to copy embed ", :title => "Video Uploader", :execute => `echo '#{command}' | pbcopy`)
165
- rescue Google::APIClient::TransmissionError => e
166
- puts e.result.body
167
- end
172
+ # rescue Google::APIClient::TransmissionError => e
173
+ # binding.pry
174
+ # puts e.result.body
175
+ # end
168
176
 
169
177
  puts "Waiting for the video to finish encoding to iPad format\n\n"
170
178
  raw_upload_thread = nil
@@ -1,3 +1,3 @@
1
1
  module FlatironVideoUploader
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flatiron-video-uploader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Burgess
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-24 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: pry
42
+ name: pry-byebug
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0.10'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0.10'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: httparty
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  version: '0'
218
218
  requirements: []
219
219
  rubyforge_project:
220
- rubygems_version: 2.2.2
220
+ rubygems_version: 2.4.8
221
221
  signing_key:
222
222
  specification_version: 4
223
223
  summary: Gem to upload videos to s3 and youtube