download_tv 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -5
- data/lib/download_tv/downloader.rb +8 -10
- data/lib/download_tv/myepisodes.rb +1 -0
- data/lib/download_tv/torrent.rb +1 -2
- data/lib/download_tv/version.rb +1 -1
- data/test/config_test.rb +3 -3
- data/test/downloader_test.rb +0 -2
- 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: c8ef2446e644568bed8edcc096c4fad9f1f46daab2f29a5dfac1f9741950697f
|
4
|
+
data.tar.gz: 6e6edc31f51a40952a82772178b8b63fdf82c43d2a162b58a39b67d37171ab32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a035703eea5494882cd7443831cbe13fbda14c8148dd7f20bf8fa1f0dacbbbb065a72a755f154d1c7cd6622419e227a0f292e302fc570bf5607f06b96371705
|
7
|
+
data.tar.gz: 463597bacfa166c44001168b7b7506d3fefe4d7dd95743ab793cd3775e9c92afb81e27ab6c8633c68e00bff1da5a9f83850f79a8c52f3da0ec33994a5c684630
|
data/README.md
CHANGED
@@ -28,24 +28,44 @@ Specific options:
|
|
28
28
|
-s, --[no-]subtitles Download subtitles
|
29
29
|
-g, --grabber GRABBER Use given grabber as first option
|
30
30
|
--show-grabbers List available grabbers
|
31
|
+
-p, --pending Show list of pending downloads
|
32
|
+
--clear-pending Clear list of pending downloads
|
31
33
|
-v Print version
|
32
34
|
-h, --help Show this message
|
33
35
|
|
34
36
|
```
|
35
37
|
|
36
|
-
###
|
38
|
+
### MyEpisodes integration
|
37
39
|
|
38
|
-
By default,
|
40
|
+
By default, download_tv connects to your MyEpisodes.com account and fetches the list of episodes that have aired since the program was run for the last time. It then tries to find magnet links to download each of these shows, using the link grabbers available. You can see the grabbers with the --show-grabbers option. These magnet links will be executed with whatever program you have configured to handle the magnet:// files.
|
41
|
+
|
42
|
+
The -o flag can be used in order to re-download the episodes from previous days. The --dry-run option is useful to prevent download_tv from updating the date (for example, when running the application shortly after an episode airs).
|
43
|
+
|
44
|
+
**Note**: Due to API limitations, the gem won't find shows aired more than 14 days prior to the execution of the script.
|
45
|
+
|
46
|
+
The options -c and --show-config allow the user to change or view the current configuration values, respectively. These options include your myepisodes username, whether to save cookies or ask for password on each run and the list of ignored shows among other things. The configuration files are (mostly) backwards compatible. The gem will force you to change your configuration after an update if there are breaking changes in it.
|
47
|
+
|
48
|
+
The `auto` flag toggles whether all the results for each show are prompted to the user for him to choose or if the application should try to choose the download link automatically (by default, prioritizes PROPER/REPACK releases at 480p).
|
49
|
+
|
50
|
+
### Single torrent download
|
39
51
|
|
40
52
|
In order to download a single episode, use the -d flag, quoting the string when it contains spaces: *tv -d "Breaking Bad S04E01"*
|
41
53
|
|
54
|
+
Although it uses some settings and grabbers specific for TV shows, this option can also be used as a quick way to find and download any torrent.
|
55
|
+
|
56
|
+
### Multi torrent download
|
57
|
+
|
42
58
|
The -f flag can be used to read the list of episodes to download from a file. Each line of the file is interpreted as a episode to download: *tv -f /path/to/listofeps*
|
43
59
|
|
44
|
-
|
60
|
+
### Available link grabbers
|
45
61
|
|
46
|
-
|
62
|
+
With -g and --show-grabbers, the user can see what grabbers are available and choose one of these as their preferred option. By default, the application searches for torrents in TorrentAPI, ThePirateBay, EZTV and KAT, in that order, skipping to the next when one of them is down/doesn't have a torrent for said episode.
|
63
|
+
|
64
|
+
I usually publish a patch update to the gem when I detect one of them isn't working, disabling it or fixing it altogether. If a specific grabber is giving you problems, check whether you're running the latest version of the gem before opening an issue here.
|
65
|
+
|
66
|
+
### Pending shows
|
47
67
|
|
48
|
-
|
68
|
+
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). This list can be viewed by passing the -p flag to the tv binary. The list can be cleared with the --clear-pending option.
|
49
69
|
|
50
70
|
### License
|
51
71
|
|
@@ -33,7 +33,7 @@ module DownloadTV
|
|
33
33
|
if File.exist? filename
|
34
34
|
filename = File.realpath(filename)
|
35
35
|
t = Torrent.new(@config.content[:grabber])
|
36
|
-
to_download = File.readlines(filename, chomp:true)
|
36
|
+
to_download = File.readlines(filename, chomp: true)
|
37
37
|
fix_names(to_download).each { |show| download(get_link(t, show)) }
|
38
38
|
else
|
39
39
|
puts "Error: #{filename} not found"
|
@@ -47,11 +47,11 @@ module DownloadTV
|
|
47
47
|
# It connects to MyEpisodes in order to find which shows
|
48
48
|
# to track and which new episodes aired.
|
49
49
|
def run(dont_update_last_run, offset = 0)
|
50
|
-
pending = @config.content[:pending]
|
50
|
+
pending = @config.content[:pending].clone
|
51
51
|
@config.content[:pending].clear
|
52
52
|
pending ||= []
|
53
53
|
date = check_date(offset)
|
54
|
-
if pending.empty?
|
54
|
+
if pending.empty? && date.nil?
|
55
55
|
puts 'Everything up to date'
|
56
56
|
exit
|
57
57
|
end
|
@@ -63,7 +63,7 @@ module DownloadTV
|
|
63
63
|
puts 'Nothing to download'
|
64
64
|
|
65
65
|
else
|
66
|
-
t = Torrent.new
|
66
|
+
t = Torrent.new
|
67
67
|
|
68
68
|
queue = Queue.new
|
69
69
|
|
@@ -116,12 +116,12 @@ module DownloadTV
|
|
116
116
|
# based on a set of filters.
|
117
117
|
# When it's false it will prompt the user to select the preferred result
|
118
118
|
# Returns either a magnet link or an emptry string
|
119
|
-
def get_link(torrent, show, save_pending=false)
|
119
|
+
def get_link(torrent, show, save_pending = false)
|
120
120
|
links = torrent.get_links(show)
|
121
121
|
|
122
122
|
if links.empty?
|
123
123
|
@config.content[:pending] << show if save_pending
|
124
|
-
return ''
|
124
|
+
return ''
|
125
125
|
end
|
126
126
|
|
127
127
|
if @config.content[:auto]
|
@@ -156,9 +156,8 @@ module DownloadTV
|
|
156
156
|
# Or nil if the date is today
|
157
157
|
def check_date(offset)
|
158
158
|
last = @config.content[:date]
|
159
|
-
|
160
|
-
|
161
|
-
end
|
159
|
+
last -= offset
|
160
|
+
last if last != Date.today
|
162
161
|
end
|
163
162
|
|
164
163
|
##
|
@@ -171,7 +170,6 @@ module DownloadTV
|
|
171
170
|
@config.content[:ignored]
|
172
171
|
.include?(i.split(' ')[0..-2].join(' ').downcase)
|
173
172
|
end
|
174
|
-
|
175
173
|
end
|
176
174
|
|
177
175
|
##
|
data/lib/download_tv/torrent.rb
CHANGED
@@ -52,7 +52,6 @@ module DownloadTV
|
|
52
52
|
|
53
53
|
links
|
54
54
|
rescue NoTorrentsError
|
55
|
-
|
56
55
|
# Use next grabber
|
57
56
|
if @tries.positive?
|
58
57
|
@tries -= 1
|
@@ -63,7 +62,7 @@ module DownloadTV
|
|
63
62
|
reset_grabbers_order
|
64
63
|
reset_tries
|
65
64
|
puts "No torrents found for #{show}"
|
66
|
-
|
65
|
+
[]
|
67
66
|
end
|
68
67
|
end
|
69
68
|
|
data/lib/download_tv/version.rb
CHANGED
data/test/config_test.rb
CHANGED
@@ -55,7 +55,7 @@ describe DownloadTV::Configuration do
|
|
55
55
|
create_dummy_config(config_path)
|
56
56
|
|
57
57
|
split = DownloadTV::VERSION.split('.')
|
58
|
-
split[0] = (split[0].to_i
|
58
|
+
split[0] = (split[0].to_i - 1).to_s
|
59
59
|
new_version = split.join('.')
|
60
60
|
c = DownloadTV::Configuration.new(path: config_path)
|
61
61
|
c.breaking_changes?(new_version).must_equal true
|
@@ -65,7 +65,7 @@ describe DownloadTV::Configuration do
|
|
65
65
|
create_dummy_config(config_path)
|
66
66
|
|
67
67
|
split = DownloadTV::VERSION.split('.')
|
68
|
-
split[1] = (split[1].to_i
|
68
|
+
split[1] = (split[1].to_i - 1).to_s
|
69
69
|
new_version = split.join('.')
|
70
70
|
c = DownloadTV::Configuration.new(path: config_path)
|
71
71
|
c.breaking_changes?(new_version).must_equal true
|
@@ -75,7 +75,7 @@ describe DownloadTV::Configuration do
|
|
75
75
|
create_dummy_config(config_path)
|
76
76
|
|
77
77
|
split = DownloadTV::VERSION.split('.')
|
78
|
-
split[2] = (split[2].to_i
|
78
|
+
split[2] = (split[2].to_i - 1).to_s
|
79
79
|
new_version = split.join('.')
|
80
80
|
c = DownloadTV::Configuration.new(path: config_path)
|
81
81
|
c.breaking_changes?(new_version).must_equal false
|
data/test/downloader_test.rb
CHANGED
@@ -32,7 +32,6 @@ describe DownloadTV::Downloader do
|
|
32
32
|
dl = DownloadTV::Downloader.new(ignored: [], path: config_path)
|
33
33
|
dl.fix_names(shows).must_equal result
|
34
34
|
end
|
35
|
-
|
36
35
|
end
|
37
36
|
|
38
37
|
describe 'the reject_ignored method' do
|
@@ -43,7 +42,6 @@ describe DownloadTV::Downloader do
|
|
43
42
|
dl = DownloadTV::Downloader.new(ignored: ['ignored'], path: config_path)
|
44
43
|
dl.reject_ignored(shows).must_equal result
|
45
44
|
end
|
46
|
-
|
47
45
|
end
|
48
46
|
|
49
47
|
describe 'the check_date method' do
|
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.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- guille
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|