peerflixrb 3.3.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/exe/peerflixrb +25 -20
- data/lib/peerflixrb/commands.rb +2 -2
- data/lib/peerflixrb/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: 02f23b780d206d3dbdc937234452e66a8d8a5ea6
|
4
|
+
data.tar.gz: 1644ccc35b738127247d8dfc5390861461b00ba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 [
|
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
|
10
|
+
Make sure you have **webtorrent-cli** installed:
|
11
11
|
|
12
|
-
$ npm install -g
|
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
|
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
|
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
|
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
|
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
|
-
|
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
|
|
data/exe/peerflixrb
CHANGED
@@ -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('-
|
18
|
-
options[:
|
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('-
|
51
|
-
options[:
|
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
|
-
#
|
105
|
-
command = "
|
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
|
111
|
-
cli.say "Executing
|
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 =
|
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
|
data/lib/peerflixrb/commands.rb
CHANGED
@@ -16,8 +16,8 @@ module Peerflixrb
|
|
16
16
|
exit
|
17
17
|
end
|
18
18
|
|
19
|
-
unless system('
|
20
|
-
cli.say '
|
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
|
data/lib/peerflixrb/version.rb
CHANGED
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:
|
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-
|
11
|
+
date: 2016-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addic7ed_downloader
|