Giter Site home page Giter Site logo

wangningning86 / go-googleplay Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jarijaas/go-googleplay

0.0 0.0 0.0 323 KB

CLI/API for downloading Android apps from the Google Playstore. Pre-built binaries for Windows & Linux

License: MIT License

Go 99.84% Makefile 0.16%

go-googleplay's Introduction

Google Playstore Client

Binaries are here

Terminology:

  • Google Services Framework ID (GSFID) - Device specific identifier (hex string)
    • Generated against a device config send to Google servers
  • AuthSub Token - Authentication token to Playstore, exchanged against account email and password

CLI Usage

Client for Google Playstore, can download apps

Usage:
  gplay [flags]
  gplay [command]

Available Commands:
  download    Download app
  help        Help about any command
  login       Login using the credentials, returns new or cached gsfId and authSub

Flags:
      --authSub string    Alternatively, set env var GPLAY_AUTHSUB
      --email string
      --force-login       Authenticate, even if current gsfId and authSubToken are valid
      --gsfId string      Alternatively, set env var GPLAY_GSFID
  -h, --help              help for gplay
      --password string
  -v, --verbose           Enable debug messages

Use "gplay [command] --help" for more information about a command.

For example, to download whatsapp:

gplay download --id com.whatsapp --out whatsapp.apk

API Usage

To download a file to disk:

package main

import (
	"github.com/jarijaas/go-gplayapi/pkg/auth"
	"github.com/jarijaas/go-gplayapi/pkg/playstore"
	log "github.com/sirupsen/logrus"
	"io"
	"os"
)

func main()  {
	gplay, err := playstore.CreatePlaystoreClient(&playstore.Config{
		AuthConfig: &auth.Config{
			Email:        "",
			Password:     "",
		},
	})
	if err != nil {
		log.Fatal(err)
	}

	// Download the latest version
	reader, downloadInfo, err := gplay.Download("com.whatsapp", 0)
	if err != nil {
		log.Fatal(err)
	}

	log.Infof("Download size: %d bytes", downloadInfo.Size)

	f, err := os.Create("./whatsapp.apk")
	if err != nil {
		log.Fatal(err)
	}

	_, err = io.Copy(f, reader)
	if err != nil {
		log.Fatal(err)
	}
}

This project is based on NoMore201/googleplay-api GNU General Public License

go-googleplay's People

Contributors

jarijaas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.