getpics 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/getpics +9 -1
- data/lib/getpics/downloader.rb +9 -3
- data/lib/getpics/media.rb +1 -1
- data/lib/getpics/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4a68484d33a3cad5595e6036baf7d2a493b061222eb48937c6f91de4913c9db
|
4
|
+
data.tar.gz: c3951e050dc5248330154a5416935de5b2d258c3a283bd5e06a6499379a1d13d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65e2bb98dfa3477a873b3de80a4bba4365ecbbc5c9cfc988dc3e931c8953e7096be92f1d7e77cf0c8c8508a693c78733b5be5169ec7e58bc89a4a7adcdecd64e
|
7
|
+
data.tar.gz: e033f49cc1382322be4835ee1249f1a838ef88fa2315ad636e8887afa7c13b76a149c2a6107362f2ea1202c7c3495cd7743ea33c19961f781781a88e8af7fb58
|
data/bin/getpics
CHANGED
@@ -40,7 +40,15 @@ end.parse!
|
|
40
40
|
dl = Getpics::Downloader.new(options[:verbose], options[:src], options[:photo_dest], options[:movie_dest])
|
41
41
|
dl.load_media
|
42
42
|
dl.copy_media
|
43
|
-
dl.
|
43
|
+
if dl.has_movies? and ! options[:convert]
|
44
|
+
puts "Do you want to convert movies to mp4? [Y/n]".yellow
|
45
|
+
convert = gets.strip
|
46
|
+
if convert != 'n'
|
47
|
+
dl.convert_media
|
48
|
+
end
|
49
|
+
elsif dl.has_movies? and options[:convert]
|
50
|
+
dl.convert_media
|
51
|
+
end
|
44
52
|
|
45
53
|
puts "Do you want to delete the media from #{options[:src]}? [y/N]".yellow
|
46
54
|
delete = gets.strip
|
data/lib/getpics/downloader.rb
CHANGED
@@ -35,7 +35,7 @@ module Getpics
|
|
35
35
|
|
36
36
|
def copy_media
|
37
37
|
puts "Copying media..."
|
38
|
-
pb = ProgressBar.create(:title => "Media Copied", :total => @media_list.size)
|
38
|
+
pb = ProgressBar.create(:title => "Media Copied", :total => @media_list.size, :format => '%t: |%b%i| %c/%C %e')
|
39
39
|
@media_list.all_known_media.each do |media|
|
40
40
|
if ! File.exists?("#{media.target_path}")
|
41
41
|
pb.log ("Copying #{media.path} to #{media.target_path}").light_black if @verbose
|
@@ -66,9 +66,10 @@ module Getpics
|
|
66
66
|
end
|
67
67
|
return if movies_to_process.size == 0
|
68
68
|
puts "Converting movies to MP4..."
|
69
|
-
pb = ProgressBar.create(:title => "Movies Converted", :total => movies_to_process.size)
|
69
|
+
pb = ProgressBar.create(:title => "Movies Converted", :total => movies_to_process.size, :format => '%t: |%b%i| %c/%C %e')
|
70
70
|
movies_to_process.each do |movie|
|
71
|
-
system("#{ffmpeg_path} -i #{movie.target_path} -vcodec copy -acodec copy #{dest_path}")
|
71
|
+
#system("#{ffmpeg_path} -i #{movie.target_path} -vcodec copy -acodec copy #{dest_path}")
|
72
|
+
system("#{ffmpeg_path} -i #{movie.target_path} -c:v libx264 -b:v 5200K -maxrate 5200K -bufsize 5200K -c:a aac -b:a 128K -ar 44100 #{dest_path}")
|
72
73
|
pb.increment
|
73
74
|
end
|
74
75
|
end
|
@@ -83,6 +84,11 @@ module Getpics
|
|
83
84
|
end
|
84
85
|
end
|
85
86
|
|
87
|
+
def has_movies?
|
88
|
+
return true if @media_list.movies.size > 0
|
89
|
+
return false
|
90
|
+
end
|
91
|
+
|
86
92
|
def delete_media
|
87
93
|
@media_list.all_known_media.each do |media|
|
88
94
|
puts "Deleting #{media.orig_path}".red if @verbose
|
data/lib/getpics/media.rb
CHANGED
data/lib/getpics/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: getpics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Doug P.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|