https://github.com/inktrap/soma-songs
Save songs from https://somafm.com as JSON. See somafm-json for results https://github.com/inktrap/somafm-json
https://github.com/inktrap/soma-songs
json music scraper somafm
Last synced: 3 months ago
JSON representation
Save songs from https://somafm.com as JSON. See somafm-json for results https://github.com/inktrap/somafm-json
- Host: GitHub
- URL: https://github.com/inktrap/soma-songs
- Owner: inktrap
- License: mit
- Created: 2023-08-26T11:44:48.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-26T14:11:22.000Z (almost 3 years ago)
- Last Synced: 2025-12-16T03:27:17.518Z (7 months ago)
- Topics: json, music, scraper, somafm
- Language: Python
- Homepage: https://pypi.org/project/soma-songs/
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Soma Songs
[](https://pdm.fming.dev)
[](https://github.com/psf/black)

Save songs from as JSON.
## How does it work?
Most somafm radiostations publish their tracklist. F.e. the police `scanner`-channel doesn't, while [def con radio](https://somafm.com/defcon/songhistory.html) does. But this overview only includes the last hour(s) and is not easily machine-readable.
So why not archive this for all the channels, all the time, clean up the data a little bit and make it more useable?
- results are stored in a `tinydb`, well, two, actually, these are just JSON files
- the timestamp also includes a date and has a timezone annotation. Btw., if you want to get into the details: is based in San Francisco, the IANA time zone identifier is America/Los_Angeles. Currently they use PDT (Pacific Daylight Time), which is UTC-7. PST (Pacific Standard Time) would be UTC-8.
- the somafm amazon links are not relative anymore and are also included to support
# How do you use/run this?
Well, you don't have to :) because I already created inktrap/somafm-json which contains the output.
But you can, by:
```
pipx install somafm-songs
```
If you call `somafm-songs` you'll see that `~/somafm-json/meta.json` contains the channel meta data and `~/somafm-json/music.json` contains tracks/songs.
If you want to keep your results in git and push them to a remote you have to turn that directory into a git repository with a remote and create a cron-job which does (and is allowed to do) the git commit/push spiel. I haven't tested this yet, but a cronjob like this could work:
```
30 * * * * /path/to/soma-songs -q && cd ~/somafm-json && git commit -am $(date) && git push
```
Thanks to somafm and to all the amazing DJ(ane)s :)
# What can you do with this?
You get a nice archive of great radio channels, what else do you want? Well, you could:
- train your own music recommendation tool for each channel, just for fun
- match albums/artists with musicbrainz-identifiers to find more info
- look for overlap/similarity of channels
- create your own rankings (per channel/artist/genre/year/…)
- you could check for each channel how many artists/albums/songs are in your `beets` library (maybe adjust for popularity?!)