peerflixrb 3.3.1 → 4.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28dee26c7121a4b77a4a83672de1b12f8b0424d9
4
- data.tar.gz: f3f91e3577da7447ca3de368ed7062b4393cb3cf
3
+ metadata.gz: 02f23b780d206d3dbdc937234452e66a8d8a5ea6
4
+ data.tar.gz: 1644ccc35b738127247d8dfc5390861461b00ba0
5
5
  SHA512:
6
- metadata.gz: b104f64a4f651c4e59eb28599f3ddeacaf173eb1b6ed628a79b1e9e0e6763cb65dc2d441af9d472ec99d1b7e58c9d5476b1470f3fd2e35d6df14b8061fb244ee
7
- data.tar.gz: 47f59fb6b875063ec9d9242185076c373b4bdbe196b31c26426277259b80697cd2574d04c0706d8b73632a4e367a04715b6ce3dd22be101cb60566ed906252d7
6
+ metadata.gz: 233e13c5afc8ea8f1d58bb0f82146d5ecd80e4a3f276fb410540ed874fe0818e2777233913ee5cc398d4c24df769874f513ee848a4e89efd0e6f7794d77cc87e
7
+ data.tar.gz: b5bbebdf67d944f4a4f88baf9a3166ceeb13bb2c99f25f018484857ef756e9ae44c02da83c5a0b99a0788497774642f5b51e6ac9b836659d03dcd61cecc98753
data/README.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  # Peerflixrb
4
4
 
5
- Wrapper for [peerflix](https://github.com/mafintosh/peerflix) with automatic search through [Kickass Torrents](kat.cr), [YifySubtitles](http://www.yifysubtitles.com/) and [Addic7ed](http://www.addic7ed.com/) (with [gem addic7ed_downloader](https://github.com/iovis9/addic7ed_downloader)).
5
+ Wrapper for [webtorrent-cli](https://github.com/feross/webtorrent-cli) with automatic search through [Zooqle](https://zooqle.com), [YifySubtitles](http://www.yifysubtitles.com/) and [Addic7ed](http://www.addic7ed.com/) (with [gem addic7ed_downloader](https://github.com/iovis9/addic7ed_downloader)).
6
6
 
7
7
 
8
8
  ## Requirements
9
9
 
10
- Make sure you have my fork of **peerflix** installed:
10
+ Make sure you have **webtorrent-cli** installed:
11
11
 
12
- $ npm install -g iovis9/peerflix
12
+ $ npm install -g webtorrent-cli
13
13
 
14
14
 
15
15
  ## Installation
@@ -20,16 +20,16 @@ Install the gem:
20
20
 
21
21
  ## Usage
22
22
 
23
- Pass a string with what you want to watch and it will search KAT with your query and present you with the first 5 results for you to choose. The file selected will then be sent to **peerflix**. For **TV Shows** use the format S01E01.
23
+ Pass a string with what you want to watch and it will search Zooqle with your query and present you with the first 5 results for you to choose. The file selected will then be sent to **webtorrent**. For **TV Shows** use the format S01E01.
24
24
 
25
25
  $ peerflixrb Suits s05e12
26
26
  $ peerflixrb The Godfather II
27
27
 
28
28
  If you prefer to autoplay the first matched result, use the ```-y``` flag:
29
29
 
30
- $ peerflixrb -y Archer s07e02 1080p
30
+ $ peerflixrb -y Archer s07e02
31
31
 
32
- You can play the video with subtitles with the ```-s``` option (Default: English). It will try and find the best match in [YifySubtitles](http://www.yifysubtitles.com/) if it's a movie and if [Addic7ed](http://www.addic7ed.com/) if it's a TV Show.
32
+ You can play the video with subtitles with the ```-s``` option (Default: English). It will try and find the best match in [YifySubtitles](http://www.yifysubtitles.com/) if it's a movie, and in [Addic7ed](http://www.addic7ed.com/) if it's a TV Show.
33
33
 
34
34
  $ peerflixrb -s Birdman
35
35
  $ peerflixrb -s The Wire s04e05
@@ -46,7 +46,7 @@ If you prefer to use your own subtitles file, you can do that with the ```-t SUB
46
46
 
47
47
  You can autoplay in VLC or mpv with the corresponding option (Default: VLC).
48
48
 
49
- $ peerflixrb --mpv The Big Bang Theory s09e16 HDTV
49
+ $ peerflixrb --mpv The Big Bang Theory s09e16
50
50
 
51
51
  It works with DLNA too with the ```-u``` option (subtitles too!).
52
52
 
@@ -55,8 +55,8 @@ Or you can just let it download without autoplaying with ```-n``` or ```--no-pla
55
55
 
56
56
  ## Cache
57
57
 
58
- The original peerflix takes care of cache so you can resume your downloads or watch them again.
59
- peerflixrb will tell you where they are located so you can do as you like or leave them there till your OS takes care of it (it's stored in /tmp).
58
+ Webtorrent takes care of cache so you can resume your downloads or watch them again.
59
+ peerflixrb will tell you where they are located so you can do as you like or leave them there till your OS takes care of it (it's stored in /tmp). When downloading with ```-n``` the output folder is the same peerflixrb was run.
60
60
 
61
61
  ## Contributing
62
62
 
@@ -14,23 +14,14 @@ options = {
14
14
  optparse = OptionParser.new do |opts|
15
15
  opts.banner = 'Usage: peerflixrb [options] <search>'
16
16
 
17
- opts.on('-s', '--find-subtitles', 'Find subtitles') do
18
- options[:find_subtitles] = true
19
- end
20
-
21
- opts.on('-S', '--choose-subtitles', 'Choose subtitles from Addic7ed') do
22
- options[:find_subtitles] = true
23
- options[:choose_subtitles] = true
17
+ opts.on('-y', '--auto-select', 'Select first match') do
18
+ options[:auto_select] = true
24
19
  end
25
20
 
26
- opts.on('-n', '--no-player', "Don't autoplay") do
21
+ opts.on('-n', '--no-player', "Don't autoplay (just download)") do
27
22
  options[:video_player] = nil
28
23
  end
29
24
 
30
- opts.on('-y', '--auto-select', 'Select first match') do
31
- options[:auto_select] = true
32
- end
33
-
34
25
  opts.on('-m', '--mplayer', 'Autoplay in mplayer*') do
35
26
  options[:video_player] = 'mplayer'
36
27
  end
@@ -47,8 +38,13 @@ optparse = OptionParser.new do |opts|
47
38
  options[:video_player] = 'dlna'
48
39
  end
49
40
 
50
- opts.on('-t SUBTITLE_FILE', '--subtitles SUBTITLE_FILE', 'Use local subtitles') do |t|
51
- options[:subtitles] = t
41
+ opts.on('-s', '--find-subtitles', 'Find subtitles') do
42
+ options[:find_subtitles] = true
43
+ end
44
+
45
+ opts.on('-S', '--choose-subtitles', 'Choose subtitles (only Addic7ed)') do
46
+ options[:find_subtitles] = true
47
+ options[:choose_subtitles] = true
52
48
  end
53
49
 
54
50
  opts.on('-l LANGUAGE', '--language LANGUAGE', 'Language code to look subtitles for (default: English)') do |l|
@@ -56,6 +52,10 @@ optparse = OptionParser.new do |opts|
56
52
  options[:language] = l
57
53
  end
58
54
 
55
+ opts.on('-t SUBTITLE_FILE', '--subtitles SUBTITLE_FILE', 'Use local subtitles') do |t|
56
+ options[:subtitles] = t
57
+ end
58
+
59
59
  opts.on('-v', '--version', 'Print version and exit') do
60
60
  puts "Peerflixrb v#{Peerflixrb::VERSION}"
61
61
  exit
@@ -101,14 +101,13 @@ begin
101
101
  # Choose link and subtitles
102
102
  link, sub_file = commands.choose_video_and_subtitles(torrent_search, options)
103
103
 
104
- # Peerflix command build
105
- command = "peerflix '#{link.magnet}'"
104
+ # Webtorrent command build
105
+ command = "webtorrent '#{link.magnet}'"
106
106
  command << " --subtitles \"#{sub_file}\"" if sub_file
107
107
  command << " --#{options[:video_player]}" if options[:video_player]
108
- command << ' -- --fullscreen' if %w(vlc mpv).include? options[:video_player]
109
108
 
110
- # Execute peerflix
111
- cli.say "Executing peerflix with #{link.filename.blue} ".yellow
109
+ # Execute webtorrent
110
+ cli.say "Executing webtorrent with #{link.filename.blue} ".yellow
112
111
  cli.say "and #{sub_file.blue}".yellow if sub_file
113
112
  system command
114
113
  rescue Interrupt, EOFError
@@ -118,7 +117,13 @@ rescue SocketError
118
117
  ensure
119
118
  # Cleaning up
120
119
  if link
121
- cache_dir = "/tmp/torrent-stream/#{link.info_hash}"
120
+ cache_dir = if options[:video_player]
121
+ "/tmp/webtorrent/#{link.info_hash}"
122
+ else
123
+ # Current directory if download only
124
+ Dir.pwd
125
+ end
126
+
122
127
  video_file = Dir["#{cache_dir}/**/*.{mkv,mp4,avi,wmv,mpg,flv,mov}"].first
123
128
  FileUtils.mv(sub_file, File.dirname(video_file)) if sub_file && video_file
124
129
  cli.say "Your downloads will be in #{cache_dir.blue} #{'for 3 days :)'.yellow}".yellow
@@ -16,8 +16,8 @@ module Peerflixrb
16
16
  exit
17
17
  end
18
18
 
19
- unless system('peerflix --version > /dev/null 2>&1')
20
- cli.say 'peerflix is required. Type "npm install -g iovis9/peerflix" in your shell to install it.'.red
19
+ unless system('webtorrent --version > /dev/null 2>&1')
20
+ cli.say 'webtorrent is required. Type "npm install -g webtorrent-cli" in your shell to install it.'.red
21
21
  exit
22
22
  end
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module Peerflixrb
2
- VERSION = '3.3.1'.freeze
2
+ VERSION = '4.0.0'.freeze
3
3
  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: 3.3.1
4
+ version: 4.0.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-08-08 00:00:00.000000000 Z
11
+ date: 2016-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addic7ed_downloader