BtSync 0.4.4 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +18 -2
- data/lib/btsync.rb +39 -3
- data/lib/btsync/communicator.rb +18 -4
- data/lib/btsync/directory.rb +19 -3
- data/lib/btsync/version.rb +1 -1
- data/spec/BtSync/bt_sync_spec.rb +60 -0
- data/spec/BtSync/directory_spec.rb +17 -3
- data/spec/fixtures/cassettes/Setup-BtSync-Directory.yml +11 -10
- data/spec/fixtures/cassettes/Setup-Directory-Settings.yml +14 -13
- data/spec/fixtures/cassettes/add-folder-list.yml +30 -27
- data/spec/fixtures/cassettes/add-folder.yml +21 -20
- data/spec/fixtures/cassettes/add-known-host.yml +58 -0
- data/spec/fixtures/cassettes/change_download_limit.yml +113 -0
- data/spec/fixtures/cassettes/change_listening_port.yml +113 -0
- data/spec/fixtures/cassettes/change_name.yml +113 -0
- data/spec/fixtures/cassettes/change_upload_limit.yml +113 -0
- data/spec/fixtures/cassettes/get-folders.yml +22 -20
- data/spec/fixtures/cassettes/get-known-hosts.yml +3 -3
- data/spec/fixtures/cassettes/get-os-type.yml +6 -6
- data/spec/fixtures/cassettes/get-peers.yml +8 -7
- data/spec/fixtures/cassettes/get-preferences.yml +18 -18
- data/spec/fixtures/cassettes/get-settings.yml +6 -6
- data/spec/fixtures/cassettes/get-version.yml +6 -6
- data/spec/fixtures/cassettes/remove-folder-list.yml +19 -17
- data/spec/fixtures/cassettes/remove-folder.yml +33 -30
- data/spec/fixtures/cassettes/remove-known-host.yml +57 -0
- data/spec/fixtures/cassettes/reset_device_name.yml +86 -0
- data/spec/fixtures/cassettes/reset_download_limit.yml +86 -0
- data/spec/fixtures/cassettes/reset_listening_port.yml +86 -0
- data/spec/fixtures/cassettes/reset_upload_limit.yml +86 -0
- data/spec/fixtures/cassettes/set-preferences-delete.yml +9 -9
- data/spec/fixtures/cassettes/set-preferences-dht.yml +9 -9
- data/spec/fixtures/cassettes/set-preferences-hosts.yml +9 -9
- data/spec/fixtures/cassettes/set-preferences-lan.yml +9 -9
- data/spec/fixtures/cassettes/set-preferences-relay.yml +9 -9
- data/spec/fixtures/cassettes/set-preferences-tracker.yml +9 -9
- data/spec/fixtures/cassettes/view-folders.yml +3 -3
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Zjg0ZjExNzNmN2ZiYWU5OGFmOTFhYzg0ZmI2MDJhMWY1ZmYzMmEwMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjUxOGM4MGQ0MjJhZTM4Y2I2OTQ1ZmRlMDZjNzMxNGNiMWYyNTkwMg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmJlMTBlYzNiZWE3ZDI0OWM5ZmUyNWFmNTk1NmZmMjYyY2VkNzFkODYyODdm
|
10
|
+
MzNjN2Q1ZjRmNWFhMWZkYTJlNWRhNWVmOGFkYTNiYTI5ZGUzNDUyN2JjZTQw
|
11
|
+
Y2ZiNGQ5YzM0YTc0ZjYwOGMxOGUyYmIyNjNiZGQyMWVmM2YyMTM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWQ1MGMzMmUzZDRmZDlmNjE4ODViMTIzODk3OTUxZjNhODM0MWZjZWZjOTll
|
14
|
+
ZmNkODNmYTFiYzFjZTFlM2Y4YmYzZTc2MGJjODcyMzlmZjc3MmQxYTY4YTI4
|
15
|
+
NzcyZTE0MGE0NzhkNjU4ODYwMTBkOTc3NDY3MDk0NGE0ZWFlZTk=
|
data/README.md
CHANGED
@@ -24,7 +24,18 @@ Or install it yourself as:
|
|
24
24
|
### Using BtSync
|
25
25
|
|
26
26
|
```ruby
|
27
|
-
bittorrent = BtSync.new
|
27
|
+
bittorrent = BtSync.new(options)
|
28
|
+
|
29
|
+
options is a hash that can contain any of the following options. The values shown are the defaults if no argument is passed in
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
{
|
33
|
+
:protocol => "http",
|
34
|
+
:uri => "localhost",
|
35
|
+
:port => "8888",
|
36
|
+
:user => "",
|
37
|
+
:password => ""
|
38
|
+
}
|
28
39
|
```
|
29
40
|
|
30
41
|
####BtSync::Directory
|
@@ -44,7 +55,12 @@ On a ```BtSync::Directory``` you can
|
|
44
55
|
|
45
56
|
## Todo
|
46
57
|
|
47
|
-
[
|
58
|
+
[x] Manage predefined hosts
|
59
|
+
[x] Allow user authentication
|
60
|
+
|
61
|
+
## Known Issues
|
62
|
+
|
63
|
+
[] Bittorrent Sync must be run on a Linux system
|
48
64
|
|
49
65
|
## Contributing
|
50
66
|
|
data/lib/btsync.rb
CHANGED
@@ -10,10 +10,17 @@ class BtSync
|
|
10
10
|
include HTTParty
|
11
11
|
default_params :output => 'json'
|
12
12
|
def initialize options = {}
|
13
|
-
@opts =
|
14
|
-
|
15
|
-
|
13
|
+
@opts = {
|
14
|
+
:protocol => "http",
|
15
|
+
:uri => "localhost",
|
16
|
+
:port => "8888",
|
17
|
+
:user => "",
|
18
|
+
:password => ""}
|
19
|
+
@opts.merge!(options.symbolize)
|
20
|
+
@opts[:uri].gsub!(/^(https?:\/\/){1,}/i, '')
|
16
21
|
@port = @opts[:port]
|
22
|
+
@user = @opts[:user]
|
23
|
+
@pass = @opts[:password]
|
17
24
|
@errors = []
|
18
25
|
@token_cache = 0
|
19
26
|
end
|
@@ -30,6 +37,35 @@ class BtSync
|
|
30
37
|
end
|
31
38
|
folders
|
32
39
|
end
|
40
|
+
def upload_limit
|
41
|
+
get_settings["ulrate"].to_i
|
42
|
+
end
|
43
|
+
def download_limit
|
44
|
+
get_settings["dlrate"].to_i
|
45
|
+
end
|
46
|
+
def device_name
|
47
|
+
get_settings["devicename"]
|
48
|
+
end
|
49
|
+
def listening_port
|
50
|
+
get_settings["listeningport"].to_i
|
51
|
+
end
|
52
|
+
def upload_limit= opt
|
53
|
+
change_setting "ulrate", opt
|
54
|
+
end
|
55
|
+
def download_limit= opt
|
56
|
+
change_setting "dlrate", opt
|
57
|
+
end
|
58
|
+
def device_name= opt
|
59
|
+
change_setting "devicename", opt
|
60
|
+
end
|
61
|
+
def listening_port= opt
|
62
|
+
change_setting "listeningport", opt
|
63
|
+
end
|
64
|
+
def change_setting type, opt
|
65
|
+
options = get_settings.merge!({type => opt})
|
66
|
+
|
67
|
+
res = self.class.get(path('setsettings'), :query => options, :headers => {"Cookie" => cookies })
|
68
|
+
end
|
33
69
|
def get_speed
|
34
70
|
s = get_folder_list["speed"].split(", ")
|
35
71
|
up = s[0].split(" ")
|
data/lib/btsync/communicator.rb
CHANGED
@@ -6,10 +6,22 @@ module BtCommunicator
|
|
6
6
|
res.parsed_response["secret"]
|
7
7
|
end
|
8
8
|
def port
|
9
|
-
@port
|
9
|
+
@opts[:port]
|
10
10
|
end
|
11
11
|
def uri
|
12
|
-
@uri
|
12
|
+
@opts[:uri]
|
13
|
+
end
|
14
|
+
def protocol
|
15
|
+
@opts[:protocol]
|
16
|
+
end
|
17
|
+
def user
|
18
|
+
@opts[:user]
|
19
|
+
end
|
20
|
+
def password
|
21
|
+
@opts[:password]
|
22
|
+
end
|
23
|
+
def communication_options
|
24
|
+
@opts
|
13
25
|
end
|
14
26
|
def token force = false
|
15
27
|
@token_cache ||= 0
|
@@ -25,7 +37,7 @@ module BtCommunicator
|
|
25
37
|
@cookies ||= request_token.headers["set-cookie"].split("; ")[0]
|
26
38
|
end
|
27
39
|
def root_url
|
28
|
-
"#{uri}:#{port}/"
|
40
|
+
"#{starter}#{uri}:#{port}/"
|
29
41
|
end
|
30
42
|
def request_token force = false
|
31
43
|
@last_request ||= 0
|
@@ -37,7 +49,9 @@ module BtCommunicator
|
|
37
49
|
@request_token
|
38
50
|
end
|
39
51
|
end
|
40
|
-
|
52
|
+
def starter
|
53
|
+
"#{protocol}://#{user}:#{password}@"
|
54
|
+
end
|
41
55
|
def path action_name
|
42
56
|
"#{root_url}gui/?token=#{token}&action=#{action_name}"
|
43
57
|
end
|
data/lib/btsync/directory.rb
CHANGED
@@ -9,8 +9,7 @@ class BtSync
|
|
9
9
|
@name = name
|
10
10
|
@secret = secret
|
11
11
|
|
12
|
-
@
|
13
|
-
@port = btsync.port
|
12
|
+
@opts = btsync.communication_options
|
14
13
|
|
15
14
|
find_or_create
|
16
15
|
|
@@ -43,7 +42,24 @@ class BtSync
|
|
43
42
|
end
|
44
43
|
def known_hosts
|
45
44
|
res = self.class.get(path('getknownhosts'), :query => {:name => name, :secret => secret}, :headers => {"Cookie" => cookies })
|
46
|
-
|
45
|
+
hosts = {}
|
46
|
+
res["hosts"].map{|h| hosts[h["index"]] = h["peer"]}
|
47
|
+
hosts
|
48
|
+
end
|
49
|
+
def add_host host, port
|
50
|
+
res = self.class.get(path('addknownhosts'), :query =>{:name => name, :secret => secret, :addr =>host, :port => port}, :headers => {"Cookie" => cookies })
|
51
|
+
true
|
52
|
+
end
|
53
|
+
def remove_host index
|
54
|
+
res = self.class.get(path('removeknownhosts'), :query =>{:name => name, :secret => secret, :index => index}, :headers => {"Cookie" => cookies })
|
55
|
+
if res.parsed_response != {}
|
56
|
+
res.parsed_response
|
57
|
+
else
|
58
|
+
true
|
59
|
+
end
|
60
|
+
end
|
61
|
+
def remove_host_by_ip ip, port = nil
|
62
|
+
@hosts = known_hosts
|
47
63
|
end
|
48
64
|
def use_tracker=(opt)
|
49
65
|
set_pref('usetracker', opt)
|
data/lib/btsync/version.rb
CHANGED
data/spec/BtSync/bt_sync_spec.rb
CHANGED
@@ -20,6 +20,66 @@ describe 'BtSync' do
|
|
20
20
|
@settings["devicename"].should == "IceyEC-Virtual1"
|
21
21
|
@settings["listeningport"].should == 63754
|
22
22
|
end
|
23
|
+
it "can get listening port" do
|
24
|
+
VCR.use_cassette("get-settings") do
|
25
|
+
@bt.listening_port.should == 63754
|
26
|
+
end
|
27
|
+
end
|
28
|
+
it "can get upload limit" do
|
29
|
+
VCR.use_cassette("get-settings") do
|
30
|
+
@bt.upload_limit.should == 0
|
31
|
+
end
|
32
|
+
end
|
33
|
+
it "can get download limit" do
|
34
|
+
VCR.use_cassette("get-settings") do
|
35
|
+
@bt.download_limit.should == 0
|
36
|
+
end
|
37
|
+
end
|
38
|
+
it "can get device name" do
|
39
|
+
VCR.use_cassette("get-settings") do
|
40
|
+
@bt.device_name.should == "IceyEC-Virtual1"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
it "can change the device_name" do
|
44
|
+
VCR.use_cassette("change_name") do
|
45
|
+
@bt.device_name = "IceyEC-Virtual2"
|
46
|
+
@bt.device_name.should == "IceyEC-Virtual2"
|
47
|
+
end
|
48
|
+
VCR.use_cassette('reset_device_name') do
|
49
|
+
@bt.device_name = "IceyEC-Virtual1"
|
50
|
+
@bt.device_name.should == "IceyEC-Virtual1"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
it "can change the upload limit" do
|
54
|
+
VCR.use_cassette("change_upload_limit") do
|
55
|
+
@bt.upload_limit = 1000
|
56
|
+
@bt.upload_limit.should == 1000
|
57
|
+
end
|
58
|
+
VCR.use_cassette('reset_upload_limit') do
|
59
|
+
@bt.upload_limit = 0
|
60
|
+
@bt.upload_limit.should == 0
|
61
|
+
end
|
62
|
+
end
|
63
|
+
it "can change the download limit" do
|
64
|
+
VCR.use_cassette("change_download_limit") do
|
65
|
+
@bt.download_limit = 1000
|
66
|
+
@bt.download_limit.should == 1000
|
67
|
+
end
|
68
|
+
VCR.use_cassette('reset_download_limit') do
|
69
|
+
@bt.download_limit = 0
|
70
|
+
@bt.download_limit.should == 0
|
71
|
+
end
|
72
|
+
end
|
73
|
+
it "can change the listening_port" do
|
74
|
+
VCR.use_cassette("change_listening_port") do
|
75
|
+
@bt.listening_port = 12345
|
76
|
+
@bt.listening_port.should == 12345
|
77
|
+
end
|
78
|
+
VCR.use_cassette('reset_listening_port') do
|
79
|
+
@bt.listening_port = 63754
|
80
|
+
@bt.listening_port.should == 63754
|
81
|
+
end
|
82
|
+
end
|
23
83
|
it "can check the OS" do
|
24
84
|
VCR.use_cassette("get-os-type") do
|
25
85
|
@os = @bt.get_os_type
|
@@ -33,13 +33,27 @@ describe 'BtSync::Directory' do
|
|
33
33
|
VCR.use_cassette("get-peers") do
|
34
34
|
@peers = @directory.peers
|
35
35
|
end
|
36
|
-
@peers.first.should ==
|
36
|
+
@peers.first.should == {"direct"=>1, "name"=>"IceyEC Portable", "status"=>"Synced on 06/05/13 20:52:35"}
|
37
37
|
end
|
38
|
-
it "can get
|
38
|
+
it "can get known hosts" do
|
39
39
|
VCR.use_cassette("get-known-hosts") do
|
40
40
|
@hosts = @directory.known_hosts
|
41
41
|
end
|
42
|
-
@hosts
|
42
|
+
@hosts[0].should == "192.168.1.5:45685"
|
43
|
+
end
|
44
|
+
it "can add a known host" do
|
45
|
+
VCR.use_cassette('add-known-host') do
|
46
|
+
@directory.add_host('10.0.1.254', '12345')
|
47
|
+
@hosts = @directory.known_hosts
|
48
|
+
end
|
49
|
+
@hosts[1].should == "10.0.1.254:12345"
|
50
|
+
end
|
51
|
+
it "can remove a known host" do
|
52
|
+
VCR.use_cassette('remove-known-host') do
|
53
|
+
@directory.remove_host(1)
|
54
|
+
@hosts = @directory.known_hosts
|
55
|
+
end
|
56
|
+
@hosts.values.should_not include '10.0.1.254:12345'
|
43
57
|
end
|
44
58
|
it "can check it's settings" do
|
45
59
|
VCR.use_cassette("get-preferences") do
|
@@ -19,23 +19,23 @@ http_interactions:
|
|
19
19
|
Content-Type:
|
20
20
|
- text/html
|
21
21
|
Set-Cookie:
|
22
|
-
- GUID=
|
22
|
+
- GUID=cQaFdm1vWSBv9LvephVY; path=/
|
23
23
|
Cache-Control:
|
24
24
|
- no-cache
|
25
25
|
body:
|
26
26
|
encoding: US-ASCII
|
27
|
-
string: <html><div id='token' style='display:none;'>
|
27
|
+
string: <html><div id='token' style='display:none;'>QLBnhvyW_0jKDqQDwuhTM-1X6DfFF7xJDNSq4G5QowPTdzMqbGLGBn-DtlEAAAAA</div></html>
|
28
28
|
http_version:
|
29
|
-
recorded_at:
|
29
|
+
recorded_at: Tue, 11 Jun 2013 01:55:14 GMT
|
30
30
|
- request:
|
31
31
|
method: get
|
32
|
-
uri: http://localhost:8888/gui/?action=getsyncfolders&output=json&token=
|
32
|
+
uri: http://localhost:8888/gui/?action=getsyncfolders&output=json&token=QLBnhvyW_0jKDqQDwuhTM-1X6DfFF7xJDNSq4G5QowPTdzMqbGLGBn-DtlEAAAAA
|
33
33
|
body:
|
34
34
|
encoding: US-ASCII
|
35
35
|
string: ''
|
36
36
|
headers:
|
37
37
|
Cookie:
|
38
|
-
- GUID=
|
38
|
+
- GUID=cQaFdm1vWSBv9LvephVY
|
39
39
|
response:
|
40
40
|
status:
|
41
41
|
code: 200
|
@@ -44,16 +44,17 @@ http_interactions:
|
|
44
44
|
Connection:
|
45
45
|
- keep-alive
|
46
46
|
Content-Length:
|
47
|
-
- '
|
47
|
+
- '270'
|
48
48
|
Content-Type:
|
49
49
|
- application/json; charset=utf-8
|
50
50
|
Cache-Control:
|
51
51
|
- no-cache
|
52
52
|
body:
|
53
53
|
encoding: US-ASCII
|
54
|
-
string: ! '{ "folders": [ { "name": "\/home\/chris\/Documents", "peers": [
|
55
|
-
"
|
56
|
-
"
|
54
|
+
string: ! '{ "folders": [ { "name": "\/home\/chris\/Documents", "peers": [ {
|
55
|
+
"direct": 1, "name": "IceyEC Portable", "status": "Synced on 06\/05\/13 20:52:35"
|
56
|
+
} ], "secret": "6PX74LIR2RA2FF2W3DC25MG2CF6SQDSJ", "size": "0 B in 0 files"
|
57
|
+
} ], "speed": "0.0 kB\/s up, 0.0 kB\/s down" }'
|
57
58
|
http_version:
|
58
|
-
recorded_at:
|
59
|
+
recorded_at: Tue, 11 Jun 2013 01:55:14 GMT
|
59
60
|
recorded_with: VCR 2.5.0
|
@@ -19,23 +19,23 @@ http_interactions:
|
|
19
19
|
Content-Type:
|
20
20
|
- text/html
|
21
21
|
Set-Cookie:
|
22
|
-
- GUID=
|
22
|
+
- GUID=SZGEavWRWlylZwpb4y1U; path=/
|
23
23
|
Cache-Control:
|
24
24
|
- no-cache
|
25
25
|
body:
|
26
26
|
encoding: US-ASCII
|
27
|
-
string: <html><div id='token' style='display:none;'>
|
27
|
+
string: <html><div id='token' style='display:none;'>cNJuLdTzhAVEgK83V3Ai3F9LGEGb2oDNWAwa1BWst7Dpo45MpwWH93-DtlEAAAAA</div></html>
|
28
28
|
http_version:
|
29
|
-
recorded_at:
|
29
|
+
recorded_at: Tue, 11 Jun 2013 01:55:14 GMT
|
30
30
|
- request:
|
31
31
|
method: get
|
32
|
-
uri: http://localhost:8888/gui/?action=getsyncfolders&output=json&token=
|
32
|
+
uri: http://localhost:8888/gui/?action=getsyncfolders&output=json&token=cNJuLdTzhAVEgK83V3Ai3F9LGEGb2oDNWAwa1BWst7Dpo45MpwWH93-DtlEAAAAA
|
33
33
|
body:
|
34
34
|
encoding: US-ASCII
|
35
35
|
string: ''
|
36
36
|
headers:
|
37
37
|
Cookie:
|
38
|
-
- GUID=
|
38
|
+
- GUID=SZGEavWRWlylZwpb4y1U
|
39
39
|
response:
|
40
40
|
status:
|
41
41
|
code: 200
|
@@ -44,27 +44,28 @@ http_interactions:
|
|
44
44
|
Connection:
|
45
45
|
- keep-alive
|
46
46
|
Content-Length:
|
47
|
-
- '
|
47
|
+
- '270'
|
48
48
|
Content-Type:
|
49
49
|
- application/json; charset=utf-8
|
50
50
|
Cache-Control:
|
51
51
|
- no-cache
|
52
52
|
body:
|
53
53
|
encoding: US-ASCII
|
54
|
-
string: ! '{ "folders": [ { "name": "\/home\/chris\/Documents", "peers": [
|
55
|
-
"
|
56
|
-
"
|
54
|
+
string: ! '{ "folders": [ { "name": "\/home\/chris\/Documents", "peers": [ {
|
55
|
+
"direct": 1, "name": "IceyEC Portable", "status": "Synced on 06\/05\/13 20:52:35"
|
56
|
+
} ], "secret": "6PX74LIR2RA2FF2W3DC25MG2CF6SQDSJ", "size": "0 B in 0 files"
|
57
|
+
} ], "speed": "0.0 kB\/s up, 0.0 kB\/s down" }'
|
57
58
|
http_version:
|
58
|
-
recorded_at:
|
59
|
+
recorded_at: Tue, 11 Jun 2013 01:55:14 GMT
|
59
60
|
- request:
|
60
61
|
method: get
|
61
|
-
uri: http://localhost:8888/gui/?action=setfolderpref&deletetotrash=1&name=/home/chris/Documents&output=json&relay=1&searchdht=0&searchlan=1&secret=6PX74LIR2RA2FF2W3DC25MG2CF6SQDSJ&token=
|
62
|
+
uri: http://localhost:8888/gui/?action=setfolderpref&deletetotrash=1&name=/home/chris/Documents&output=json&relay=1&searchdht=0&searchlan=1&secret=6PX74LIR2RA2FF2W3DC25MG2CF6SQDSJ&token=cNJuLdTzhAVEgK83V3Ai3F9LGEGb2oDNWAwa1BWst7Dpo45MpwWH93-DtlEAAAAA&usehosts=1&usetracker=1
|
62
63
|
body:
|
63
64
|
encoding: US-ASCII
|
64
65
|
string: ''
|
65
66
|
headers:
|
66
67
|
Cookie:
|
67
|
-
- GUID=
|
68
|
+
- GUID=SZGEavWRWlylZwpb4y1U
|
68
69
|
response:
|
69
70
|
status:
|
70
71
|
code: 200
|
@@ -82,5 +83,5 @@ http_interactions:
|
|
82
83
|
encoding: US-ASCII
|
83
84
|
string: ! '{ }'
|
84
85
|
http_version:
|
85
|
-
recorded_at:
|
86
|
+
recorded_at: Tue, 11 Jun 2013 01:55:14 GMT
|
86
87
|
recorded_with: VCR 2.5.0
|
@@ -2,13 +2,13 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://localhost:8888/gui/?action=getsyncfolders&output=json&token=
|
5
|
+
uri: http://localhost:8888/gui/?action=getsyncfolders&output=json&token=0yGezY2QZeVy7GPzaV-TQ6SuOMns8TlPgbHND059Qv-NnsquBvqIln-DtlEAAAAA
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
Cookie:
|
11
|
-
- GUID=
|
11
|
+
- GUID=YvUwERzuA6KDtWx5gBqG
|
12
12
|
response:
|
13
13
|
status:
|
14
14
|
code: 200
|
@@ -17,19 +17,20 @@ http_interactions:
|
|
17
17
|
Connection:
|
18
18
|
- keep-alive
|
19
19
|
Content-Length:
|
20
|
-
- '
|
20
|
+
- '395'
|
21
21
|
Content-Type:
|
22
22
|
- application/json; charset=utf-8
|
23
23
|
Cache-Control:
|
24
24
|
- no-cache
|
25
25
|
body:
|
26
26
|
encoding: US-ASCII
|
27
|
-
string: ! '{ "folders": [ { "name": "\/home\/chris\/Documents", "peers": [
|
28
|
-
"
|
29
|
-
|
27
|
+
string: ! '{ "folders": [ { "name": "\/home\/chris\/Documents", "peers": [ {
|
28
|
+
"direct": 1, "name": "IceyEC Portable", "status": "Synced on 06\/05\/13 20:52:35"
|
29
|
+
} ], "secret": "6PX74LIR2RA2FF2W3DC25MG2CF6SQDSJ", "size": "0 B in 0 files"
|
30
|
+
}, { "name": "\/home\/chris\/bt_test", "peers": [ ], "secret": "FEEBRD6KX6NFZYJRVVN6WKGONI467MZE",
|
30
31
|
"size": "0 B in 0 files" } ], "speed": "0.0 kB\/s up, 0.0 kB\/s down" }'
|
31
32
|
http_version:
|
32
|
-
recorded_at:
|
33
|
+
recorded_at: Tue, 11 Jun 2013 01:55:13 GMT
|
33
34
|
- request:
|
34
35
|
method: get
|
35
36
|
uri: http://localhost:8888/gui/token.html?output=text
|
@@ -49,23 +50,23 @@ http_interactions:
|
|
49
50
|
Content-Type:
|
50
51
|
- text/html
|
51
52
|
Set-Cookie:
|
52
|
-
- GUID=
|
53
|
+
- GUID=Cp4jt4ReFqAFFPOa27Ug; path=/
|
53
54
|
Cache-Control:
|
54
55
|
- no-cache
|
55
56
|
body:
|
56
57
|
encoding: US-ASCII
|
57
|
-
string: <html><div id='token' style='display:none;'>
|
58
|
+
string: <html><div id='token' style='display:none;'>M-w4xBeY_d3X2M0_exuoHEuilyomwOAykfZQQBoqiBJYEnv-U7EtQ3-DtlEAAAAA</div></html>
|
58
59
|
http_version:
|
59
|
-
recorded_at:
|
60
|
+
recorded_at: Tue, 11 Jun 2013 01:55:13 GMT
|
60
61
|
- request:
|
61
62
|
method: get
|
62
|
-
uri: http://localhost:8888/gui/?action=getsyncfolders&output=json&token=
|
63
|
+
uri: http://localhost:8888/gui/?action=getsyncfolders&output=json&token=M-w4xBeY_d3X2M0_exuoHEuilyomwOAykfZQQBoqiBJYEnv-U7EtQ3-DtlEAAAAA
|
63
64
|
body:
|
64
65
|
encoding: US-ASCII
|
65
66
|
string: ''
|
66
67
|
headers:
|
67
68
|
Cookie:
|
68
|
-
- GUID=
|
69
|
+
- GUID=Cp4jt4ReFqAFFPOa27Ug
|
69
70
|
response:
|
70
71
|
status:
|
71
72
|
code: 200
|
@@ -74,19 +75,20 @@ http_interactions:
|
|
74
75
|
Connection:
|
75
76
|
- keep-alive
|
76
77
|
Content-Length:
|
77
|
-
- '
|
78
|
+
- '395'
|
78
79
|
Content-Type:
|
79
80
|
- application/json; charset=utf-8
|
80
81
|
Cache-Control:
|
81
82
|
- no-cache
|
82
83
|
body:
|
83
84
|
encoding: US-ASCII
|
84
|
-
string: ! '{ "folders": [ { "name": "\/home\/chris\/Documents", "peers": [
|
85
|
-
"
|
86
|
-
|
85
|
+
string: ! '{ "folders": [ { "name": "\/home\/chris\/Documents", "peers": [ {
|
86
|
+
"direct": 1, "name": "IceyEC Portable", "status": "Synced on 06\/05\/13 20:52:35"
|
87
|
+
} ], "secret": "6PX74LIR2RA2FF2W3DC25MG2CF6SQDSJ", "size": "0 B in 0 files"
|
88
|
+
}, { "name": "\/home\/chris\/bt_test", "peers": [ ], "secret": "FEEBRD6KX6NFZYJRVVN6WKGONI467MZE",
|
87
89
|
"size": "0 B in 0 files" } ], "speed": "0.0 kB\/s up, 0.0 kB\/s down" }'
|
88
90
|
http_version:
|
89
|
-
recorded_at:
|
91
|
+
recorded_at: Tue, 11 Jun 2013 01:55:13 GMT
|
90
92
|
- request:
|
91
93
|
method: get
|
92
94
|
uri: http://localhost:8888/gui/token.html?output=text
|
@@ -106,23 +108,23 @@ http_interactions:
|
|
106
108
|
Content-Type:
|
107
109
|
- text/html
|
108
110
|
Set-Cookie:
|
109
|
-
- GUID=
|
111
|
+
- GUID=WBI9LeZzdEJEU8GfuXFY; path=/
|
110
112
|
Cache-Control:
|
111
113
|
- no-cache
|
112
114
|
body:
|
113
115
|
encoding: US-ASCII
|
114
|
-
string: <html><div id='token' style='display:none;'
|
116
|
+
string: <html><div id='token' style='display:none;'>w7z2LJ6KChGJLPNEAKaHWyfhXeY0qUSd106gAEt-Zpax0zeVZp0NVH-DtlEAAAAA</div></html>
|
115
117
|
http_version:
|
116
|
-
recorded_at:
|
118
|
+
recorded_at: Tue, 11 Jun 2013 01:55:13 GMT
|
117
119
|
- request:
|
118
120
|
method: get
|
119
|
-
uri: http://localhost:8888/gui/?action=getsyncfolders&output=json&token
|
121
|
+
uri: http://localhost:8888/gui/?action=getsyncfolders&output=json&token=w7z2LJ6KChGJLPNEAKaHWyfhXeY0qUSd106gAEt-Zpax0zeVZp0NVH-DtlEAAAAA
|
120
122
|
body:
|
121
123
|
encoding: US-ASCII
|
122
124
|
string: ''
|
123
125
|
headers:
|
124
126
|
Cookie:
|
125
|
-
- GUID=
|
127
|
+
- GUID=WBI9LeZzdEJEU8GfuXFY
|
126
128
|
response:
|
127
129
|
status:
|
128
130
|
code: 200
|
@@ -131,17 +133,18 @@ http_interactions:
|
|
131
133
|
Connection:
|
132
134
|
- keep-alive
|
133
135
|
Content-Length:
|
134
|
-
- '
|
136
|
+
- '395'
|
135
137
|
Content-Type:
|
136
138
|
- application/json; charset=utf-8
|
137
139
|
Cache-Control:
|
138
140
|
- no-cache
|
139
141
|
body:
|
140
142
|
encoding: US-ASCII
|
141
|
-
string: ! '{ "folders": [ { "name": "\/home\/chris\/Documents", "peers": [
|
142
|
-
"
|
143
|
-
|
143
|
+
string: ! '{ "folders": [ { "name": "\/home\/chris\/Documents", "peers": [ {
|
144
|
+
"direct": 1, "name": "IceyEC Portable", "status": "Synced on 06\/05\/13 20:52:35"
|
145
|
+
} ], "secret": "6PX74LIR2RA2FF2W3DC25MG2CF6SQDSJ", "size": "0 B in 0 files"
|
146
|
+
}, { "name": "\/home\/chris\/bt_test", "peers": [ ], "secret": "FEEBRD6KX6NFZYJRVVN6WKGONI467MZE",
|
144
147
|
"size": "0 B in 0 files" } ], "speed": "0.0 kB\/s up, 0.0 kB\/s down" }'
|
145
148
|
http_version:
|
146
|
-
recorded_at:
|
149
|
+
recorded_at: Tue, 11 Jun 2013 01:55:13 GMT
|
147
150
|
recorded_with: VCR 2.5.0
|