my-local-putio 4.3.0 → 4.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/lib/my-local-putio/fetcher.rb +10 -9
- data/lib/my-local-putio/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: d94ea788991c8c5098d95ab14f1bc81800f4ab11b26b73b9554a8a13bd58129f
|
4
|
+
data.tar.gz: 64e9f87e6498b45e1f18dd7148f5217f703a0ce6fff41caea329e8f9e89d9e05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df6785e66ff407966c5704f78b510708ec58032e81e1cbfeb18b51550c258d057902f79ed3f37adaef1fb31a637623993355b8e4f3e4047a46c97dbe2369f716
|
7
|
+
data.tar.gz: ee9cfad26ff5f473a00067679113250b3c4f3c0f36bd0d87010795d3489e9061fd7d6e87de686062140824a6524510467221702aa6409689c30e47fbffa49542
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -57,7 +57,7 @@ Examples:
|
|
57
57
|
my-local-putio -t 123 -l Downloads
|
58
58
|
my-local-putio -l Downloads --token 123
|
59
59
|
my-local-putio -l Downloads -t token123 -d -s --socks5-proxy 127.0.0.1:1234
|
60
|
-
my-local-putio -d -s --disk-threshold
|
60
|
+
my-local-putio -d -s --disk-threshold 1000
|
61
61
|
|
62
62
|
With Token variable (inline or exporting):
|
63
63
|
|
@@ -85,11 +85,11 @@ Examples:
|
|
85
85
|
my-local-putio -l Downloads -t 123 --temp-destination /tmp --with-subtitles
|
86
86
|
my-local-putio --local-destination Downloads -t 123 --debug --with-subtitles
|
87
87
|
my-local-putio --local-destination Downloads -t 123 --socks5-proxy 127.0.0.1:3333
|
88
|
-
my-local-putio -d -s --disk-threshold
|
88
|
+
my-local-putio -d -s --disk-threshold 1000
|
89
89
|
|
90
90
|
Verbose output example:
|
91
91
|
|
92
|
-
my-local-putio -t 123 -l Downloads -d -s --socks5-proxy 127.0.0.1:3333 --temp-destination /tmp --disk-threshold
|
92
|
+
my-local-putio -t 123 -l Downloads -d -s --socks5-proxy 127.0.0.1:3333 --temp-destination /tmp --disk-threshold 2000
|
93
93
|
|
94
94
|
Starting My Local Put.io - version 4.3.0
|
95
95
|
https://github.com/rafaelbiriba/my-local-putio
|
@@ -27,27 +27,28 @@ module MyLocalPutio
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def process_file(file, path)
|
30
|
-
|
30
|
+
file_path = File.join(path, file.name)
|
31
31
|
if file.content_type == "application/x-directory"
|
32
|
-
fetch_files(id: file.id, path:
|
32
|
+
fetch_files(id: file.id, path: file_path)
|
33
33
|
else
|
34
34
|
url = cli.get_download_url(file.id)["url"]
|
35
35
|
disk_manager.check_for_available_space_on_destinations!(file.size/1024/1024)
|
36
|
-
Downloader.new(@configuration).download(url,
|
36
|
+
Downloader.new(@configuration).download(url, file_path) unless file_exists?(file_path, file)
|
37
37
|
SubtitlesManager.new(configuration).fetch(file, path)
|
38
38
|
end
|
39
|
-
delete_file(
|
39
|
+
delete_file(file_path, file)
|
40
40
|
end
|
41
41
|
|
42
|
-
def delete_file(
|
42
|
+
def delete_file(file_path, file)
|
43
43
|
return unless configuration.delete_remote
|
44
|
-
logger.log "Deleting remote #{file.file_type.downcase}: #{
|
44
|
+
logger.log "Deleting remote #{file.file_type.downcase}: #{file_path}"
|
45
45
|
cli.delete_file(file.id)
|
46
46
|
end
|
47
47
|
|
48
|
-
def file_exists?(
|
49
|
-
|
50
|
-
|
48
|
+
def file_exists?(file_path, file)
|
49
|
+
local_full_path = File.join(configuration.local_destination, file_path)
|
50
|
+
file_exists = File.exists?(local_full_path) && File.size(local_full_path)/1024 == file.size/1024
|
51
|
+
logger.log "File already downloaded #{file_path}" if file_exists
|
51
52
|
file_exists
|
52
53
|
end
|
53
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: my-local-putio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.3.
|
4
|
+
version: 4.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Biriba
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|