bencview 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +2 -2
- data/bencview.rb +3 -2
- data/json2bencode +2 -2
- data/package.gemspec +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d90de207bf9817bda308a88ad6dfebd6f4e1c4fe832c65a86ff6a56796e5bb3d
|
4
|
+
data.tar.gz: 93d8931d1b2633eae74c0dfcff3eaf22e54d8e321635aea3e81b78c08bdf8d1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 851179756b86506deae0237e5348e61425217863e742de189685c9e5a9c7cf549c769957041e8abc42261863dbaf358dbb8837d57a8396e110c9a723ceb6126c
|
7
|
+
data.tar.gz: 58dc12059431746d1888d980a06bf83b6dee25806a7a3663d94e43e7be6042222c39057481c2cf18db968042ab348a4a1e675b98a778e425fb0e7dc58f31dcde
|
data/README.md
CHANGED
@@ -45,7 +45,7 @@ url-list: 34
|
|
45
45
|
http://gimp.afri.cc/pub/gimp/v2.8/windows
|
46
46
|
[...]
|
47
47
|
info/name: gimp-2.8.14-setup-1.exe
|
48
|
-
info
|
48
|
+
info/pieces: 351 x 262,144
|
49
49
|
info/files: 1
|
50
50
|
91,931,728 gimp-2.8.14-setup-1.exe
|
51
51
|
info/*files size: 91,931,728
|
@@ -72,7 +72,7 @@ url-list: 34
|
|
72
72
|
http://gimp.afri.cc/pub/gimp/v2.8/windows
|
73
73
|
[...]
|
74
74
|
info/name: gimp-2.8.14-setup-1.exe
|
75
|
-
info
|
75
|
+
info/pieces: 351 x 262,144
|
76
76
|
info/files: 1
|
77
77
|
91,931,728 gimp-2.8.14-setup-1.exe
|
78
78
|
info/*files size: 91,931,728
|
data/bencview.rb
CHANGED
@@ -3,6 +3,7 @@ require 'digest'
|
|
3
3
|
require 'uri'
|
4
4
|
require 'json'
|
5
5
|
require "base64"
|
6
|
+
require 'erb'
|
6
7
|
|
7
8
|
require 'bencode'
|
8
9
|
|
@@ -50,7 +51,7 @@ class Bencview::Torrent
|
|
50
51
|
# BitTorrent specific
|
51
52
|
def magnet name
|
52
53
|
return nil unless @infohash
|
53
|
-
"magnet:?xt=urn:btih:#{@infohash}" + (name ? "&dn=#{
|
54
|
+
"magnet:?xt=urn:btih:#{@infohash}" + (name ? "&dn=#{ERB::Util.url_encode name}" : "")
|
54
55
|
end
|
55
56
|
|
56
57
|
# BitTorrent specific
|
@@ -66,7 +67,7 @@ class Bencview::Torrent
|
|
66
67
|
# ignore
|
67
68
|
elsif key == 'pieces' && obj['piece length']
|
68
69
|
pieces = val.bytesize / 20
|
69
|
-
r.push "#{rkey.call '
|
70
|
+
r.push "#{rkey.call 'pieces'}: #{num pieces} x #{num obj['piece length']}"
|
70
71
|
elsif key =~ /\.utf-8$/
|
71
72
|
# ignore
|
72
73
|
elsif key =~ /^(files|length)$/
|
data/json2bencode
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
require_relative './bencview'
|
4
4
|
|
5
5
|
io = ARGV.size > 0 ? File.open(ARGV[0]) : $stdin
|
6
|
-
print Bencview.hash_walk(JSON.parse io.read) do |str|
|
6
|
+
print (Bencview.hash_walk(JSON.parse io.read) do |str|
|
7
7
|
# check if the string is in base64
|
8
8
|
if str =~ /^([A-Za-z0-9+\/]{4})*([A-Za-z0-9+\/]{4}|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)$/
|
9
9
|
next Base64.decode64 str
|
10
10
|
else
|
11
11
|
str
|
12
12
|
end
|
13
|
-
end.bencode
|
13
|
+
end).bencode
|
data/package.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bencview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Gromnitsky
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: "."
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bencode
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.8.2
|
27
|
-
description:
|
27
|
+
description:
|
28
28
|
email: alexander.gromnitsky@gmail.com
|
29
29
|
executables:
|
30
30
|
- bencview
|
@@ -63,9 +63,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: '0'
|
65
65
|
requirements: []
|
66
|
-
|
67
|
-
|
68
|
-
signing_key:
|
66
|
+
rubygems_version: 3.2.3
|
67
|
+
signing_key:
|
69
68
|
specification_version: 4
|
70
69
|
summary: View .torrent files; JSON export/import
|
71
70
|
test_files: []
|