먼저 계정과 암호 인증 (http://developers.google.com/accounts/docs/AuthForInstalledApps 참조)
auth=`curl --silent -d [email protected] -d Passwd=yourpwd -d service=contacts https://www.google.com/accounts/ClientLogin|grep ^Auth=|cut -d= -f2`
myserious "tok"변수를 얻습니다. JSON 요청의 일부인 것으로 확인되었습니다.
tok=`curl --silent --header "Authorization: GoogleLogin auth=$auth" "https://www.google.com/s2/gastatus?out=js&rc=0" |sed 's/,/\n/g' |grep AuthToken |cut -d'"' -f6`
CSV (Google 형식)를 다운로드하십시오. 이것이 바로이 일을 수동 방식과 동일합니다 : google_csv, outlook_csv, vCard를 중 하나가 될 수 있습니다 "에서"
curl -s --stderr - -L -o contacts-google-whatever\@gmail.com-$(date +%Y-%m-%d-%H.%M.%S).csv -H "Authorization:GoogleLogin auth=$auth" --insecure "https://www.google.com/s2/data/exportquery?ac=false&cr=true&ct=true&df=true&ev=true&f=g2&gids=6&gp=true&hl=en-US&id=personal&max=-1&nge=true&out=google_csv&sf=display&sgids=6%2Cd%2Ce%2Cf%2C17&st=0&tok=$tok&type=4"
변수
을 support.google.com/mail/answer/24911?hl=en. 내 코드는 bash이므로 curl 명령을 파이썬과 동등한 것으로 변경할 수 있습니다. 중요한 정보는 변수와 URL입니다.
언제든지 셀렌 등으로 프로그래밍 할 수 있습니다. 브라우저 창을 프로그래밍 방식으로 열고 gmail 등에 로그인합니다. – katrielalex
또한 Backupify가이를 수행 할 수 있으므로 확실히 가능합니다. – katrielalex