I believe this happens due to the player used, station selected and network connectivity (or a combination of them)…
I have tried to detect such a condition, but failed…
The only thing I can detect is player termination; sometimes the player just terminates when something happend to the stream… but not always…
I don’t think that helps you though
No, nobody implied anything like that!
I will add the corresponding instruction there, just in case other people fail to realise it, just like you
About the feature to obtain the infos about the music stream, I had an idea aside from mindlessly spaming the log file. I don’t know if it’s feasable, but here is my feature request :
Current behaviour:
At the moment the information about the music stream (music title / name of show or feature) appears in the bottom left corner of the Pyradio window if provided by the radio station’s stream service.
It’s not possible to highlight or copy the text. User has to make notes manually (quite distracting).
The information is not logged and subsequently only obtainable (if lucky) from the website of the radio station (more cumbersome for the user)
Desired behaviour
Add a function to pipe the music info of a single, currently playing track to a “favourites”- or “liked”-list with timestamp and radio station.
perhaps add a keybind / “like-button” to invoke this functionality with a single stroke and to show/edit the list in Pyradio or an external editor.
The list could be stored in the pyradio configs directory.
Alternatively / additionally there could be an automatically generated list of the last heard songs / programs with a limited amount of entries (to not let it grow exorbitantly) to track back one’s own activity.
It would be really cool if that’d be possible since somewhere in the code this info is already extracted to be displayed in Pyradio, so my idea was that it wouldn’t be to hard to do this on command manually and pipe the info to a chosen destination.
Hope that request was not too audacious. If you like I could put it in your ‘Issues’ directory on Github instead. Please keep up the amazing work!
Oh man, I sat the whole night writing a little bash script for logging manually for me for the time waiting and finally I got it working. Lot of new stuff I had to wrap my head around. Didn’t reckon that you would be so fast . However it was a nice exercise for me as a newbie. Perhaps someone has a use for it, since it’s pretty versatile to take quick notes and has some nice functionallity, like display of the last three entries in declining order and the ability to delete the last entry from the logfile. It doesn’t scroll down thanks to ‘tput’ prompt-manipulation (I not nearly understand all the features of it yet, but it’s quite fun to fiddle around with it.)
Pro tip: Use with Lolcat! ( scriptname.sh | lolcat )
I look forward to try your new version as soon as possible. Thanks for beeing so approachable for suggestions!
#!/bin/bash
# # # # # # # # # # # # # # # # # # # # # # # # # #
# · · · · · · · · · · · · · · · · · · · · · · · · #
# · · Manual logging-script for PyRadio:· · · · · #
# · ·¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ · · `ovo´· #
# · · · · · · · · · · · · · · · · · · · · /(_)\· #
# · · · · · · · · · · · · · · · · · · · · … … · #
# # Faehnchen Apr. 15, 2022 # # # # # # # # # # # #
# A little script to take notes with a time stamp in the terminal
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
# Currently there is no feature in PyRadio to pipe information of a music stream like song/
#+ band/programm into a logfile or even copy text from the application. So I wrote this little
#+ script to help me at least a little bit with that for the while. Just execute alongside PyRa-
#+ dio or any other activity you think you might need notes with a timestamp from.
# Also, change it to your liking and use it to log when you saw a particularly beautiful
#+ bird or you have to remember at which hour your annoying neighbor heard loud music!
# Have fun and special thanks again to Spiros Georgaras, the creator and maintainer of
#+ PyRadio!
# Change these variables to use script universally
FILEPATH="$HOME/.config/pyradio/pyradio_favourites.list"
TEMPFILE="$HOME/.config/pyradio/pyr_fav.tmp"
ls "$FILEPATH"
favlist=$?
clear
sleep 0.5
# Automatc creation when executing for the first time or logfile was renamed
if [ $favlist -ne 0 ]; then
echo -e "\n\033[0m No default list-file detected."
echo -e "\n Resume and create a new PyRadio-favourites-list"
echo -e " in: ~/.config/pyradio/pyradio-favourites.list ? \n"
echo -n " ›r‹ resume | ›ANY KEY‹ quit > "
read resume
if [[ $resume != [r] ]]; then
exit 0
fi
clear
echo -e "\n Done! Start $NAME . . ."
touch "$FILEPATH"
sleep 2
fi
touch "$TEMPFILE"
clear
echo -e "\n Which radio station are you currently listening to? \n "
echo -n " ›ENTER‹ to skip > "
read station
# Prompt for input (don't use 'Tab'-key and a too small window! It scrambles the output pretty much.)
clear
echo -e "\033[0m ›ENTER‹ add to list | ›x‹ delete last entry | ›q‹ quit"
echo -e "\033[1;32m Your - note ↑ ↑ ↑ \033[0m "
echo -e "\033[1;32m ¯¯¯¯¯¯¯¯¯¯¯ \033[0m "
count=1
while [[ $count > 0 ]]; do
echo -n " > "
read note
tput el
tput cuu 1
tput el
case $note in
x) # Delete function
head -n -1 "$FILEPATH" > "$TEMPFILE"
cat "$TEMPFILE" > "$FILEPATH"
sleep 0.3
tput cud 1
tput el
echo " deleted '$note1'."
tput cuu 2
tput sc
;;
q) # Quit from the script
sleep 0.3
echo -e " Your entries added to > \n ~/.config/pyradio/pyradio/pyradio-favourites.list"
printf "%-s (%10s) \n" "=======QUIT=======" "$station" >> "$FILEPATH"
tput cud 4
rm "$TEMPFILE"
wait; exit 0
;;
*)
dtime=`date +"%Y-%m-%d %H:%M"`
printf "[%-16s] %2d) %-s\n" "$dtime" $count "$note" >> "$FILEPATH"
#---Show last three entries in declining order---------------
note3="$note2"
count3=$count2
tput cud 5
tput el
printf "\r\033[36m %3d. %-s \033[0m\n " $count2 "$note2"
tput cuu 6
#---------------------------------------------------------3---
note2="$note1"
count2=$count1
tput cud 4
tput el
printf "\r\033[36m %3d. %-s \033[0m\n " $count1 "$note1"
tput cuu 5
#---------------------------------------------------------2---
note1="$note"
count1=$count
tput cud 3
tput el
printf "\r\033[36m %3d. %-s \033[0m\n " $count "$note"
tput cuu 4
#---------------------------------------------------------1---
;;
esac
count=$(( $count+1 ))
sleep 0.3
done
exit 1
Apr 16 (Sat) 21:32 | >>> Station: Lounge (Illinois Street Lounge - SomaFM)
Apr 16 (Sat) 21:32 | Maurice Montez - That Old Black Magic
Apr 16 (Sat) 21:33 | George Melachrino - Sand In My Shoes
Apr 16 (Sat) 21:36 | Stanley Black - Babalu
Apr 16 (Sat) 21:39 | Martin Denny - The Carioca
Apr 16 (Sat) 21:42 | Jack Costanzo - La Cumparsa, Harlem Nocturne
Apr 16 (Sat) 21:42 | I like this song and will look it up!!!
Apr 16 (Sat) 21:48 | Arthur Lyman - Bwana A
Apr 16 (Sat) 21:52 | 11 Acorn Lane - The Sneak
Apr 16 (Sat) 21:55 | Joe Loco - Nightmare
New feature looks cool! I think I will go test it tomorrow. Regarding the sample you showed I had a suggestion: For the “like”, don’t put it in a new line but make another column right next to the listed songs with a string or symbol indicating you liked this particular song on the same line, something like this:
Apr 16 (Sat) 21:36 | Stanley Black - Babalu | ***LIKED***
That would it make it easier to extract these lines with ‘grep’ and ‘awk/sed’ later to create a list of liked songs.
Would that be possible?
Ok, tested. Installation was easy. Thanks for your instructions!
Logging works fine! With ‘python -lt’ logging is forcefully enabled. When running ‘pyradio’ without the option, switching logging-mode with ‘W’ also works flawlessly and grabs the currently playing title imediatly. Liking with ‘w’ also no problem. The only thing are the doublings in the logfile. Is that only on my system? They are no big problem. I simply cut them out with the ‘uniq’ command, but it would mean that the rollover of the logfile would happen in half the time, no?
Found the reason for the doublings in the log. Apparently when starting with the ‘-lt’ option, manual logging is also enabled. Disabling with ‘W’ the logging continues normally.
Good morning!
Yes I think we should log titles while muted. For real pausing (and halting the log) I can press the space-key. That interrupts the mpv-player stream altogether. By pressing space again, mpv sets back in and logging also resumes (though I don’t know if vlc and mplayer behave the same in the terminal).
So I think it’s good when logging continues while muted to, for example, beeing able to check what one has missed while beeing on the telephone or something like that.
Just wrote a little bash script to easily extract your ‘LIKES’ from the pyradio-titles.log and store them in a seperated list. Also with added search-links! Check it out!