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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be94ca2f78ed6194f0b7ecff5a4bf0b5554f24a2
4
- data.tar.gz: cba42a9ec84765c12fe3ba311ac0710bb6061434
3
+ metadata.gz: 3817b93efc8da3c47ff78ae6f2e81dec361f4940
4
+ data.tar.gz: 0c4a6c210d1d6774810b612f6bd7ac13ec72a0fc
5
5
  SHA512:
6
- metadata.gz: 783cd1b4b72a5715331ecf4a500352d5df217a1a5a370acb25b188af879944986cc21a9dc87821bce17820bddc382a0d4490d1a91b84a1269fc9fa77951dff27
7
- data.tar.gz: 5233887fcd79060a67baa667d92ae709a320b87f2383b315657744f116b2d593f68bc3f0fb110178bbcdb42cad829bee94dd1b03fb5d91b31bc4e70543d4b0e4
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 @add_image_counter < 3
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
@@ -17,12 +17,9 @@ module FYT
17
17
  return RSS::Parser.parse(rss, false)
18
18
  end
19
19
  rescue
20
- @read_counter ||= 0
21
- @read_counter += 1
22
-
23
20
  @proxy_manager.remove(proxy)
24
21
 
25
- read if @read_counter < 3
22
+ read if @proxy_manager.proxies.size > 0
26
23
  end
27
24
  end
28
25
  end
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 @download_counter < 3
69
+ download_file!(url, output_path) if @proxy_manager.proxies.size > 0
74
70
  end
75
71
 
76
72
  def execute(command_string)
77
- Timeout::timeout(5) do
78
- IO.pipe do |read_io, write_io|
79
- break if system(command_string, out: write_io, err: write_io)
80
-
81
- write_io.close
82
- logger.debug read_io.read
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fyt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1.pre5
4
+ version: 1.1.1.pre6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steffen Schröder