peerflixrb 5.1.0 → 5.2.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
  SHA1:
3
- metadata.gz: '038469d53f6bf8fb13d7e2395aec03366266623f'
4
- data.tar.gz: 3590a2fdaf30b2742342b489bdb8d288ae1cdfba
3
+ metadata.gz: bfac2d0e23e7f8cedbf7b36f1453f9912b9645f5
4
+ data.tar.gz: 5975ecbb732372f750f722b7ea44083345e98f14
5
5
  SHA512:
6
- metadata.gz: d89862f29e198b0bff01be9c85e4abad173c5ad66761ccebbc1f50eac6e9e9d162dabb2efc6ce0c7678728a28594d8eb1c4062f68b37f76964f3d1d29e8c41ef
7
- data.tar.gz: 2da246b6947ef648289599a66f6aba05b890c836abdadf66a681b6df54c6384e9f34c4b86ce0862870d5ccf35bd1d2210e13be1b6f8fc161455ca0021911fa25
6
+ metadata.gz: fc9fb70e3e861cce8f2256a0522c64328d5b50946dd0149b658e5aee7b2ab4e1fa596b5de5f727743cb3cf81c0245e5e7a09021818f1238c49469a800f80e804
7
+ data.tar.gz: c83008d59990916ad17ca524528aec587e9c27febd98c1e5785e89959615c9ea3811eba928ab0db6fdc36e164b6a1220fcd27c9849563a787b9bd75d9f8076a5
Binary file
Binary file
Binary file
data/exe/peerflixrb CHANGED
@@ -2,12 +2,11 @@
2
2
 
3
3
  require 'optparse'
4
4
  require 'peerflixrb'
5
- require 'peerflixrb/commands'
6
- require 'tpb_search'
5
+ require 'zooqle_search'
7
6
 
8
7
  options = {
9
8
  language: 'en',
10
- video_player: 'vlc'
9
+ video_player: 'mpv'
11
10
  }
12
11
 
13
12
  optparse = OptionParser.new do |opts|
@@ -25,7 +24,7 @@ optparse = OptionParser.new do |opts|
25
24
  options[:video_player] = 'mplayer'
26
25
  end
27
26
 
28
- opts.on('-k', '--mpv', 'Autoplay in mpv*') do
27
+ opts.on('-k', '--mpv', 'Autoplay in mpv* (Default)') do
29
28
  options[:video_player] = 'mpv'
30
29
  end
31
30
 
@@ -37,6 +36,10 @@ optparse = OptionParser.new do |opts|
37
36
  options[:video_player] = 'dlna'
38
37
  end
39
38
 
39
+ opts.on('-V', '--vlc', 'Autoplay in vlc*') do
40
+ options[:video_player] = 'vlc'
41
+ end
42
+
40
43
  opts.on('-s', '--find-subtitles', 'Find subtitles') do
41
44
  options[:find_subtitles] = true
42
45
  end
@@ -85,11 +88,11 @@ begin
85
88
  cli = commands.cli
86
89
 
87
90
  # Check requirements
88
- commands.check_requirements
91
+ webtorrent = commands.webtorrent
89
92
 
90
93
  # Torrent Search
91
94
  cli.say "Searching torrent for #{options[:search].blue}".yellow
92
- torrent_search = TpbSearch::Search.new(options[:search])
95
+ torrent_search = ZooqleSearch::Search.new(options[:search])
93
96
 
94
97
  # Did it find results?
95
98
  unless torrent_search.results_found?
@@ -101,7 +104,7 @@ begin
101
104
  link, sub_file = commands.choose_video_and_subtitles(torrent_search, options)
102
105
 
103
106
  # Webtorrent command build
104
- command = "webtorrent '#{link.magnet}'"
107
+ command = "#{webtorrent} '#{link.magnet}'"
105
108
  command << " --subtitles \"#{sub_file}\"" if sub_file
106
109
  command << " --#{options[:video_player]}" if options[:video_player]
107
110
 
data/lib/peerflixrb.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'peerflixrb/commands'
1
2
  require 'peerflixrb/imdb'
2
- require 'peerflixrb/yify'
3
3
  require 'peerflixrb/version'
4
+ require 'peerflixrb/yify'
@@ -3,7 +3,7 @@ require 'highline'
3
3
 
4
4
  module Peerflixrb
5
5
  class Commands
6
- attr_accessor :cli
6
+ attr_reader :cli
7
7
 
8
8
  def initialize
9
9
  @cli = HighLine.new
@@ -22,6 +22,11 @@ module Peerflixrb
22
22
  end
23
23
  end
24
24
 
25
+ def webtorrent
26
+ return "bin/webtorrent-cli-#{os}" if os
27
+ return 'webtorrent' if check_requirements
28
+ end
29
+
25
30
  def choose_video_and_subtitles(torrent_search, options)
26
31
  # Proactively declare them because they would be lost in the block scope
27
32
  link = nil
@@ -29,7 +34,7 @@ module Peerflixrb
29
34
 
30
35
  loop do
31
36
  # Choose file
32
- link = (options[:auto_select]) ? torrent_search.links.first : select_link(torrent_search)
37
+ link = options[:auto_select] ? torrent_search.links.first : select_link(torrent_search)
33
38
 
34
39
  # Subtitle search
35
40
  sub_file = if options[:find_subtitles]
@@ -79,13 +84,14 @@ module Peerflixrb
79
84
  find_tv_subtitles(video_file, options)
80
85
  else
81
86
  movie = Imdb.find(options[:search])
82
- find_movie_subtitles(movie, 'english')
87
+ YifySubtitles.download(movie.imdb_id, 'english')
83
88
  end
84
89
  end
85
90
 
86
91
  def find_tv_subtitles(video_file, options)
87
92
  # TV Show search based on video filename
88
- search = Addic7edDownloader::Search.by_filename(options[:search], lang: options[:language])
93
+ search = Addic7edDownloader::Search.by_filename options[:search],
94
+ lang: options[:language]
89
95
  search.extract_tags(video_file)
90
96
  return search.download_best unless options[:choose_subtitles]
91
97
 
@@ -98,9 +104,15 @@ module Peerflixrb
98
104
  search.download_subtitle(subtitle)
99
105
  end
100
106
 
101
- def find_movie_subtitles(movie, language)
102
- sub_file = YifySubtitles.download(movie.imdb_id, language)
103
- return sub_file unless sub_file.nil?
107
+ def os
108
+ case RbConfig::CONFIG['host_os'].downcase
109
+ when /linux/
110
+ 'linux'
111
+ when /darwin/
112
+ 'macos'
113
+ when /mswin|mingw/
114
+ 'win.exe'
115
+ end
104
116
  end
105
117
  end
106
118
  end
@@ -1,3 +1,3 @@
1
1
  module Peerflixrb
2
- VERSION = '5.1.0'.freeze
2
+ VERSION = '5.2.0'.freeze
3
3
  end
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 'tpb_search'
23
+ spec.add_runtime_dependency 'zooqle_search', '~> 1.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'
@@ -32,4 +32,5 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'guard-rspec', '~> 4.6'
33
33
  spec.add_development_dependency 'pry', '~> 0.10'
34
34
  spec.add_development_dependency 'pry-byebug', '~> 3.4'
35
+ spec.add_development_dependency 'awesome_print'
35
36
  end
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: 5.1.0
4
+ version: 5.2.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: 2017-02-08 00:00:00.000000000 Z
11
+ date: 2017-05-09 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: tpb_search
28
+ name: zooqle_search
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '1.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: '0'
40
+ version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -178,6 +178,20 @@ dependencies:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: '3.4'
181
+ - !ruby/object:Gem::Dependency
182
+ name: awesome_print
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
181
195
  description: With peerflixrb you can search for movies and TV shows and stream them
182
196
  directly on your favorite video player! You can choose the torrent and the subtitles
183
197
  file or you can let it choose the best for you.
@@ -198,6 +212,9 @@ files:
198
212
  - Rakefile
199
213
  - bin/console
200
214
  - bin/setup
215
+ - bin/webtorrent-cli-linux
216
+ - bin/webtorrent-cli-macos
217
+ - bin/webtorrent-cli-win.exe
201
218
  - exe/peerflixrb
202
219
  - lib/peerflixrb.rb
203
220
  - lib/peerflixrb/commands.rb
@@ -225,7 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
242
  version: '0'
226
243
  requirements: []
227
244
  rubyforge_project:
228
- rubygems_version: 2.6.10
245
+ rubygems_version: 2.6.12
229
246
  signing_key:
230
247
  specification_version: 4
231
248
  summary: Wrapper for peerflix with automatic search through KickAss Torrents, Yifysubtitles