Skip to content

Commit b909785

Browse files
authored
Update skyhookUpDown.py
1 parent 55291a3 commit b909785

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

skyhookUpDown.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
try:
2-
import ipfsApi
2+
import ipfshttpclient
33
except:
4-
print("[!] Module ipfs-api not installed")
4+
print("[!] Module ipfshttpclient not installed")
55
exit()
66

77
try:
@@ -18,7 +18,11 @@
1818
def getRandomString(length):
1919
return("".join(random.choice(string.ascii_letters + string.digits) for i in range(length)))
2020

21-
peer = ipfsApi.Client(skyhookConfig.host, skyhookConfig.port)
21+
try:
22+
peer = ipfshttpclient.connect(skyhookConfig.host)
23+
except:
24+
print("[!] Cannot connect to {}".format(skyhookConfig.host))
25+
exit()
2226

2327
def uploadFile(fileName):
2428
currentDir = os.getcwd()

0 commit comments

Comments
 (0)