From 0df53b51f91f3bef8ee47a4796a1168c4e6ca640 Mon Sep 17 00:00:00 2001 From: "hossein s. borhani" Date: Mon, 3 Jul 2023 07:10:14 +0330 Subject: [PATCH] further remove bloat --- README.md | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index ee6074b5a..a2a20f493 100755 --- a/README.md +++ b/README.md @@ -187,68 +187,60 @@


How to listen to these?

in the terminal, do this:

-
hljs mpv https://raw.githubusercontent.com/junguler/m3u-radio-music-playlists/main/trance.m3u
+
mpv https://raw.githubusercontent.com/junguler/m3u-radio-music-playlists/main/trance.m3u
 

or add/change m3u file association in your os to mpv and double click on any of .m3u files in your file manager


how to download a live-stream to my computer?

-


- click me to read

-


downloading from these m3u files is not possible as far as i know since they contain multiple streams, but if you want to download from a particular stream you can achieve this by using ffmpeg, i use the most popular (first stream) in the trance.m3u to showcase this, in your terminal change directory to where you want this file to be at (note that lines starting with # are not actual streams and are there for embedding extra info to your media player)

-
hljs ffmpeg -y -i http://stream.dancewave.online:8080/dance.mp3 -c copy dancewave.mp3
+
ffmpeg -y -i http://stream.dancewave.online:8080/dance.mp3 -c copy dancewave.mp3
 

change the filename at the end to what you like, as ffmpeg suggests when you feel happy with the length/size of this file press q in your terminal emulator to finish the process and save the file

because these are online streams there is no way to download the whole thing as they are constantly changing, but you can set a hard limit to when recording stops using the timeout command on bash/zsh shells

-
hljs timeout 60 ffmpeg -y -i http://stream.dancewave.online:8080/dance.mp3 -c copy dancewave.mp3
+
timeout 60 ffmpeg -y -i http://stream.dancewave.online:8080/dance.mp3 -c copy dancewave.mp3
 

the above command saves about one minute of the audio live-stream, you can specify longer times using -m for minutes -h for hours and -d for days, these can also be used with decimals for more control, so one and half minute can be set with 1.5m or 3 hour and 45 minutes can be set with 3.75h

-
hljs timeout 1h ffmpeg -y -i http://stream.dancewave.online:8080/dance.mp3 -c copy dancewave.mp3
+
timeout 1h ffmpeg -y -i http://stream.dancewave.online:8080/dance.mp3 -c copy dancewave.mp3
 

another more elegant way to do this is to use ffmpeg to segment these files with your desired time and add a timestamp at the end as filenames, code was copied from here

-
hljs ffmpeg -i http://stream.dancewave.online:8080/dance.mp3 -c copy -f segment -strftime 1 -segment_time 60 %Y-%m-%d-%H-%M-%S.mp3
+
ffmpeg -i http://stream.dancewave.online:8080/dance.mp3 -c copy -f segment -strftime 1 -segment_time 60 %Y-%m-%d-%H-%M-%S.mp3
 

this will save a new mp3 file every minute, if you want to make this longer change -segment_time 60 and multiply the number of minutes you want for each file by 60, so if i want my mp3 files to each be 5 minutes i do -segment_time 300 this process goes on forever unless you run out of disk space or if you are not connected to the internet for some reason

this command can also be stopped using ctrl + c shortcut or the timeout command showcased above so adding timeout 1h in front of the above command stops the whole process after an hour

-


How to save songs indivudally by title from a live stream?

-


- click me to read

-


i have been looking for a way to do this for a while, i found this program streamwriter that does this but unfortunently it's only available on windows, this winehq page lists the program as platinum and it should work with wine without any issues but i have not tested it myself as i'm not on linux at the moment and don't have a virtual machine ready either

download the portable version of the program and extract it somewhere in your hard drive, the first time you open the program it's going to ask a few questions, things like language and where it's going to save downloaded songs, now that you are greeted with the program go to a m3u file of your favorite music genre and copy a stream link to start download, here is mine from the trance.m3u

-
hljs http://51.89.148.171:8022/stream/1/
+
http://51.89.148.171:8022/stream/1/
 

now put it inside the area i've shown and click to button next to it to start recording, after each song is completed it's going to create a new file and put a name on it from the title the stream is broadcasting

-

streamwriter

+

streamwriter

once you are happy with the amount of songs downloaded, right click on the stream and click on stop recording after current title

note that in some rare cases a stream does not broadcasts song titles and if you happen to come accross of these there is really nothing else you can and the program is going to continuously record the stream until you manually stop it

-


Mpv only shows a black window when listening to music, how to make it pretty?

download the visualizer script for mpv and put it in your scripts folder either on ~/.config/mpv/scripts on *nix systems

or C:\users\USERNAME\AppData\Roaming\mpv\scripts\ on windows

put these in your mpv.conf, this is a auto-profile for all audio files

-
hljs [audio-only]
+
[audio-only]
 profile-cond=not vid
 profile-restore=copy
-vf-add=rgbashift=rh=-4:bv=+4
-vf-add=drawbox=w=iw:h=ih:color=00FFFF@0.5
-vf-add=drawbox=x=3:y=3:w=iw-6:h=ih-6:color=00FF00@0.5
-vf-add=drawbox=x=6:y=6:w=iw-12:h=ih-12:color=FFFF00@0.5
-vf-add=hue=H=0.1*PI*t
+vf-add=rgbashift=rh=-4:bv=+4
+vf-add=drawbox=w=iw:h=ih:color=00FFFF@0.5
+vf-add=drawbox=x=3:y=3:w=iw-6:h=ih-6:color=00FF00@0.5
+vf-add=drawbox=x=6:y=6:w=iw-12:h=ih-12:color=FFFF00@0.5
+vf-add=hue=H=0.1*PI*t
 


Normilize Audio

depending on the stream some music might be too load and others too quiet, thankfully we can use an ffmpeg filter inside mpv to fix the issue and force all music to be played at the same level, put this line inside your mpv.conf and it will automatically normalize all audio

-
hljs af=lavfi=[dynaudnorm=f=75:g=25:p=0.55]
+
af=lavfi=[dynaudnorm=f=75:g=25:p=0.55]
 


I really like mpv, how do i customize keybinds?

make a file called input.conf either at the folder your mpv.exe is on windows or on ~/.config/mpv/ if you are *nix systems, put these inside it for using page-up and page-down for changing radio stations

-
hljs PGUP playlist-prev ; show-text "${playlist-pos-1}/${playlist-count}"
-PGDWN playlist-next ; show-text "${playlist-pos-1}/${playlist-count}"
+
PGUP playlist-prev ; show-text "${playlist-pos-1}/${playlist-count}"
+PGDWN playlist-next ; show-text "${playlist-pos-1}/${playlist-count}"
 


Isn't there an easier way to use and control these using mpv?

@@ -257,7 +249,7 @@ PGDWN playlist-next ; show-text How to download all of the files?

use the auto-generated zip

you can also run a git clone on this repo

-
hljs git clone https://github.com/junguler/m3u-radio-music-playlists.git
+
git clone https://github.com/junguler/m3u-radio-music-playlists.git
 

for further updates cd into the folder and do git pull