* Updated user agent string with data taken from play-store-api
* *download* and *delivery* functions will now return a python generator
rather than raw bytes, to prevent app loading entire files in memory.
This generator can be iterated to get chunk of bytes to write, as
discussed in issue #35.
* as a consequence of the previous point, there is no more progress bar
feature for downloading. It should be implemented by developers using
the API.
Before, if locale wasn't specified as a parameter, it was picked from
the system running gpapi. Similar thing happened for timezone, but its
value was hardcoded in config.py.
To avoid problems related to missing or unavailable apps, this commit
enforces users to provide a locale and a timezone value. Without them,
gpapi can't be initialized.
Since most of the device data is used only for the checkin procedure,
which is run only after the first login with email and passwd, it
is useless to have functions in GooglePlayAPI to modify them at runtime.
Now if the user wants to specify custom data, this data should be
provided as arguments to the constructor.
As described in play-store-api code [1] recenlty google introduced a Time
To Live to each auth token, which caused them to expire in a matter of
seconds. Moreover, in order to retrieve a long-ttl token, a second auth
request now is needed, sending the Master Token returned from the first
request. This 'second round' request will return the actual authSubToken.
Another addition is that the code now return response's text for some
generic errors, in order to help debugging those problems.
Now the function returns None if an app doesnt't exists. This does not
apply for details() function, which instead return a RequestError if the
app doesn't exist.
In order to catch invalid tokens, an additional integrity check is done
before returning lists in details() and bulkDetails() functions. If the
check doesn't pass, raise a LoginError.
During DeviceBuilder initialization, retrieve locale from system using
python `locale` module, and set timezone to `Europe/Berlin`. Added some
helpers to get and set those values at runtime.
The old caching code could cause a query to be cached for ever,
returning always the same set of result for a specific query. This is
not a good behaviour, since search results change continuously. In the
future, this behaviour could be reintroduced with a better logic (for
example, check if the query was in cache longer than some hours or days)
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>