Skip to content

Commit 325683a

Browse files
authored
Update README.md
1 parent 2b1b359 commit 325683a

File tree

1 file changed

+16
-45
lines changed

1 file changed

+16
-45
lines changed

README.md

Lines changed: 16 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,40 @@
22

33
An anisette data provider, but in a Python package! Based on [pyprovision-uc](https://github.com/JayFoxRox/pyprovision-uc).
44

5-
Still experimental, and stability of the underlying VM remains to be seen.
6-
7-
## Prerequisites
8-
9-
Libraries from the Apple Music Android app are required to set up the provider at least once.
10-
The bundle generated from this after initialization can be used for all your future provisioning needs.
11-
12-
The required APK file can be downloaded [here](https://web.archive.org/web/20231226115856/https://apps.mzstatic.com/content/android-apple-music-apk/applemusic.apk).
13-
The download of this file will eventually be integrated into Anisette.py itself.
5+
[Documentation](https://docs.mikealmel.ooo/Anisette.py)
146

157
## Usage
168

179
Anisette.py has a very simple API.
1810
You, the developer, are responsible for initializing, loading and saving the state of the Anisette engine, either to memory or to disk.
1911
If you want to keep your provisioning session, you **MUST** save and load the state properly. If you don't, you **WILL** run into errors.
12+
See the docs for information on how to do this.
2013

2114
### Initialization
2215

23-
```python
24-
from anisette import Anisette
25-
26-
ani = Anisette.init("applemusic.apk")
27-
28-
# Alternatively, you can init from a file-like object:
29-
with open("applemusic.apk", "rb") as f:
30-
ani = Anisette.init(f)
31-
```
32-
33-
### Saving state
34-
35-
State is saved to two separate bundles: a "provisioning" bundle and a "library" bundle. The provisioning bundle
36-
is specific to your provisioning session and can **NOT** be shared across sessions. The library bundle **CAN** be
37-
shared across sessions, but this is not required. It is also possible to save both the provisioning state and libraries
38-
to a single bundle. This may be easier to work with, but requires more disk space (3-4 megabytes per saved session).
16+
The Anisette provider must be initialized with libraries from the Apple Music APK.
17+
To save you some effort, a Cloudflare Worker has been set up to provide easy access to these libraries.
18+
By default, the Anisette.py will download this library bundle (~3 megabytes) when initializing a new session,
19+
but you can also provide an APK file or downloaded bundle yourself.
3920

4021
```python
41-
ani.save("bundle.bin")
42-
43-
# Alternatively, to save both bundles separately:
44-
ani.save("provisioning.bin", "libs.bin")
45-
46-
# You can also use file objects:
47-
with open("provisioning.bin", "wb+") as pf, open("libs.bin", "wb+") as lf:
48-
ani.save(pf, lf)
49-
```
50-
51-
### Loading state
52-
53-
As mentioned before, if you want to keep your provisioning session across restarts, you must load it properly.
22+
from anisette import Anisette
5423

55-
```python
56-
ani = Anisette.load("bundle.bin")
24+
# First use: download from Cloudflare
25+
ani = Anisette.init()
5726

58-
# Alternatively, to load both bundles separately:
59-
ani = Anisette.load("provisioning.bin", "libs.bin")
27+
# After download, save library bundle to disk
28+
ani.save_libs("libs.bin")
6029

61-
# Once again, you can also use file objects:
62-
with open("provisioning.bin", "rb") as pf, open("libs.bin", "rb") as lf:
63-
ani = Anisette.load(pf, lf)
30+
# For future use, initialize from disk:
31+
ani2 = Anisette.init("libs.bin")
6432
```
6533

6634
### Getting Anisette data
6735

36+
The first time you call this method will probably take a few seconds since the virtual device needs to be provisioned first.
37+
After provisioning, getting Anisette data should be quite fast.
38+
6839
```python
6940
ani.get_data()
7041

0 commit comments

Comments
 (0)