fyt 1.1.1.pre5 → 1.1.1.pre6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fyt/builder.rb +2 -5
- data/lib/fyt/parser.rb +1 -4
- data/lib/fyt/storage.rb +8 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3817b93efc8da3c47ff78ae6f2e81dec361f4940
|
4
|
+
data.tar.gz: 0c4a6c210d1d6774810b612f6bd7ac13ec72a0fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18533ac5ee75a01fc00dc5d047f917e5a232b2d10e5e221576bf74afee7db42779496eefb31f0a47a83ca4fee22aefb3f0ded9cc91dfdf44f15f996925232ca7
|
7
|
+
data.tar.gz: c6309f9a1acef18069269c39659a5443e8eb735425a328331b1154dad74f5ad7945d26a83fc99dcc2df8c8d5551090666d6d3df7e161bd8fab66b7440d1a45d6
|
data/lib/fyt/builder.rb
CHANGED
@@ -53,12 +53,9 @@ module FYT
|
|
53
53
|
rescue OpenURI::HTTPError => e
|
54
54
|
logger.debug "OpenURI::HTTPError: #{e.message}"
|
55
55
|
rescue
|
56
|
-
@add_image_counter ||= 0
|
57
|
-
@add_image_counter += 1
|
58
|
-
|
59
56
|
@proxy_manager.remove(proxy)
|
60
|
-
|
61
|
-
add_image(youtube_url, title) if @
|
57
|
+
|
58
|
+
add_image(youtube_url, title) if @proxy_manager.proxies.size > 0
|
62
59
|
end
|
63
60
|
|
64
61
|
def add_item(link, title, filename)
|
data/lib/fyt/parser.rb
CHANGED
data/lib/fyt/storage.rb
CHANGED
@@ -57,31 +57,25 @@ module FYT
|
|
57
57
|
"--merge-output-format '#{@output_format}'",
|
58
58
|
"-o '#{output_path}'",
|
59
59
|
"--proxy 'http://#{proxy.url}'",
|
60
|
-
"--socket-timeout '300'",
|
61
60
|
"'#{url}'"
|
62
61
|
].join(' ')
|
63
62
|
|
64
63
|
logger.debug "Executing: youtube-dl #{options_string}"
|
65
64
|
|
66
|
-
execute "youtube-dl #{options_string}"
|
65
|
+
execute "timeout --preserve-status 300 youtube-dl #{options_string}"
|
67
66
|
rescue
|
68
|
-
@download_counter ||= 0
|
69
|
-
@download_counter += 1
|
70
|
-
|
71
67
|
@proxy_manager.remove(proxy)
|
72
68
|
|
73
|
-
download_file!(url, output_path) if @
|
69
|
+
download_file!(url, output_path) if @proxy_manager.proxies.size > 0
|
74
70
|
end
|
75
71
|
|
76
72
|
def execute(command_string)
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
raise
|
84
|
-
end
|
73
|
+
IO.pipe do |read_io, write_io|
|
74
|
+
break if system(command_string, out: write_io, err: write_io)
|
75
|
+
|
76
|
+
write_io.close
|
77
|
+
logger.debug read_io.read
|
78
|
+
raise
|
85
79
|
end
|
86
80
|
end
|
87
81
|
|