nyaa_anime 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/nyaa_anime.rb +5 -2
- data/lib/nyaa_anime/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4ade53184cea136e9606d361cf8bb886d21f5440
|
|
4
|
+
data.tar.gz: ca6c5096f64f89365ce306e41dfb28fd67ccdad7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc83cb8e860153eb3bbfddb217e0da5cfd34771ea3bdf49ba93111bad47e713a6f0e7292a18cd17c607343c3637d3d9ff440b6e0d29ca51af6e29fd0e94be9bc
|
|
7
|
+
data.tar.gz: 9b4a6d21e92bd643e2eb0509189bfc6b610127a7d939222062c9ed77c2b28c7beab063bc9a0acd725d53c6dcd6dd3978366725cde257ef19325f567df57a20f7
|
data/lib/nyaa_anime.rb
CHANGED
|
@@ -8,6 +8,7 @@ class NyaaAnime
|
|
|
8
8
|
require 'colorize'
|
|
9
9
|
require 'levenshtein'
|
|
10
10
|
require 'set'
|
|
11
|
+
require 'fileutils'
|
|
11
12
|
|
|
12
13
|
NYAA_URI = "http://nyaa.se"
|
|
13
14
|
NYAA_SEARCH = "#{NYAA_URI}/?page=rss"
|
|
@@ -53,9 +54,10 @@ class NyaaAnime
|
|
|
53
54
|
new_titles.merge @new_titles
|
|
54
55
|
@new_titles.each { |ti| new_downloads[ti] = @downloads[ti] }
|
|
55
56
|
if @new_titles.any?
|
|
56
|
-
|
|
57
|
+
print @new_titles.count.to_s.colorize(:green)
|
|
57
58
|
end
|
|
58
59
|
end
|
|
60
|
+
print " - "
|
|
59
61
|
@new_titles = new_titles
|
|
60
62
|
@titles = new_titles.to_a.sort!
|
|
61
63
|
@downloads = new_downloads
|
|
@@ -63,7 +65,7 @@ class NyaaAnime
|
|
|
63
65
|
@version_differing_titles = Set.new
|
|
64
66
|
@other_titles = Set.new
|
|
65
67
|
if download_count > 0
|
|
66
|
-
puts "#{download_count} new episode#{"s" if download_count > 1} found!"
|
|
68
|
+
puts "#{download_count} new episode#{"s" if download_count > 1} found!".colorize(:green)
|
|
67
69
|
end
|
|
68
70
|
@titles.each_with_index { |t, i| puts "#{i+1}: #{t.colorize(NEW_COLOR)}" }
|
|
69
71
|
end
|
|
@@ -149,6 +151,7 @@ class NyaaAnime
|
|
|
149
151
|
def download(title)
|
|
150
152
|
torrent = open @downloads[title]
|
|
151
153
|
filename = torrent.meta["content-disposition"][/filename="(.+\.torrent)"/, 1]
|
|
154
|
+
FileUtils.mkdir_p NYAA_DL_DIR
|
|
152
155
|
open("#{NYAA_DL_DIR}#{filename}", "w") { |f| f.write torrent.read }
|
|
153
156
|
puts "#{title}.torrent downloaded."
|
|
154
157
|
"#{NYAA_DL_DIR}\"#{title}.torrent\""
|
data/lib/nyaa_anime/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nyaa_anime
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Tsubaki Wu
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-10-
|
|
11
|
+
date: 2014-10-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|