miyuki 0.1.2 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +5 -0
- data/Gemfile.lock +24 -0
- data/README.md +14 -0
- data/Rakefile +12 -0
- data/bin/miyuki +22 -9
- data/example/miyuki.conf +12 -0
- data/lib/miyuki/miyuki.rb +21 -19
- data/lib/miyuki/tracker.rb +7 -7
- data/lib/miyuki/version.rb +6 -6
- data/lib/miyuki.rb +6 -5
- data/miyuki.gemspec +20 -0
- metadata +23 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a738dc0caf96d28fc8b3807262a1ac9cf8c2a9c0
|
4
|
+
data.tar.gz: a3b604faf11c4e3470d4055fdeadcb457323080f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52e7cd31f0bcee2b41e9d72bcf012db2fe231ec420abed99c75dfaf6048c92a07282f8161e3c2f5ed8d27267fa22117667dbf116dea3e8a09af360942270d77d
|
7
|
+
data.tar.gz: 83cd396adc61d5f6c077ac184cb0e99257ce01d621f2b8a3bb1ad9e83ae522a29bf51eaab7d6a3f365ead4604a6e385066d958afc0593facaeb46ff5be72ea42
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
color (1.7.1)
|
5
|
+
colorb (0.0.9)
|
6
|
+
color
|
7
|
+
foreverb (0.3.2)
|
8
|
+
thor (>= 0.15.0)
|
9
|
+
rufus-scheduler (3.0.9)
|
10
|
+
tzinfo
|
11
|
+
thor (0.19.1)
|
12
|
+
thread_safe (0.3.4)
|
13
|
+
tzinfo (1.2.2)
|
14
|
+
thread_safe (~> 0.1)
|
15
|
+
yamazaki (0.3)
|
16
|
+
colorb (~> 0)
|
17
|
+
|
18
|
+
PLATFORMS
|
19
|
+
ruby
|
20
|
+
|
21
|
+
DEPENDENCIES
|
22
|
+
foreverb
|
23
|
+
rufus-scheduler
|
24
|
+
yamazaki (>= 0.3)
|
data/README.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
Miyuki – Non ti lascia mai solo
|
2
|
+
===============================
|
3
|
+
|
4
|
+
After having configured the `example/miyuki.conf` configuration file, Miyuki lets you to have always the latest episodes of anime you're watching, downloading the episodes whenever they're available on Nyaa.
|
5
|
+
|
6
|
+
Of course, set the watch directory inside the configuration file to the one you've set in your torrent client.
|
7
|
+
|
8
|
+
How to use
|
9
|
+
----------
|
10
|
+
`$ gem install miyuki`
|
11
|
+
|
12
|
+
`$ miyuki start example/miyuki.conf`
|
13
|
+
|
14
|
+
`$ miyuki stop` (or `$ miyuki kill`)
|
data/Rakefile
ADDED
data/bin/miyuki
CHANGED
@@ -1,22 +1,35 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
##
|
3
|
-
#
|
4
|
-
#
|
3
|
+
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
4
|
+
# Version 2, December 2004
|
5
5
|
#
|
6
6
|
# Everyone is permitted to copy and distribute verbatim or modified
|
7
7
|
# copies of this license document, and changing it is allowed as long
|
8
8
|
# as the name is changed.
|
9
9
|
#
|
10
|
-
#
|
11
|
-
#
|
10
|
+
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
11
|
+
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
12
12
|
#
|
13
|
-
#
|
13
|
+
# 0. You just DO WHAT THE FUCK YOU WANT TO.
|
14
14
|
##
|
15
15
|
|
16
16
|
require 'miyuki'
|
17
|
+
require 'forever'
|
17
18
|
|
18
|
-
|
19
|
-
abort 'Given configuration file does not exist.' unless File.exists?(ARGV[0])
|
19
|
+
config_file = File.expand_path(ARGV.last) if ARGV.any?
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
unless ['kill', 'stop'].include?(ARGV[0])
|
22
|
+
abort 'Please provide a configuration file.' if ARGV.length <= 1
|
23
|
+
abort 'Given configuration file does not exist.' unless File.exists?(config_file)
|
24
|
+
end
|
25
|
+
|
26
|
+
Forever.run do
|
27
|
+
dir File.expand_path('..', __FILE__)
|
28
|
+
log File.join(dir, '/miyuki.log')
|
29
|
+
pid File.join(dir, '/miyuki.pid')
|
30
|
+
|
31
|
+
before :all do
|
32
|
+
Miyuki.config = config_file
|
33
|
+
Miyuki.track!
|
34
|
+
end
|
35
|
+
end
|
data/example/miyuki.conf
ADDED
data/lib/miyuki/miyuki.rb
CHANGED
@@ -1,29 +1,31 @@
|
|
1
1
|
##
|
2
|
-
#
|
3
|
-
#
|
2
|
+
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
3
|
+
# Version 2, December 2004
|
4
4
|
#
|
5
5
|
# Everyone is permitted to copy and distribute verbatim or modified
|
6
6
|
# copies of this license document, and changing it is allowed as long
|
7
7
|
# as the name is changed.
|
8
8
|
#
|
9
|
-
#
|
10
|
-
#
|
9
|
+
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
10
|
+
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
11
11
|
#
|
12
|
-
#
|
12
|
+
# 0. You just DO WHAT THE FUCK YOU WANT TO.
|
13
13
|
##
|
14
14
|
|
15
15
|
module Miyuki
|
16
16
|
class << self
|
17
17
|
def config=(config_file)
|
18
|
-
|
19
|
-
|
18
|
+
@config_file = config_file
|
19
|
+
@config = load_config
|
20
20
|
|
21
21
|
Rufus::Scheduler.singleton.every('10m') { refresh_config! }
|
22
22
|
end
|
23
23
|
|
24
24
|
def track!
|
25
|
-
watch_dir = File.expand_path(
|
26
|
-
|
25
|
+
watch_dir = File.expand_path(@config['configuration']['watchDir'])
|
26
|
+
FileUtils.mkdir_p(watch_dir) unless File.directory?(watch_dir)
|
27
|
+
|
28
|
+
@tracker = Tracker.new(watch_dir, @config['series'])
|
27
29
|
|
28
30
|
run_scheduler
|
29
31
|
end
|
@@ -33,32 +35,32 @@ module Miyuki
|
|
33
35
|
def refresh_config!
|
34
36
|
new_config = load_config
|
35
37
|
|
36
|
-
if
|
37
|
-
|
38
|
-
|
38
|
+
if @config != new_config
|
39
|
+
@config = new_config
|
40
|
+
@scheduler.pause if defined?(@scheduler)
|
39
41
|
track!
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
43
45
|
def load_config
|
44
|
-
YAML.load(File.read(
|
46
|
+
YAML.load(File.read(@config_file))
|
45
47
|
end
|
46
48
|
|
47
49
|
def run_scheduler
|
48
|
-
|
49
|
-
|
50
|
-
old_torrents =
|
50
|
+
@scheduler = Rufus::Scheduler.new
|
51
|
+
@scheduler.every @config['configuration']['refreshEvery'] do
|
52
|
+
old_torrents = @tracker.torrents
|
51
53
|
|
52
|
-
|
54
|
+
@tracker.refresh
|
53
55
|
|
54
|
-
new_torrents =
|
56
|
+
new_torrents = @tracker.torrents - old_torrents
|
55
57
|
if new_torrents.any?
|
56
58
|
puts 'New torrents:'
|
57
59
|
new_torrents.each { |torrent| puts torrent.to_s }
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
61
|
-
|
63
|
+
@scheduler.join
|
62
64
|
end
|
63
65
|
end
|
64
66
|
end
|
data/lib/miyuki/tracker.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
##
|
2
|
-
#
|
3
|
-
#
|
2
|
+
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
3
|
+
# Version 2, December 2004
|
4
4
|
#
|
5
5
|
# Everyone is permitted to copy and distribute verbatim or modified
|
6
6
|
# copies of this license document, and changing it is allowed as long
|
7
7
|
# as the name is changed.
|
8
8
|
#
|
9
|
-
#
|
10
|
-
#
|
9
|
+
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
10
|
+
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
11
11
|
#
|
12
|
-
#
|
12
|
+
# 0. You just DO WHAT THE FUCK YOU WANT TO.
|
13
13
|
##
|
14
14
|
|
15
15
|
module Miyuki
|
@@ -26,8 +26,6 @@ module Miyuki
|
|
26
26
|
refresh
|
27
27
|
end
|
28
28
|
|
29
|
-
private
|
30
|
-
|
31
29
|
def refresh
|
32
30
|
@torrents = []
|
33
31
|
|
@@ -35,6 +33,8 @@ module Miyuki
|
|
35
33
|
@torrents.each { |torrent| Yamazaki.download_torrent(torrent.title, torrent.link) }
|
36
34
|
end
|
37
35
|
|
36
|
+
private
|
37
|
+
|
38
38
|
def fetch_torrents
|
39
39
|
@series.each do |series|
|
40
40
|
pattern = pattern_of(series)
|
data/lib/miyuki/version.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
##
|
2
|
-
#
|
3
|
-
#
|
2
|
+
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
3
|
+
# Version 2, December 2004
|
4
4
|
#
|
5
5
|
# Everyone is permitted to copy and distribute verbatim or modified
|
6
6
|
# copies of this license document, and changing it is allowed as long
|
7
7
|
# as the name is changed.
|
8
8
|
#
|
9
|
-
#
|
10
|
-
#
|
9
|
+
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
10
|
+
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
11
11
|
#
|
12
|
-
#
|
12
|
+
# 0. You just DO WHAT THE FUCK YOU WANT TO.
|
13
13
|
##
|
14
14
|
|
15
15
|
module Miyuki
|
16
|
-
VERSION = '0.
|
16
|
+
VERSION = '0.2'
|
17
17
|
end
|
data/lib/miyuki.rb
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
##
|
2
|
-
#
|
3
|
-
#
|
2
|
+
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
3
|
+
# Version 2, December 2004
|
4
4
|
#
|
5
5
|
# Everyone is permitted to copy and distribute verbatim or modified
|
6
6
|
# copies of this license document, and changing it is allowed as long
|
7
7
|
# as the name is changed.
|
8
8
|
#
|
9
|
-
#
|
10
|
-
#
|
9
|
+
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
10
|
+
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
11
11
|
#
|
12
|
-
#
|
12
|
+
# 0. You just DO WHAT THE FUCK YOU WANT TO.
|
13
13
|
##
|
14
14
|
|
15
|
+
require 'fileutils'
|
15
16
|
require 'yaml'
|
16
17
|
require 'rufus-scheduler'
|
17
18
|
require 'yamazaki'
|
data/miyuki.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Kernel.load 'lib/miyuki/version.rb'
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = 'miyuki'
|
5
|
+
s.version = Miyuki::VERSION
|
6
|
+
s.author = 'Roxas Shadow'
|
7
|
+
s.email = 'webmaster@giovannicapuano.net'
|
8
|
+
s.homepage = 'https://github.com/RoxasShadow/Miyuki'
|
9
|
+
s.platform = Gem::Platform::RUBY
|
10
|
+
s.summary = 'Miyuki allows you to not miss any episode of anime you\'re watching'
|
11
|
+
s.description = 'Miyuki downloads automatically every episode of anime you\'re watching'
|
12
|
+
s.files = `git ls-files -z`.split("\0")
|
13
|
+
s.require_path = 'lib'
|
14
|
+
s.executables = 'miyuki'
|
15
|
+
s.license = 'WTFPL'
|
16
|
+
|
17
|
+
s.add_dependency 'yamazaki', '~> 0.3'
|
18
|
+
s.add_dependency 'rufus-scheduler', '~> 3.0'
|
19
|
+
s.add_dependency 'foreverb', '~> 0.3'
|
20
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miyuki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roxas Shadow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yamazaki
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: foreverb
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.3'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.3'
|
41
55
|
description: Miyuki downloads automatically every episode of anime you're watching
|
42
56
|
email: webmaster@giovannicapuano.net
|
43
57
|
executables:
|
@@ -45,12 +59,18 @@ executables:
|
|
45
59
|
extensions: []
|
46
60
|
extra_rdoc_files: []
|
47
61
|
files:
|
62
|
+
- Gemfile
|
63
|
+
- Gemfile.lock
|
64
|
+
- README.md
|
65
|
+
- Rakefile
|
48
66
|
- bin/miyuki
|
67
|
+
- example/miyuki.conf
|
49
68
|
- lib/miyuki.rb
|
50
69
|
- lib/miyuki/miyuki.rb
|
51
70
|
- lib/miyuki/tracker.rb
|
52
71
|
- lib/miyuki/version.rb
|
53
|
-
|
72
|
+
- miyuki.gemspec
|
73
|
+
homepage: https://github.com/RoxasShadow/Miyuki
|
54
74
|
licenses:
|
55
75
|
- WTFPL
|
56
76
|
metadata: {}
|