my-local-putio 4.3.1 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +8 -5
- data/lib/my-local-putio.rb +1 -0
- data/lib/my-local-putio/configuration.rb +11 -5
- data/lib/my-local-putio/downloader.rb +3 -1
- data/lib/my-local-putio/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0645c62fc7702d0675aea5789b127e6a64e1b97daa7c56a79356db63994bec72
|
4
|
+
data.tar.gz: c2d94609c5bee2a49befdb947b4631b0e33464efdc871ed23edf97ccce7a2260
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec4015fbe7793a523bb37b430e38f0012c2e582ceee93f3a2f53b9f6de219a7b042070e1975583f384511cfb9f1870b11f5fc15741285a821aa25a3797f72fe8
|
7
|
+
data.tar.gz: aceb70d9770dc59bb0f71b9e0e0b0e2944ec9d8d1e7d3949bcfb4f55ef7d2c4c214bfd9af18590cf016973dd8c4531f2109001f5661be46fc489128961c3e669
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -42,11 +42,12 @@ To update your installed version:
|
|
42
42
|
-d, --delete-remote Delete remote file/folder after the download
|
43
43
|
-s, --with-subtitles Fetch subtitles from Put.io api
|
44
44
|
-v, --version Print my-local-putio version
|
45
|
+
--debug Debug mode [Developer mode]
|
46
|
+
--disk-threshold size Stops the downloads when the disk space threshold is reached. (Size in MB, e.g: 2000 for 2GB)
|
47
|
+
--detailed-progress Detailed download information instead a progress bar
|
45
48
|
--temp-destination FULLPATH Temporary destination for the incomplete downloads (Default: 'local_destination'/incomplete_downloads)
|
46
49
|
--silent Hide all messages and progress bar
|
47
|
-
--debug Debug mode [Developer mode]
|
48
50
|
--socks5-proxy hostname:port SOCKS5 hostname and port for proxy. Format: 127.0.0.1:1234
|
49
|
-
--disk-threshold size Stops the downloads when the disk space threshold is reached. (Size in MB, e.g: 2000 for 2GB)
|
50
51
|
|
51
52
|
#### Required attributes:
|
52
53
|
* **-t** or **--token**: Your Put.io Token. This attribute becames optional if you set `PUTIO_TOKEN` env variable with your token (Can be inline or into your bash profile). Check examples below.
|
@@ -71,11 +72,12 @@ With Token variable (inline or exporting):
|
|
71
72
|
* **-s** or **--with-subtitles**: Download subtitles from Put.io API if available. (Remember to set your preferred subtitle language on Put.io Settings website, otherwise no subtitle will be available for download.)
|
72
73
|
* **-h**: Print the help usage message
|
73
74
|
* **-v** or **--version**: Print the version of the application
|
75
|
+
* **--debug**: Developer mode: Prints everything and expose URLs with tokens for debug purposes.
|
76
|
+
* **--disk-threshold**: Set a disk threshold **(in MB)** to prevent the script to fill up the entire disk. The threshold value is in MB **(e.g 1000 for 1GB)**. The script will test both download folder and temporary folder to detect if there is enough space before download each file. If the free space is less than (file size + disk threshold) the script will stop. (Example: If the folder have 10GB available, and the threshold is set to 2GB (2000), the script will stop before start downloading a file with 9GB size)
|
77
|
+
* **--detailed-progress**: Display the default curl output with a detailed information of the download, instead of a simple progress bar.
|
74
78
|
* **--temp-destination**: Overwrite the default path (incomplete_downloads folder) of the temporary download files. After the download the complete file is moved to the selected local destination.
|
75
79
|
* **--silent**: Hide all messages and progress bar. Recommended for Cronjob tasks.
|
76
|
-
* **--debug**: Developer mode: Prints everything and expose URLs with tokens for debug purposes.
|
77
80
|
* **--socks5-proxy**: Enable the SOCKS5 proxy. If enabled, all the connections for PUT.IO API and the downloads will be performed using this proxy. If the socks connection became unavailable, the application will raise an error and will stop.
|
78
|
-
* **--disk-threshold**: Set a disk threshold **(in MB)** to prevent the script to fill up the entire disk. The threshold value is in MB **(e.g 1000 for 1GB)**. The script will test both download folder and temporary folder to detect if there is enough space before download each file. If the free space is less than (file size + disk threshold) the script will stop. (Example: If the folder have 10GB available, and the threshold is set to 2GB (2000), the script will stop before start downloading a file with 9GB size)
|
79
81
|
|
80
82
|
Examples:
|
81
83
|
|
@@ -89,7 +91,7 @@ Examples:
|
|
89
91
|
|
90
92
|
Verbose output example:
|
91
93
|
|
92
|
-
my-local-putio -t 123 -l Downloads -d -s --socks5-proxy 127.0.0.1:3333 --temp-destination /tmp --disk-threshold 2000
|
94
|
+
my-local-putio -t 123 -l Downloads -d -s --socks5-proxy 127.0.0.1:3333 --temp-destination /tmp --disk-threshold 2000 --detailed-progress
|
93
95
|
|
94
96
|
Starting My Local Put.io - version 4.3.0
|
95
97
|
https://github.com/rafaelbiriba/my-local-putio
|
@@ -98,6 +100,7 @@ Verbose output example:
|
|
98
100
|
Full path of the temporary destination: /tmp (Free space: 8543 MB)
|
99
101
|
>>> Delete remote files enabled!
|
100
102
|
>>> With subtitles enabled!
|
103
|
+
>>> With detailed progress bar!
|
101
104
|
>>> SOCKS5 enabled with 127.0.0.1:3333
|
102
105
|
>>> With disk threshold of 2000 MB!
|
103
106
|
=============================================
|
data/lib/my-local-putio.rb
CHANGED
@@ -40,6 +40,7 @@ module MyLocalPutio
|
|
40
40
|
puts "Full path of the temporary destination: #{File.realdirpath(configuration.temp_destination)} (Free space: #{configuration.disk_manager.get_folder_free_space(configuration.temp_destination)} MB)"
|
41
41
|
puts ">>> Delete remote files enabled!" if configuration.delete_remote
|
42
42
|
puts ">>> With subtitles enabled!" if configuration.with_subtitles
|
43
|
+
puts ">>> With detailed progress bar!" if configuration.detailed_progress
|
43
44
|
puts ">>> SOCKS5 enabled with #{configuration.socks_host}:#{configuration.socks_port}" if configuration.socks_enabled?
|
44
45
|
puts ">>> With disk threshold of #{configuration.disk_threshold} MB!" if configuration.disk_threshold
|
45
46
|
puts ">>> DEBUG enabled! Hello Mr(s) developer :)" if configuration.debug
|
@@ -2,7 +2,7 @@ module MyLocalPutio
|
|
2
2
|
class Configuration
|
3
3
|
attr_reader :token, :local_destination, :temp_destination,
|
4
4
|
:silent, :debug, :socks_host, :socks_port, :delete_remote, :with_subtitles,
|
5
|
-
:disk_threshold
|
5
|
+
:disk_threshold, :detailed_progress
|
6
6
|
|
7
7
|
def initialize
|
8
8
|
read_args_from_envs!
|
@@ -35,15 +35,21 @@ module MyLocalPutio
|
|
35
35
|
exit
|
36
36
|
end
|
37
37
|
|
38
|
+
opt.on("--debug", "Debug mode [Developer mode]") { |v| @debug = true }
|
39
|
+
|
40
|
+
opt.on("--disk-threshold size", "Stops the downloads when the disk space threshold is reached. (Size in MB, e.g: 2000 for 2GB)") do |v|
|
41
|
+
@disk_threshold = v.to_i
|
42
|
+
end
|
43
|
+
|
44
|
+
opt.on("--detailed-progress", "Detailed download information instead a progress bar") { |v| @detailed_progress = true }
|
45
|
+
|
38
46
|
opt.on("--temp-destination FULLPATH", "Temporary destination for the incomplete downloads (Default: 'local_destination'/incomplete_downloads)") { |v| @temp_destination = v }
|
47
|
+
|
39
48
|
opt.on("--silent", "Hide all messages and progress bar") { |v| @silent = true }
|
40
|
-
|
49
|
+
|
41
50
|
opt.on("--socks5-proxy hostname:port", "SOCKS5 hostname and port for proxy. Format: 127.0.0.1:1234") do |v|
|
42
51
|
@socks_host, @socks_port = v.to_s.split(":")
|
43
52
|
end
|
44
|
-
opt.on("--disk-threshold size", "Stops the downloads when the disk space threshold is reached. (Size in MB, e.g: 2000 for 2GB)") do |v|
|
45
|
-
@disk_threshold = v.to_i
|
46
|
-
end
|
47
53
|
end.parse!
|
48
54
|
end
|
49
55
|
|
@@ -40,9 +40,11 @@ module MyLocalPutio
|
|
40
40
|
temp_destination = File.join(configuration.temp_destination, path)
|
41
41
|
|
42
42
|
command = [
|
43
|
-
"curl", "--create-dirs", "
|
43
|
+
"curl", "--create-dirs", "-L", "--retry", "5", "-S", "-C", "-", "-o", temp_destination, url.to_s
|
44
44
|
]
|
45
45
|
|
46
|
+
command.push("--progress-bar") unless configuration.detailed_progress
|
47
|
+
|
46
48
|
command.push("--silent") if logger.silent?
|
47
49
|
|
48
50
|
if configuration.socks_enabled?
|