GithubHelp home page GithubHelp logo

jcorporation / webradiodb Goto Github PK

View Code? Open in Web Editor NEW
29.0 2.0 3.0 94.32 MB

Webradio database for myMPD

Home Page: https://jcorporation.github.io/webradiodb/

License: GNU General Public License v3.0

Shell 100.00%
webradio mympd

webradiodb's Introduction

myMPD Webradio Database

test checkDb checkImages checkStreams createWebradioIndex pages-build-deployment

This is my attempt to create a curated webradio list for myMPD.

Contributions to the webradio database are very welcome. It should be a community driven database. You must only open an issue to add or modify a webradio. Your proposal will be reviewed and then merged, therefore it could take some time before the webradio is added.

Please do not add geo-fenced streams.

Add a new webradio

Open an issue.

Modify a webradio

Search for the webradio and click on the modify link to open a prefilled GitHub issue.

Usage

This project is designed as an easily integratable webradio database for music players. At the moment there is no api endpoint to query the database. An application should fetch the metadata json file and use it locally.

Some internals

At the moment there are two sources for webradio files:

  • Webradios from moode audio (sources/moode-*)
  • Manually added files (sources/mympd-*)

Workflows

Add, modify and delete a webradio

The primary workflow to add or modify a webradio is to open an issue. The issue must be manually approved by adding a merge label. A GitHub action is triggered on the label event and the build script runs:

  • creates the m3u file
  • downloads the image
  • converts the image to webp and resizes it to 400x400 pixel

Index creation

The create workflow runs once a day.

  • copies files from sources to docs/db folder
  • parses the m3u files and creates JSON index files

After this workflow the docs folder is published to the GitHub page.

Checks

There are some nightly tasks to check the integrity of the database and the streams availablity.

CHECK DESCRIPTION
Stream Checks the availability of the stream with ffprobe. Failed checks are written to the status.min.json file.
Image Checks for obsolet or missing images. It also checks if the image files are valid webp images.
DB Checks for duplicates in the index files.

Storage format

Webradios are saved as extended m3u files with some custom fields. A coverimage could be specified as file in the pics folder or an url.

#EXTM3U
#EXTINF:-1,<name>
#EXTGENRE:<genre>
#PLAYLIST:<name>
#EXTIMG:<cover>
#HOMEPAGE:<homepage>
#COUNTRY:<country>
#STATE:<state (deprecated)>
#REGION:<region>
#LANGUAGE:<language>
#DESCRIPTION:<description>
#CODEC:<codec>
#BITRATE:<bitrate>
#ADDED:<timestamp>
#LASTMODIFIED:<timestamp>
<streamuri>

The filename of the playlist and the coverimage are derived from the streamuri by replacing <>/.:?&$%!#\|;= characters with _. This is the same behaviour as in myMPD and makes this playlists compatible with the myMPD webradio feature.

You must not download the station images, instead you can prepend https://jcorporation.github.io/webradiodb/db/pics/ to the image name, e.g. https://jcorporation.github.io/webradiodb/db/pics/http___119_15_96_188_stream2_mp3.webp.

The final files are located in the docs/db folder, it is rebuild daily. The folder docs is published through GitHub Pages.

FOLDER DESCRIPTION
docs/db/index Metadata as json and javascript
docs/db/pics Station images
docs/db/webradios Playlists

Index files

FILE DESCRIPTION
bitrates.min.json Array of bitrates
codecs.min.json Array of codecs
countries.min.json Array of countries
states.min.json Object of countries and linked states. Deprecated, use regions.
regions.min.json Object of countries and linked regions
genres.min.json Array of genres
languages.min.json Array of languages
status.min.json Array of failed stream checks
webradios.min.json JSON object of webradios
webradiodb-combined.min.json JSON object file with all the above indexes
webradiodb-combined.min.js JavaScript file with all the above indexes

The m3u fields are mapped for better readability.

M3U FIELD JSON KEY VALUE TYPE DESCRIPTION
EXTGENRE Genre Array
PLAYLIST Name String
EXTIMG Image String
HOMEPAGE Homepage String
COUNTRY Country String
STATE State String Deprecated
REGION Region String
LANGUAGE Language String Deprecated
LANGUAGE Languages Array
CODEC Codec Array
BITRATE Bitrate Integer
DESCRIPTION Description String
ADDED Added Number
LASTMODIFIED Last-Modified Number
uri StreamUri String
"https___liveradio_swr_de_sw282p3_swr1bw_play_mp3.m3u": {
    "Genre": [
        "Pop",
        "Rock"
    ],
    "Name": "SWR 1 BW",
    "Image": "https___liveradio_swr_de_sw282p3_swr1bw_play_mp3.webp",
    "Homepage": "https://www.swr.de/swr1/",
    "Country": "Germany",
    "State": "Baden-Württemberg",
    "Region": "Baden-Württemberg",
    "Language": "German",
    "Languages": [
        "German"
    ],
    "Description": "SWR 1 Baden-Württemberg",
    "Added": 1720344242,
    "Last-Modified": 1720344242,
    "Codec": "MP3",
    "Bitrate": 128,
    "StreamUri": "https://liveradio.swr.de/sw282p3/swr1bw/play.mp3",
    "alternativeStreams": {
        "https___liveradio_swr_de_sw890cl_swr1bw_": {
            "StreamUri": "https://liveradio.swr.de/sw890cl/swr1bw/",
            "Codec": "AAC",
            "Bitrate": 48
        },
        "https___liveradio_swr_de_sw331ch_swr1bw_": {
            "StreamUri": "https://liveradio.swr.de/sw331ch/swr1bw/",
            "Codec": "AAC",
            "Bitrate": 96
        }
    }
}

Script usage

The script is used by GitHub actions.

Type ./build.sh for usage information.

Dependencies

  • curl: download images
  • csvkit: sync moode webradios
  • ffmpeg: check streams with ffprobe
  • imagemagick: convert images to webp
  • jq: parse and create json

Copyright

Everyone is free to use the collected data in their works. I give all the rights I have at the accumulated data to the public domain.

2021-2023 Juergen Mang [email protected]

webradiodb's People

Contributors

dependabot[bot] avatar jcorporation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

webradiodb's Issues

[Add Webradio]: RTBF - La Première

Webradio Name

RTBF - La Première

Stream URI

https://radios.rtbf.be/laprem1ere-128.mp3

Genres

Misc; Variety; News

Homepage

https://www.rtbf.be/lapremiere/

Image

https://user-images.githubusercontent.com/4215150/147925304-a7e62c75-8f1d-4934-b142-c0384997ba5e.png

Country

Belgium

Language

French

Description

La Première (« La 1ère »), est la première station de radio publique de la Radio-télévision belge de la Communauté française (RTBF). Sa programmation est généraliste et axée sur l'information et la culture.

ToDo

  • Improve performance of index creation
  • Workflow for Webradio edit
  • Workflow for Webradio delete
  • use only first line of json input data for tags
  • replace ; or , with , in genre tag
  • create list of genres
  • create list of languages
  • create list of countries
  • add genre/country/language filter to search

[Add Webradio]: Bide et Musique

Webradio Name

Bide et Musique - La radio de l'improbable et de l'inouï

Stream URI

https://relay2.bide-et-musique.com:9300/bm.mp3

Genres

70's; 80's

Homepage

https://www.bide-et-musique.com/

Image

https://user-images.githubusercontent.com/4215150/147943055-3da6f85c-a984-4648-93ba-d8239dc4a002.pn

radio_bide_musique

Country

France

Language

French

Description

Bide et Musique (parfois abrégé B&M) est une webradio associative française créée en 2000. Le bide est un morceau de variété (souvent chanté, parfois instrumental, parfois on se demande) pour lequel on a une tendresse particulière, auquel on souhaite donner une importance qu'il n'a pas nécessairement eue dans l'histoire de la musique et, bien entendu, que l'on a plaisir à entendre… et réentendre… et…

[Modify Webradio]: RTBF - La Première

Webradio to modify

https://radios.rtbf.be/laprem1ere-128.mp3

New webradio Name

RTBF - La Première

New stream URI

https://radios.rtbf.be/laprem1ere-128.mp3

New genres

Misc; Variety; News

New homepage

https://www.rtbf.be/lapremiere/

Image

https___radios_rtbf_be_laprem1ere-128_mp3.webp

New country

Belgium

New language

French

New description

La Première (« La 1ère »), est la première station de radio publique de la Radio-télévision belge de la Communauté française (RTBF). Sa programmation est généraliste et axée sur l'information et la culture.

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.