forked from jmrodri/sm-photo-tool
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest-v1.2.2.py
31 lines (21 loc) · 819 Bytes
/
test-v1.2.2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python
#
# v1.2.2 XMLRPC test for smugmug.login.withPassword
import sys
import httplib
import xmlrpclib
API_KEY="4XHW8Aw7BQqbkGszuFciGZH4hMynnOxJ"
if len(sys.argv) < 3:
print("test-v1.2.2.py <username> <password>")
sys.exit(1)
verbose=True
# v1.2.1 works:
client1 = xmlrpclib.ServerProxy("https://api.smugmug.com/services/api/xmlrpc/1.2.1/", verbose=verbose)
session = client1.smugmug.login.withPassword(sys.argv[1], sys.argv[2], API_KEY)
# v1.2.2 does not work:
#client = xmlrpclib.ServerProxy("https://api.smugmug.com/services/api/xmlrpc/1.2.2/", verbose=verbose)
client2 = xmlrpclib.ServerProxy("https://secure.smugmug.com/services/api/xmlrpc/1.2.2/", verbose=verbose)
print str(client2)
session = client2.smugmug.login.withPassword(API_KEY, sys.argv[1], sys.argv[2])
print session
#eof