peerflixrb 3.2.1 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/peerflixrb +6 -6
- data/lib/peerflixrb/commands.rb +4 -4
- data/lib/peerflixrb/version.rb +1 -1
- data/peerflixrb.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5dfd89e99e032b85e2d50c9bdc2e59a0c3f5b5d
|
4
|
+
data.tar.gz: dd0cee3efa4bfc1bb56626123d3d670fc0890bb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44b8353deff1e914a9c3fba534913e03b93e0ffc551429f4ace4ffe8c78dd44e1304a7b320611bcd3e10043be7cbb6f0d5cc50fae73f7856b1549222987d177e
|
7
|
+
data.tar.gz: 68cf576f13ac6f9d44d4313a6f80f9143e416d1449fb08282f9fcfef2b62fa88f4ac4a69b9cad59efe9e6775d45cbee2c19dab36c0b8870f739181ca1370cb5f
|
data/exe/peerflixrb
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w( .. lib ))
|
|
4
4
|
require 'optparse'
|
5
5
|
require 'peerflixrb'
|
6
6
|
require 'peerflixrb/commands'
|
7
|
-
require '
|
7
|
+
require 'zooqle_search'
|
8
8
|
|
9
9
|
options = {
|
10
10
|
language: 'en',
|
@@ -88,18 +88,18 @@ begin
|
|
88
88
|
# Check requirements
|
89
89
|
commands.check_requirements
|
90
90
|
|
91
|
-
#
|
92
|
-
cli.say "Searching
|
93
|
-
|
91
|
+
# Torrent Search
|
92
|
+
cli.say "Searching torrent for #{options[:search].blue}".yellow
|
93
|
+
torrent_search = ZooqleSearch::Search.new(options[:search])
|
94
94
|
|
95
95
|
# Did it find results?
|
96
|
-
unless
|
96
|
+
unless torrent_search.results_found?
|
97
97
|
cli.say "No results found for #{options[:search].blue}".red
|
98
98
|
exit
|
99
99
|
end
|
100
100
|
|
101
101
|
# Choose link and subtitles
|
102
|
-
link, sub_file = commands.choose_video_and_subtitles(
|
102
|
+
link, sub_file = commands.choose_video_and_subtitles(torrent_search, options)
|
103
103
|
|
104
104
|
# Peerflix command build
|
105
105
|
command = "peerflix '#{link.magnet}'"
|
data/lib/peerflixrb/commands.rb
CHANGED
@@ -22,14 +22,14 @@ module Peerflixrb
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def choose_video_and_subtitles(
|
25
|
+
def choose_video_and_subtitles(torrent_search, options)
|
26
26
|
# Proactively declare them because they would be lost in the block scope
|
27
27
|
link = nil
|
28
28
|
sub_file = nil
|
29
29
|
|
30
30
|
loop do
|
31
31
|
# Choose file
|
32
|
-
link = (options[:auto_select]) ?
|
32
|
+
link = (options[:auto_select]) ? torrent_search.links.first : select_link(torrent_search)
|
33
33
|
|
34
34
|
# Subtitle search
|
35
35
|
sub_file = if options[:find_subtitles]
|
@@ -64,10 +64,10 @@ module Peerflixrb
|
|
64
64
|
|
65
65
|
private
|
66
66
|
|
67
|
-
def select_link(
|
67
|
+
def select_link(torrent_search)
|
68
68
|
cli.say "Choose file (#{'seeders'.green}/#{'leechers'.red}):"
|
69
69
|
|
70
|
-
cli.choose(*
|
70
|
+
cli.choose(*torrent_search.links) do |menu|
|
71
71
|
menu.default = '1'
|
72
72
|
menu.select_by = :index
|
73
73
|
end
|
data/lib/peerflixrb/version.rb
CHANGED
data/peerflixrb.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
22
|
spec.add_runtime_dependency 'addic7ed_downloader', '~> 1.0'
|
23
|
-
spec.add_runtime_dependency '
|
23
|
+
spec.add_runtime_dependency 'zooqle_search', '~> 0.0'
|
24
24
|
spec.add_runtime_dependency 'nokogiri', '~> 1.6'
|
25
25
|
spec.add_runtime_dependency 'highline', '~> 1.7'
|
26
26
|
spec.add_runtime_dependency 'httparty', '~> 0.13'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peerflixrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Marchante
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addic7ed_downloader
|
@@ -25,19 +25,19 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: zooqle_search
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: nokogiri
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|