Last active
November 29, 2023 00:16
-
-
Save g3rhard/e8612e3f89906471ea361c5dd446287f to your computer and use it in GitHub Desktop.
Create playlist file or list streams for radiorecord.ru stations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#EXTM3U | |
#PLAYLIST:Playlist Name | |
#EXTINF:-1,1970 | |
http://air.radiorecord.ru:805/1970_64 | |
#EXTINF:-1,1980 | |
http://air.radiorecord.ru:805/1980_64 | |
#EXTINF:-1,2step | |
http://air.radiorecord.ru:805/2step_64 | |
#EXTINF:-1,ansh | |
http://air.radiorecord.ru:805/ansh_64 | |
#EXTINF:-1,bighits | |
http://air.radiorecord.ru:805/bighits_64 | |
#EXTINF:-1,brks | |
http://air.radiorecord.ru:805/brks_64 | |
#EXTINF:-1,cadillac | |
http://air.radiorecord.ru:805/cadillac_64 | |
#EXTINF:-1,chil | |
http://air.radiorecord.ru:805/chil_64 | |
#EXTINF:-1,chillhouse | |
http://air.radiorecord.ru:805/chillhouse_64 | |
#EXTINF:-1,club | |
http://air.radiorecord.ru:805/club_64 | |
#EXTINF:-1,complextro | |
http://air.radiorecord.ru:805/complextro_64 | |
#EXTINF:-1,darkside | |
http://air.radiorecord.ru:805/darkside_64 | |
#EXTINF:-1,dc | |
http://air.radiorecord.ru:805/dc_64 | |
#EXTINF:-1,deep | |
http://air.radiorecord.ru:805/deep_64 | |
#EXTINF:-1,discofunk | |
http://air.radiorecord.ru:805/discofunk_64 | |
#EXTINF:-1,dream | |
http://air.radiorecord.ru:805/dream_64 | |
#EXTINF:-1,drumhits | |
http://air.radiorecord.ru:805/drumhits_64 | |
#EXTINF:-1,dub | |
http://air.radiorecord.ru:805/dub_64 | |
#EXTINF:-1,edmhits | |
http://air.radiorecord.ru:805/edmhits_64 | |
#EXTINF:-1,elect | |
http://air.radiorecord.ru:805/elect_64 | |
#EXTINF:-1,eurodance | |
http://air.radiorecord.ru:805/eurodance_64 | |
#EXTINF:-1,fbass | |
http://air.radiorecord.ru:805/fbass_64 | |
#EXTINF:-1,fut | |
http://air.radiorecord.ru:805/fut_64 | |
#EXTINF:-1,gast | |
http://air.radiorecord.ru:805/gast_64 | |
#EXTINF:-1,goa | |
http://air.radiorecord.ru:805/goa_64 | |
#EXTINF:-1,gold | |
http://air.radiorecord.ru:805/gold_64 | |
#EXTINF:-1,gop | |
http://air.radiorecord.ru:805/gop_64 | |
#EXTINF:-1,groovetribal | |
http://air.radiorecord.ru:805/groovetribal_64 | |
#EXTINF:-1,hbass | |
http://air.radiorecord.ru:805/hbass_64 | |
#EXTINF:-1,houseclss | |
http://air.radiorecord.ru:805/houseclss_64 | |
#EXTINF:-1,househits | |
http://air.radiorecord.ru:805/househits_64 | |
#EXTINF:-1,hypno | |
http://air.radiorecord.ru:805/hypno_64 | |
#EXTINF:-1,ibiza | |
http://air.radiorecord.ru:805/ibiza_64 | |
#EXTINF:-1,jackin | |
http://air.radiorecord.ru:805/jackin_64 | |
#EXTINF:-1,jungle | |
http://air.radiorecord.ru:805/jungle_64 | |
#EXTINF:-1,liquidfunk | |
http://air.radiorecord.ru:805/liquidfunk_64 | |
#EXTINF:-1,mdl | |
http://air.radiorecord.ru:805/mdl_64 | |
#EXTINF:-1,mf | |
http://air.radiorecord.ru:805/mf_64 | |
#EXTINF:-1,mini | |
http://air.radiorecord.ru:805/mini_64 | |
#EXTINF:-1,mix | |
http://air.radiorecord.ru:805/mix_64 | |
#EXTINF:-1,mmbt | |
http://air.radiorecord.ru:805/mmbt_64 | |
#EXTINF:-1,more | |
http://air.radiorecord.ru:805/more_64 | |
#EXTINF:-1,mt | |
http://air.radiorecord.ru:805/mt_64 | |
#EXTINF:-1,mulka_first | |
http://air.radiorecord.ru:805/mulka_first_64 | |
#EXTINF:-1,naft | |
http://air.radiorecord.ru:805/naft_64 | |
#EXTINF:-1,neurofunk | |
http://air.radiorecord.ru:805/neurofunk_64 | |
#EXTINF:-1,progr | |
http://air.radiorecord.ru:805/progr_64 | |
#EXTINF:-1,ps | |
http://air.radiorecord.ru:805/ps_64 | |
#EXTINF:-1,pump | |
http://air.radiorecord.ru:805/pump_64 | |
#EXTINF:-1,rap | |
http://air.radiorecord.ru:805/rap_64 | |
#EXTINF:-1,rapclassics | |
http://air.radiorecord.ru:805/rapclassics_64 | |
#EXTINF:-1,rave | |
http://air.radiorecord.ru:805/rave_64 | |
#EXTINF:-1,rmx | |
http://air.radiorecord.ru:805/rmx_64 | |
#EXTINF:-1,rock | |
http://air.radiorecord.ru:805/rock_64 | |
#EXTINF:-1,rr | |
http://air.radiorecord.ru:805/rr_64 | |
#EXTINF:-1,rus | |
http://air.radiorecord.ru:805/rus_64 | |
#EXTINF:-1,russiangold | |
http://air.radiorecord.ru:805/russiangold_64 | |
#EXTINF:-1,russianhits | |
http://air.radiorecord.ru:805/russianhits_64 | |
#EXTINF:-1,sd90 | |
http://air.radiorecord.ru:805/sd90_64 | |
#EXTINF:-1,symph | |
http://air.radiorecord.ru:805/symph_64 | |
#EXTINF:-1,synth | |
http://air.radiorecord.ru:805/synth_64 | |
#EXTINF:-1,techno | |
http://air.radiorecord.ru:805/techno_64 | |
#EXTINF:-1,technopop | |
http://air.radiorecord.ru:805/technopop_64 | |
#EXTINF:-1,tecktonik | |
http://air.radiorecord.ru:805/tecktonik_64 | |
#EXTINF:-1,teo | |
http://air.radiorecord.ru:805/teo_64 | |
#EXTINF:-1,tm | |
http://air.radiorecord.ru:805/tm_64 | |
#EXTINF:-1,trancehits | |
http://air.radiorecord.ru:805/trancehits_64 | |
#EXTINF:-1,trancehouse | |
http://air.radiorecord.ru:805/trancehouse_64 | |
#EXTINF:-1,trap | |
http://air.radiorecord.ru:805/trap_64 | |
#EXTINF:-1,trop | |
http://air.radiorecord.ru:805/trop_64 | |
#EXTINF:-1,uplift | |
http://air.radiorecord.ru:805/uplift_64 | |
#EXTINF:-1,vip | |
http://air.radiorecord.ru:805/vip_64 | |
#EXTINF:-1,yo | |
http://air.radiorecord.ru:805/yo_64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script for parsing stations url from radiorecord.ru | |
# Requirements: xmllint, perl, wget, grep | |
stream_url="http://air.radiorecord.ru:805" | |
quality="320" | |
m3u="0" | |
temp_folder="/tmp" | |
date=`date +%Y%m%d` | |
requirements=(xmllint perl wget grep) | |
usage() | |
{ | |
cat << EOF | |
Script for parsing stations url from radiorecord.ru and create m3u file | |
Options: | |
-m3u Output playlist.m3u file | |
-h Output help | |
-q Quality: 64/320 | |
EOF | |
} | |
m3u() | |
{ | |
echo -e "#EXTM3U" | |
echo -e "#PLAYLIST:Playlist Name" | |
for station in ${stations[*]}; do | |
echo -e "#EXTINF:-1,$station" | |
echo -e "$stream_url"/"$station"_"$quality" | |
done | |
} | |
while : | |
do | |
case $1 in | |
-h) | |
usage | |
exit 0 | |
;; | |
-m3u) | |
m3u="1" | |
shift | |
;; | |
-q) | |
quality=$2 | |
shift 2 | |
;; | |
--) # End of all options | |
shift | |
break | |
;; | |
-*) | |
printf >&2 'Unknown option: %s\n' "$1" | |
shift | |
;; | |
*) | |
break | |
;; | |
esac | |
done | |
# Check requirements | |
for program in ${requirements[*]}; do | |
if ! [ -x "$(which $program)" ]; then | |
echo 'Error: $program is not installed.' >&2 | |
exit 1 | |
fi | |
done | |
if [[ $quality != "320" && $quality != "64" ]]; then | |
echo 'You must check quality parameters! Exiting...' >&2 | |
exit 1 | |
fi | |
stations=($(wget -q -O "$temp_folder"/"$date"_index.html http://radiorecord.ru && xmllint --html --xpath '//*[@id="radio-block"]/div/table' "$temp_folder"/"$date"_index.html --output html 2>/dev/null | grep "<td id=\"" | perl -lne 'print "$1" if /"([(\w|\d)]*)"/' | sort)) | |
rm "$temp_folder"/"$date"_index.html | |
if [ "$m3u" == "1" ]; then | |
m3u > playlist.m3u && echo -e "Playlist file created with $quality kbps!" | |
else | |
echo -e "List streams with $quality kbps:" | |
for station in ${stations[*]}; do | |
echo -e "$stream_url"/"$station"_"$quality" | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment