download_tv 2.5.5 → 2.6.0

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
  SHA256:
3
- metadata.gz: 4054ab9c742ef1b4a8966b4a8e0f6adfb124142da744827e034e39574b2bc1e4
4
- data.tar.gz: 947049650860802c48eb0adcea1299caf1416e10cd5c1fab0a27d2f553dfb4f7
3
+ metadata.gz: cdd3f78afeabc9f480b3c8ec5aa31029706328b175c8c65b0ab886982eecb71b
4
+ data.tar.gz: b94540fc9e5a49193a8dea70abbe1b91f83e767bb06e11a181dd81a9c2d558a6
5
5
  SHA512:
6
- metadata.gz: 4e723e145e18922ee3bea26ac69db06c94c55e87f80059041c51486648469014c54fc1e1e08a77f369d3a85d04abe1e8b0958613b13d395f2d074188ed4190f1
7
- data.tar.gz: 2943f772dee6e8bb4a18c8086af317dc450e3453ff5dbef17886dc33442e0fd78aadc28928a218b3bdc9067d95f12e6af64f5144a82f5ca75c91625782456654
6
+ metadata.gz: f5b267c3a9502dbb034e31d4805d5aa6312d2d47adbace34c3b309281533f1831fb38834c0e2b957cc5ba56c72e0ef06e6a67d333d86731deb318756e4461743
7
+ data.tar.gz: ab7d015822c32df0a62e2e367cf246b28fa6e26d6d0e81a59e6c78131419d1b96d631c62157c5aece13e69b02c450afbed785aaf99e498e3711c3bbe867a6fe7
data/README.md CHANGED
@@ -32,6 +32,7 @@ Specific options:
32
32
  --show-grabbers List available grabbers
33
33
  -p, --pending Show list of pending downloads
34
34
  --clear-pending Clear list of pending downloads
35
+ -q, --queue Add show episode to pending downloads list
35
36
  -v, --version Print version
36
37
  -h, --help Show this message
37
38
  ```
@@ -72,6 +73,8 @@ I usually publish a patch update to the gem when I detect one of them isn't work
72
73
 
73
74
  download_tv version 2.5.0 persists the list of shows it can't find on a given execution (when connecting to MyEpisodes, not for single show or file downloads) and it will try to find them again on following executions. This list can be viewed by passing the -p flag to the tv binary. The list can be cleared with the --clear-pending option.
74
75
 
76
+ Version 2.6.0 adds functionality to queue an episode by running `tv --queue "show name"`. The --queue parameter cannot be used in conjunction with any other parameters. On the plus side, it doesn't need the show name to be quoted or the spaces escaped.
77
+
75
78
  ### Filters
76
79
 
77
80
  download_tv version 2.5.5 adds the possibility of setting include/exclude filters for the automatic download of shows.
data/bin/tv CHANGED
@@ -76,6 +76,11 @@ opt_parser = OptionParser.new do |opts|
76
76
  options[:cmd] = 'clearpending'
77
77
  end
78
78
 
79
+ opts.on('-q', '--queue SHOW', 'Add show episode to pending downloads list') do |s|
80
+ options[:cmd] = 'queue'
81
+ options[:arg] = s
82
+ end
83
+
79
84
  opts.on('-v', '--version', 'Print version') do
80
85
  puts DownloadTV::VERSION
81
86
  exit
@@ -115,6 +120,8 @@ begin
115
120
  DownloadTV::Configuration.new(config).print_attr(:pending)
116
121
  when 'clearpending'
117
122
  DownloadTV::Configuration.new(config).clear_pending
123
+ when 'queue'
124
+ DownloadTV::Configuration.new(config).queue_pending(options[:arg])
118
125
  end
119
126
  rescue Interrupt
120
127
  puts 'Interrupt signal detected. Exiting...'
@@ -147,5 +147,10 @@ module DownloadTV
147
147
  @content[:pending].clear
148
148
  serialize
149
149
  end
150
+
151
+ def queue_pending(show)
152
+ @content[:pending] << show
153
+ serialize
154
+ end
150
155
  end
151
156
  end
@@ -21,7 +21,7 @@ module DownloadTV
21
21
  end
22
22
  @agent.head(url)
23
23
  true
24
- rescue Mechanize::ResponseCodeError, Net::HTTP::Persistent::Error
24
+ rescue Mechanize::ResponseCodeError, Net::HTTP::Persistent::Error, Errno::ECONNRESET
25
25
  false
26
26
  end
27
27
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DownloadTV
4
- VERSION = '2.5.5'
4
+ VERSION = '2.6.0'
5
5
  end
@@ -62,37 +62,26 @@ describe DownloadTV::Downloader do
62
62
  end
63
63
 
64
64
  describe 'the filter_shows method' do
65
- it 'removes names with 2160p in them' do
66
- dl = DownloadTV::Downloader.new(path: config_path)
65
+ it 'removes names with exclude words in them' do
66
+ f = {:excludes => ["2160P"], :includes => []}
67
+ dl = DownloadTV::Downloader.new(path: config_path, filters: f)
67
68
  links = [['Link 1', ''], ['Link 2 2160p', ''], ['Link 3', '']]
68
69
  res = [['Link 1', ''], ['Link 3', '']]
69
70
  dl.filter_shows(links).must_equal res
70
71
  end
71
72
 
72
- it 'removes names with 1080p in them' do
73
- dl = DownloadTV::Downloader.new(path: config_path)
74
- links = [['Link.1080p', ''], ['Link 2 2160p', ''], ['Link 3', '']]
75
- res = [['Link 3', '']]
76
- dl.filter_shows(links).must_equal res
77
- end
78
-
79
- it 'removes names with 720p in them' do
80
- dl = DownloadTV::Downloader.new(path: config_path)
81
- links = [['Link 1', ''], ['Link 2 720p', ''], ['Link.720p.rip', '']]
82
- res = [['Link 1', '']]
83
- dl.filter_shows(links).must_equal res
84
- end
85
-
86
- it 'removes names without PROPER or REPACK in them' do
87
- dl = DownloadTV::Downloader.new(path: config_path)
73
+ it 'removes names without include words in them' do
74
+ f = {:excludes => [], :includes => %w[REPACK]}
75
+ dl = DownloadTV::Downloader.new(path: config_path, filters: f)
88
76
  links = [['Link 1', ''], ['Link 2 2160p', ''], ['Link 3', ''],
89
- ['Link 4 PROPER', ''], ['Link REPACK 5', '']]
90
- res = [['Link 4 PROPER', ''], ['Link REPACK 5', '']]
77
+ ['Link REPACK 5', '']]
78
+ res = [['Link REPACK 5', '']]
91
79
  dl.filter_shows(links).must_equal res
92
80
  end
93
81
 
94
82
  it "doesn't apply a filter if it would reject every option" do
95
- dl = DownloadTV::Downloader.new(path: config_path)
83
+ f = {:excludes => %w[2160P 720P], :includes => []}
84
+ dl = DownloadTV::Downloader.new(path: config_path, filters: f)
96
85
  links = [['Link 1 720p', ''], ['Link 2 2160p', ''], ['Link 720p 3', '']]
97
86
  res = [['Link 1 720p', ''], ['Link 720p 3', '']]
98
87
  dl.filter_shows(links).must_equal res
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: download_tv
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.5
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - guille
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-06 00:00:00.000000000 Z
11
+ date: 2019-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler