Commit 1739425d authored by Domenico Iezzi's avatar Domenico Iezzi
Browse files

Added setup.py + changes to the lib structure

Signed-off-by: default avatarDomenico Iezzi <domenico.iezzi.201@gmail.com>
parent 88bf0589
Showing with 40 additions and 10 deletions
+40 -10
language: python
python: '3.6'
install: pip install -r requirements.txt
install: pip install .
script: python test.py
......@@ -2,11 +2,25 @@
This project contains an unofficial API for google play interactions. The code mainly comes from
[GooglePlayAPI project](https://github.com/egirault/googleplay-api/) which was written for python2 and it's not
maintained anymore. The code was ported to python3 with some minor additions and updates, mainly for python3 compatibility.
maintained anymore. The code was ported to python3 with some important changes:
All credit goes to the original author [egirault](https://github.com/egirault).
* ac2dm authentication with checkin and device info upload
* updated search and download calls
* using headers of a Nexus 6P. Add you own device under `device.properties` file
This project is released under the BSD license.
# Usage
Check the test.py module for a simple example.
An important note about login function:
```
def login(self, email, password, ac2dmToken=None, gsfId=None)
```
for first time logins, you should only provide email and password.
The module will take care of retrieving an ac2dm token, registering
"your device" to the google account you supplied, and retrieving
a Google Service Framework ID (which basically is the android ID of a device).
For the next logins you **should** save the ac2dm master token and the gsfId (androidId), and provide them as parameters to the login function. If you login again with email and password only, this is the equivalent of deleting the google account from you device and re-initalize it every time.
# API reversing
......
import googleplay_pb2
from . import googleplay_pb2
import time
import os
import configparser
......
File moved
......@@ -11,13 +11,11 @@ from Crypto.Hash import SHA
from Crypto.Cipher import PKCS1_OAEP
import requests
import config
import base64
import struct
import itertools
import googleplay_pb2
import utils
from . import googleplay_pb2, config, utils
ssl_verify = True
......@@ -165,7 +163,7 @@ class GooglePlayAPI(object):
response = googleplay_pb2.ResponseWrapper.FromString(res.content)
def login(self, email=None, password=None, ac2dmToken=None, gsfId=None):
def login(self, email, password, ac2dmToken=None, gsfId=None):
"""Login to your Google Account.
For first time login you should provide:
* email
......
File moved
File moved
from setuptools import setup
setup(
name='googleplay-api',
version='0.1.0',
description='Unofficial python3 api for google play',
url='https://github.com/NoMore201/googleplay-api',
author='NoMore201',
author_email='domenico.iezzi.201@gmail.com',
license='MIT',
packages=['gpapi'],
package_data={
'gpapi': ['device.properties'],
},
install_requires=['pycrypto',
'protobuf',
'requests'],
)
from googleplay import GooglePlayAPI
from gpapi.googleplay import GooglePlayAPI
import sys
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment