Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: README, cleanup, updates and fixes
- Loading branch information
Showing
11 changed files
with
100 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# apkmirror-client | ||
|
||
Download APKs from APKMirror.com | ||
|
||
# Example | ||
|
||
> Download Whatsapp | ||
```js | ||
'use strict' | ||
|
||
const apk = require('apkmirror-client') | ||
const fs = require('fs') | ||
|
||
apk.searchForApps('whatsapp', (err, res) => { // search for whatsapp | ||
if (err) throw err | ||
let whatsapp = res.filter(r => r.app.name === 'WhatsApp Messenger')[0] // this makes sure we don't get any "whatsapp gold" stuff | ||
apk.getAppPage(whatsapp, (err, page) => { // now download details | ||
if (err) throw err | ||
console.log(page) | ||
|
||
page.versions.filter(v => !v.beta)[0].loadRelease((err, release) => { // now get latest non-beta release | ||
if (err) throw err | ||
console.log(release) | ||
|
||
release.estimateBestCandidate('arm64').loadVariant((err, download) => { // now get the arm64 release | ||
if (err) throw err | ||
console.log(res) | ||
download.downloadAPK((err, apk) => { // and finally download the apk | ||
if (err) throw err | ||
apk.pipe(fs.createWriteStream('./whatsapp.apk')).on('close', () => { // ...into this file | ||
console.log('Saved as whatsapp.apk!') | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use strict' | ||
|
||
/* eslint-disable max-nested-callbacks */ | ||
/* eslint-disable no-console */ | ||
|
||
const apk = require('apkmirror-client') | ||
const fs = require('fs') | ||
|
||
apk.searchForApps('whatsapp', (err, res) => { // search for whatsapp | ||
if (err) throw err | ||
let whatsapp = res.filter(r => r.app.name === 'WhatsApp Messenger')[0] // this makes sure we don't get any "whatsapp gold" stuff | ||
apk.getAppPage(whatsapp, (err, page) => { // now download details | ||
if (err) throw err | ||
console.log(page) | ||
|
||
page.versions.filter(v => !v.beta)[0].loadRelease((err, release) => { // now get latest non-beta release | ||
if (err) throw err | ||
console.log(release) | ||
|
||
release.estimateBestCandidate('arm64').loadVariant((err, download) => { // now get the arm64 release | ||
if (err) throw err | ||
console.log(res) | ||
download.downloadAPK((err, apk) => { // and finally download the apk | ||
if (err) throw err | ||
apk.pipe(fs.createWriteStream('./whatsapp.apk')).on('close', () => { // ...into this file | ||
console.log('Saved as whatsapp.apk!') | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters