r/AskProgramming • u/7garrison7 • 16m ago
How can I use Python to process my Apple Music library?
Hello!
I'm currently (re-)taking a Python course for my school and had an idea for a personal project which requires extracting info about all the albums in my Apple Music library. At first, I looked into authorizing through iCloud to make a request with Apple's Apple Music API. One StackOverflow user suggested:
- Set up a minimal local web server in Python
- Open a browser to Apple's auth flow
- Capture the token when it redirects back
- Save it for use in subsequent API calls
This seems pretty advanced, certainly nothing I've ever done before, but local web servers seem pretty straightforward to setup via libraries. It's the "capture" part I'm confused about. As I understand it, web apps use JavaScript for their backend functionality, so I'm a little confused about what each language would be doing in this scenario.
Any advice on how to actually execute this?
Thanks!
•
u/UhLittleLessDum 9m ago
It's super unlikely that somebody somehow wrote python bindings for this, so you'd have to learn to write swift, and even then, you're going to be limited about what data you can return as a matter of business decisions by Apple. You can just crawl the website if you really want to, if you can load your data in a browser somehow, but that'd be pretty clunky at best.