Skip to content

Commit

Permalink
Feat: remove deprecated fields: State,Language
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Dec 19, 2024
1 parent 9c051db commit b872239
Show file tree
Hide file tree
Showing 1,453 changed files with 3 additions and 1,499 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ Webradios are saved as extended m3u files with some custom fields. A coverimage
#EXTIMG:<cover>
#HOMEPAGE:<homepage>
#COUNTRY:<country>
#STATE:<state (deprecated)>
#REGION:<region>
#LANGUAGE:<language>
#DESCRIPTION:<description>
Expand Down Expand Up @@ -107,7 +106,6 @@ The final files are located in the `docs/db` folder, it is rebuild daily. The fo
| [bitrates.min.json](https://jcorporation.github.io/webradiodb/db/index/bitrates.min.json) | Array of bitrates |
| [codecs.min.json](https://jcorporation.github.io/webradiodb/db/index/codecs.min.json) | Array of codecs |
| [countries.min.json](https://jcorporation.github.io/webradiodb/db/index/countries.min.json) | Array of countries |
| [states.min.json](https://jcorporation.github.io/webradiodb/db/index/states.min.json) | Object of countries and linked states. Deprecated, use regions. |
| [regions.min.json](https://jcorporation.github.io/webradiodb/db/index/regions.min.json) | Object of countries and linked regions |
| [genres.min.json](https://jcorporation.github.io/webradiodb/db/index/genres.min.json) | Array of genres |
| [languages.min.json](https://jcorporation.github.io/webradiodb/db/index/languages.min.json) | Array of languages |
Expand All @@ -125,9 +123,7 @@ The m3u fields are mapped for better readability.
| 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 | |
Expand All @@ -146,9 +142,7 @@ The m3u fields are mapped for better readability.
"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"
],
Expand Down Expand Up @@ -191,4 +185,4 @@ Type `./build.sh` for usage information.

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 <mail@jcgames.de>
2021-2024 Juergen Mang <mail@jcgames.de>
42 changes: 1 addition & 41 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ INDEXFILE_JS="${PUBLISH_DIR}/index/webradiodb-combined.min.js"
STATUSFILE="${PUBLISH_DIR}/index/status.min.json"
LANGFILE="${PUBLISH_DIR}/index/languages.min.json"
COUNTRYFILE="${PUBLISH_DIR}/index/countries.min.json"
STATEFILE="${PUBLISH_DIR}/index/states.min.json"
REGIONFILE="${PUBLISH_DIR}/index/regions.min.json"
GENREFILE="${PUBLISH_DIR}/index/genres.min.json"
CODECFILE="${PUBLISH_DIR}/index/codecs.min.json"
Expand Down Expand Up @@ -216,25 +215,6 @@ normalize_fields() {
echo "$F: $COUNTRY -> $COUNTRY_UPPER"
sed -i -e "s/^#COUNTRY:.*/#COUNTRY:$COUNTRY_UPPER/" "$F"
fi
# state
local STATE=""
STATE=$(get_m3u_field "$F" "STATE")
if [ -n "$STATE" ]
then
local STATE_UPPER
STATE_UPPER=$(ucwords "$STATE")
STATE_UPPER=$(trim "$STATE_UPPER")
local REPLACE_STATE="${region_map[$STATE_UPPER]:-}"
if [ -n "$REPLACE_STATE" ]
then
echo "$F: $STATE -> $REPLACE_STATE"
sed -i -e "s/^#STATE:.*/#STATE:$REPLACE_STATE/" "$F"
elif [ "$STATE" != "$STATE_UPPER" ]
then
echo "$F: $STATE -> $STATE_UPPER"
sed -i -e "s/^#STATE:.*/#STATE:$STATE_UPPER/" "$F"
fi
fi
# region
local REGION=""
REGION=$(get_m3u_field "$F" "REGION")
Expand Down Expand Up @@ -378,7 +358,6 @@ sync_moode() {
#EXTIMG:$IMAGE
#HOMEPAGE:$HOMEPAGE
#COUNTRY:$COUNTRY
#STATE:
#REGION:
#LANGUAGE:$LANGUAGE
#DESCRIPTION:
Expand Down Expand Up @@ -438,7 +417,6 @@ add_radio() {
#EXTIMG:${PLIST}.webp
#HOMEPAGE:<homepage>
#COUNTRY:<country>
#STATE:<state>
#REGION:<region>
#LANGUAGE:<language>
#DESCRIPTION:<description>
Expand Down Expand Up @@ -520,7 +498,6 @@ add_radio_from_json() {
#EXTIMG:$IMAGE
#HOMEPAGE:$HOMEPAGE
#COUNTRY:$COUNTRY
#STATE:$REGION
#REGION:$REGION
#LANGUAGE:$LANGUAGE
#DESCRIPTION:$DESCRIPTION
Expand Down Expand Up @@ -674,7 +651,6 @@ modify_radio_from_json() {
#EXTIMG:$NEW_IMAGE
#HOMEPAGE:$NEW_HOMEPAGE
#COUNTRY:$NEW_COUNTRY
#STATE:$NEW_REGION
#REGION:$NEW_REGION
#LANGUAGE:$NEW_LANGUAGE
#DESCRIPTION:$NEW_DESCRIPTION
Expand Down Expand Up @@ -809,17 +785,9 @@ m3u_to_json() {
local VALUE=${INFO#*:}
if [ "$KEY" = "LANGUAGE" ]
then
# new languages key
local VALUES
#VALUES=$(jq -c -R 'split(", ")' <<< "$VALUE")
VALUES=$(json_quote_array "$VALUE")
printf '"%s":%s,' "Languages" "$VALUES"
# old language key for backward compatibility
#VALUE=$(jq -n --arg value "$VALUE" '$value')
VALUE=$(json_quote "$VALUE")
VALUE=$(json_quote_array "$VALUE")
elif [ "$KEY" = "EXTGENRE" ]
then
#VALUE=$(jq -c -R 'split(", ")' <<< "$VALUE")
VALUE=$(json_quote_array "$VALUE")
elif [ "$KEY" = "BITRATE" ]
then
Expand All @@ -829,12 +797,10 @@ m3u_to_json() {
then
[ -z "$VALUE" ] && VALUE="-1"
else
#VALUE=$(jq -n --arg value "$VALUE" '$value')
VALUE=$(json_quote "$VALUE")
fi
printf '"%s":%s' "${m3ufields_map[$KEY]:-}" "$VALUE"
else
#VALUE=$(jq -n --arg value "$LINE" '$value')
VALUE=$(json_quote "$LINE")
printf '"%s":%s' "StreamUri" "$VALUE"
fi
Expand Down Expand Up @@ -1027,7 +993,6 @@ create_index() {
done < <(jq -r '.[].Country' "${INDEXFILE}.tmp" | sort -u)
printf "}"
} > "$REGIONFILE.tmp"
cp "$REGIONFILE.tmp" "$STATEFILE.tmp"
local REGIONS_COUNT
REGIONS_COUNT=$(jq -r '.[] | select(.Region != "") | .Region' "$INDEXFILE.tmp" | wc -l)
echo "${REGIONS_COUNT} regions in index"
Expand Down Expand Up @@ -1066,10 +1031,6 @@ create_index() {
tr -d '\n' < "${COUNTRYFILE}.tmp" >> "${INDEXFILE_COMBINED}.tmp"
printf ",\"totalwebradioCountries\":%s," "$COUNTRIES_COUNT" >> "${INDEXFILE_COMBINED}.tmp"

printf "\"webradioStates\":" >> "${INDEXFILE_COMBINED}.tmp"
tr -d '\n' < "${STATEFILE}.tmp" >> "${INDEXFILE_COMBINED}.tmp"
printf ",\"totalwebradioStates\":%s," "$REGIONS_COUNT" >> "${INDEXFILE_COMBINED}.tmp"

printf "\"webradioRegions\":" >> "${INDEXFILE_COMBINED}.tmp"
tr -d '\n' < "${REGIONFILE}.tmp" >> "${INDEXFILE_COMBINED}.tmp"
printf ",\"totalwebradioRegions\":%s," "$REGIONS_COUNT" >> "${INDEXFILE_COMBINED}.tmp"
Expand Down Expand Up @@ -1104,7 +1065,6 @@ create_index() {
if move_compress_changed "$INDEXFILE"; then CHANGED=1; fi
if move_compress_changed "$LANGFILE"; then CHANGED=1; fi
if move_compress_changed "$COUNTRYFILE"; then CHANGED=1; fi
if move_compress_changed "$STATEFILE"; then CHANGED=1; fi
if move_compress_changed "$REGIONFILE"; then CHANGED=1; fi
if move_compress_changed "$GENREFILE"; then CHANGED=1; fi
if move_compress_changed "$CODECFILE"; then CHANGED=1; fi
Expand Down
1 change: 0 additions & 1 deletion docs/db/webradios/http___104_167_4_67_8136_stream.m3u
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___104_167_4_67_8136_stream.webp
#HOMEPAGE:http://payphoneradio.com/
#COUNTRY:USA
#STATE:New York City
#REGION:New York City
#LANGUAGE:English
#DESCRIPTION:This radio stream contains recordings of phone calls made almost entirely from New York City payphones.
Expand Down
1 change: 0 additions & 1 deletion docs/db/webradios/http___158_69_74_203_80_.m3u
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___158_69_74_203_80_.webp
#HOMEPAGE:
#COUNTRY:Switzerland
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:
Expand Down
1 change: 0 additions & 1 deletion docs/db/webradios/http___200_129_35_230_8081_ouvir.m3u
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___200_129_35_230_8081_ouvir.webp
#HOMEPAGE:http://www.radiouniversitariafm.com.br/
#COUNTRY:Brazil
#STATE:Ceará
#REGION:Ceará
#LANGUAGE:Portuguese
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___200_136_219_172_8000_radioufscar96_mp3.webp
#HOMEPAGE:http://radio.ufscar.br/
#COUNTRY:Brazil
#STATE:São Paulo
#REGION:São Paulo
#LANGUAGE:Brazilian Portuguese
#DESCRIPTION:Rádio UFSCar - Escute Diferente
Expand Down
1 change: 0 additions & 1 deletion docs/db/webradios/http___217_20_116_68_32032_stream.m3u
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___217_20_116_68_32032_stream.webp
#HOMEPAGE:http://sohosfm.gr/
#COUNTRY:Greece
#STATE:
#REGION:
#LANGUAGE:Greek
#DESCRIPTION:
Expand Down
1 change: 0 additions & 1 deletion docs/db/webradios/http___5_135_183_124_8073_stream.m3u
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___5_135_183_124_8073_stream.webp
#HOMEPAGE:https://www.ondatorrenteradio.com
#COUNTRY:Spain
#STATE:Valencia
#REGION:Valencia
#LANGUAGE:Spanish
#DESCRIPTION:Somos la radio de todo el mundo
Expand Down
1 change: 0 additions & 1 deletion docs/db/webradios/http___7878_go2stream_fr_8000_stream.m3u
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___7878_go2stream_fr_8000_stream.webp
#HOMEPAGE:http://www.radiobalagne.com/
#COUNTRY:France
#STATE:Corse
#REGION:Corse
#LANGUAGE:Corse, French
#DESCRIPTION:A voce insulana
Expand Down
1 change: 0 additions & 1 deletion docs/db/webradios/http___79_120_39_202_8002_mathrock.m3u
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___79_120_39_202_8002_mathrock.webp
#HOMEPAGE:http://radcap.ru/mathrock.html
#COUNTRY:Russia
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:
Expand Down
1 change: 0 additions & 1 deletion docs/db/webradios/http___81_92_238_33_80.m3u
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___81_92_238_33_80.webp
#HOMEPAGE:
#COUNTRY:Luxembourg
#STATE:
#REGION:
#LANGUAGE:Luxembourgish
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___82_135_234_195_8000_goldfm_mp3.webp
#HOMEPAGE:https://goldfm.lt
#COUNTRY:Lithuania
#STATE:
#REGION:
#LANGUAGE:Lithuanian
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___82_135_234_195_8000_kelyje_kaunas_mp3.webp
#HOMEPAGE:https://www.radijaskelyje.lt
#COUNTRY:Lithuania
#STATE:
#REGION:
#LANGUAGE:Lithuanian
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___82_135_234_195_8000_kelyje_klaipeda_mp3.webp
#HOMEPAGE:https://www.radijaskelyje.lt
#COUNTRY:Lithuania
#STATE:
#REGION:
#LANGUAGE:Lithuanian
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___91_121_159_124_8000_eko-des-garrigues-256k_ogg.webp
#HOMEPAGE:http://www.ekodesgarrigues.com/
#COUNTRY:France
#STATE:
#REGION:
#LANGUAGE:French
#DESCRIPTION:
Expand Down
1 change: 0 additions & 1 deletion docs/db/webradios/http___91_218_212_67_8000_stream.m3u
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___91_218_212_67_8000_stream.webp
#HOMEPAGE:https://hromadske.radio/
#COUNTRY:Ukraine
#STATE:
#REGION:
#LANGUAGE:Ukrainian
#DESCRIPTION:Ukraine Talk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___a_files_bbci_co_uk_media_live_manifesto_audio_simulcast_hls_nonuk_sbr_low_ak_bbc_world_service_m3u8.webp
#HOMEPAGE:https://www.bbc.co.uk/sounds/play/live:bbc_world_service
#COUNTRY:United Kingdom
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___antena1_newradio_it_stream_ext__mp3.webp
#HOMEPAGE:http://antena1.com.br/
#COUNTRY:Brazil
#STATE:São Paulo
#REGION:São Paulo
#LANGUAGE:Brazilian Portuguese
#DESCRIPTION:ANTENA1 - 94 7 FM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___as-hls-ww-live_akamaized_net_pool_900_live_ww_bbc_asian_network_bbc_asian_network_isml_bbc_asian_network-audio_3d96000_norewind_m3u8.webp
#HOMEPAGE:
#COUNTRY:United Kingdom
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___as-hls-ww-live_akamaized_net_pool_904_live_ww_bbc_1xtra_bbc_1xtra_isml_bbc_1xtra-audio_3d96000_norewind_m3u8.webp
#HOMEPAGE:https://www.bbc.co.uk/1xtra
#COUNTRY:United Kingdom
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___as-hls-ww-live_akamaized_net_pool_904_live_ww_bbc_6music_bbc_6music_isml_bbc_6music-audio_3d96000_norewind_m3u8.webp
#HOMEPAGE:https://www.bbc.co.uk/sounds
#COUNTRY:United Kingdom
#STATE:
#REGION:
#CODEC:AAC(LC)
#BITRATE:320
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___as-hls-ww-live_akamaized_net_pool_904_live_ww_bbc_6music_bbc_6music_isml_bbc_6music-audio_3d96000_norewind_m3u8.webp
#HOMEPAGE:https://www.bbc.co.uk/sounds
#COUNTRY:United Kingdom
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___as-hls-ww-live_akamaized_net_pool_904_live_ww_bbc_radio_cymru_bbc_radio_cymru_isml_bbc_radio_cymru-audio_3d96000_norewind_m3u8.webp
#HOMEPAGE:https://www.bbc.co.uk/sounds/play/live:bbc_radio_cymru
#COUNTRY:Wales
#STATE:
#REGION:
#LANGUAGE:Welsh
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___as-hls-ww-live_akamaized_net_pool_904_live_ww_bbc_radio_five_live_bbc_radio_five_live_isml_bbc_radio_five_live-audio_3d96000_norewind_m3u8.webp
#HOMEPAGE:https://www.bbc.co.uk/programmes/b0070hx6
#COUNTRY:United Kingdom
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:The latest sport with coverage and debate, featuring commentaries on the big games and sporting events.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___as-hls-ww-live_akamaized_net_pool_904_live_ww_bbc_radio_four_extra_bbc_radio_four_extra_isml_bbc_radio_four_extra-audio_3d96000_norewind_m3u8.webp
#HOMEPAGE:https://www.bbc.co.uk/radio4extra
#COUNTRY:United Kingdom
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___as-hls-ww-live_akamaized_net_pool_904_live_ww_bbc_radio_fourfm_bbc_radio_fourfm_isml_bbc_radio_fourfm-audio_3d96000_norewind_m3u8.webp
#HOMEPAGE:https://www.bbc.co.uk/sounds
#COUNTRY:United Kingdom
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___as-hls-ww-live_akamaized_net_pool_904_live_ww_bbc_radio_one_bbc_radio_one_isml_bbc_radio_one-audio_3d96000_norewind_m3u8.webp
#HOMEPAGE:https://www.bbc.co.uk/sounds
#COUNTRY:United Kingdom
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___as-hls-ww-live_akamaized_net_pool_904_live_ww_bbc_radio_one_dance_bbc_radio_one_dance_isml_bbc_radio_one_dance-audio_3d96000_norewind_m3u8.webp
#HOMEPAGE:https://www.bbc.co.uk/radio1dance
#COUNTRY:United Kingdom
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:A mix of classic, current and future dance music.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___as-hls-ww-live_akamaized_net_pool_904_live_ww_bbc_radio_three_bbc_radio_three_isml_bbc_radio_three-audio_3d96000_norewind_m3u8.webp
#HOMEPAGE:https://www.bbc.co.uk/sounds
#COUNTRY:United Kingdom
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___as-hls-ww-live_akamaized_net_pool_904_live_ww_bbc_radio_two_bbc_radio_two_isml_bbc_radio_two-audio_3d96000_norewind_m3u8.webp
#HOMEPAGE:https://www.bbc.co.uk/sounds
#COUNTRY:United Kingdom
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#EXTIMG:http___audio1_ideastream_org_wclv_mp3.webp
#HOMEPAGE:
#COUNTRY:USA
#STATE:
#REGION:
#LANGUAGE:English
#DESCRIPTION:
Expand Down
Loading

0 comments on commit b872239

Please sign in to comment.