You are not logged in.
^ what, why?
The audtool command from post #1437 notifies of song changes, no?
So you only have to store the old song, and comapre that regularly to what the command spits out. When it's different, you start looking for a cover again.This quick script (requires curl and xmllint) will do it for the 50px version, not sure there's a bigger one?
#!/bin/sh exec 2>/dev/null url="https://www.radioswisspop.ch/en" echo "$url/$(curl "$url" | xmllint --nonet --html --xpath "string(//div[@class=\"current-airplay\"]//div[@class=\"time-cover-w\"]/img/@src)" -)"
That said, this works only for this one station. There's software that will fetch cover art based on the title/album. I have used glyrc with some success.
^the 50px would be enough for me for now
Larger ones also exist and are shown e.g. here.
so, how do I get this into my $HOME ?
I have no idea, but assume here the code must be supplemented
...]/img/@src)" -)"
Offline
so, how do I get this into my $HOME ?
It returns the URL to the image itself. Just curl/wget it to your $HOME
Offline
Working good A+ loutch......
Offline
unklar wrote:so, how do I get this into my $HOME ?
It returns the URL to the image itself. Just curl/wget it to your $HOME
uhm 8)
Offline
uhm 8)
Not sure what you mean.
Do you need more help?
The miniscript returns the URL to an image - of the current playing song on radioswisspop.
You can download that image with curl or wget.
Offline
Do you need more help?
^Please - gladly
How do you pass that to curl, because I can't see anything else about this
$ ./ohnonot_radio.sh
https://www.radioswisspop.ch/en/
Last edited by unklar (2021-02-24 10:10:46)
Offline
Do you have xmllint installed? It's part of the libxml2-utils package.
Offline
@unklar
#!/usr/bin/env bash
line_1=$(sed -n 1p temp)
curr_playing=$(audtool current-song-tuple-data title)
if [[ $line_1 != $curr_playing ]]; then
echo $curr_playing > temp
wget -q -O current_playing "https://www.radioswisspop.ch/en"
sed -i '/<div class="current-airplay">/,/<div class="vol-ctr hidden-md hidden-lg">/!d' current_playing
sed -i -e 's/^.*"titletag">//' -e 's/^.*"artist">//' -e 's/^.*src="//' current_playing
sed -i -e 's/<\/span>//g' -e 's/" \/>//g' -e '/<\|>/d' -e '/^ *$/d' current_playing
wget -q -O current_playing_thumb.jpg "https://www.radioswisspop.ch$(sed -n 1p current_playing)"
fi
Have it run every 30sec or something - maybe a cron job?
Last edited by TeoBigusGeekus (2021-02-25 23:31:17)
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Offline
Wonderful Teo!
In the beginning Conky does it without problems with these settings (I took the liberty to write this line into your script).
conky.text = [[
#${execi 3 sed -n '1p' $HOME/.conky/teoRadio/current_playing}
${execi 30 sed -n '2p' $HOME/.conky/teoRadio/current_playing}
${execi 30 sed -n '3p' $HOME/.conky/teoRadio/current_playing}
${texeci 30 $HOME/.conky/teoRadio/teo_radio.sh}${lua fDrawImage $HOME/.conky/teoRadio/teo.png 0 40 60 60 0}
convert -resize 60x60! ~/.conky/teoRadio/current_playing_thumb.jpg ~/.conky/teoRadio/teo.png
But Conky simply stops running the script after a certain time of "editing". The reason does not become apparent.
I have to switch on -DD, S11 would say.
Or, follow your advice with a cronjob.
So, first of all, thank you!
Offline
Do you have xmllint installed? It's part of the libxml2-utils package.
Sorry about that, I had relied on libxml2 as the default in BL and didn't check the -utils. :8
Now it looks correct.
https://www.radioswisspop.ch/en//wo/covers/c50x50/1376842-50x50.jpg
so i would enter
curl -o https://www.radioswisspop.ch/en//wo/covers/c50x50/1376842-50x50.jpg > image.jpg
but, can't I do that right now in your script
#!/bin/sh
exec 2>/dev/null
url="https://www.radioswisspop.ch/en"
echo "$url/$(curl "$url" | xmllint --nonet --html --xpath "string(//div[@class=\"current-airplay\"]//div[@class=\"time-cover-w\"]/img/@src)" -)"
curl -o https://www.radioswisspop.ch/en//wo/covers/c50x50/1376842-50x50.jpg > image.jpg
or should it read
curl -o -L https://www.radioswisspop.ch/en//wo/covers/c50x50/1376842-50x50.jpg > image.jpg
Last edited by unklar (2021-02-26 14:12:41)
Offline
Wonderful Teo!
![]()
{snip}
I have to switch on -DD, S11 would say.
Or, follow your advice with a cronjob.So, first of all, thank you!
I heard my name -- it was very distinct.
What did I to now.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
@Sector11
^^Your tips were always worth their weight in gold.
-DD spits out this
~$ conky -c ~/.conky/teoRadio/conkyrc10 -DD &
[1] 3972
~$ DEBUG(0) [/build/conky-H8e3VB/conky-1.10.6/src/conky.cc:2698]: reading contents from config file '/home/unklar/.conky/teoRadio/conkyrc10'
DEBUG(0) [/build/conky-H8e3VB/conky-1.10.6/src/x11.cc:497]: Fixed xinerama area to: 0 0 1920 1080
DEBUG(0) [/build/conky-H8e3VB/conky-1.10.6/src/x11.cc:497]: Fixed xinerama area to: 0 0 1920 1080
conky: desktop window (6b4) is root window
DEBUG(0) [/build/conky-H8e3VB/conky-1.10.6/src/x11.cc:634]: Found ARGB Visual
conky: window type - normal
conky: drawing to created window (0x3a00002)
conky: drawing to double buffer
DEBUG(1) [/build/conky-H8e3VB/conky-1.10.6/src/core.cc:1986]: no templates to replace
conky: forked to background, pid is 3973
no templates to replace
if I feed a search engine with it I get to sed
Teo, is it possible that this line also has the sed -e must contain ?
...
sed -i '/<div class="current-airplay">/,/<div class="vol-ctr hidden-md hidden-lg">/!d' current_playing
...
Last edited by unklar (2021-02-26 18:33:06)
Offline
AHA! The old double debug trick. Totally forgot about that
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
No, I don't think so. The -e option is needed when you're doing many things with one sed command, for example
sed -i -e 'something' -e 'something else' -e 'ever more' -e 'and more' -e 'etc.' /path/file/to/manipulate
Try the whole thing without the convert command.
Last edited by TeoBigusGeekus (2021-02-26 21:19:56)
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Offline
^ forget it
Slept on it one night and I also think it's not an extra -e in sed.
You are right.
Maybe temp should be deleted periodically so conky doesn't have a "template" anymore...
Offline
I have now moved to an "unencumbered" conky system (beryllium) and set everything up from scratch.
Teo, since more than 4 hours Conky is doing its job with your excellent script.
The cover image is usually changed after 10 seconds at the latest. Title and artist need about 30Sec. That's why I switched to temp, because this is done at least 2-5Sec. earlier.
I have this setting now:
...
-- lua_load = '~/LUA/image.lua',
--${lua fDrawImage $HOME/.conky/teoRadio/teo.png 0 40 60 60 0}
};
conky.text = [[
#${execi 3 sed -n '1p' $HOME/.conky/teoRadio/current_playing}
#${execi 30 sed -n '2p' $HOME/.conky/teoRadio/current_playing}
#${execi 30 sed -n '3p' $HOME/.conky/teoRadio/current_playing}
${execi 30 sed -n '1p' $HOME/temp | fold -s40}
${texeci 30 $HOME/.conky/teoRadio/teo_radio.sh}${image $HOME/current_playing_thumb.jpg -p 0,40 -s 50x50}
]];
You can still "tweak" it.
Yesterday I also had a serious error in my configuration myself.
The update time was only 0.1 sec. 8)
So, a cronjob I do not need to make according to the current state.
Teo, big thanks to you. You are the best! O:)
Offline
^So, I have now helped myself to my friend @loutch
So far this runs without problems that I can publish the configuration here:
-- pkill -xf "conky -c $HOME/path/to/conkyrc"
-- 2021-02-27 @unklar with the script from @TeoBigusGeekus
conky.config = {
background = false,--true,
use_xft = true,
font = 'Fira Mono:size=8',
xftalpha = 1,
double_buffer = true,
update_interval = 1,
total_run_times = 0,
no_buffers = true,
own_window = true,
own_window_type = 'desktop',--normal',
own_window_transparent = true,
-- own_window_color = '000000',
-- own_window_argb_visual = true,
-- own_window_argb_value = 180,
own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',--
own_window_class = 'Conky',
text_buffer_size = 2048,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
default_color = 'ffffff',
default_outline_color = 'ffffff',
minimum_width = 310, minimum_height = 88,
maximum_width = 310,
alignment = 'bottom_right',
gap_x = 10,--350,
gap_y = 60,
uppercase = false,
cpu_avg_samples = 2,
override_utf8_locale = true,
-- imlib_cache_flush_interval 60
imlib_cache_size = 0,
stippled_borders = 5,
default_color = 'ffffff',--ffd579
default_shade_color = '333333',
default_outline_color = '000000',
-- lua_load = '~/LUA/image.lua',
--${lua fDrawImage $HOME/.conky/teoRadio/teo.png 0 40 60 60 0}
};
conky.text = [[
${texeci 30 $HOME/.conky/teoRadio/teo_radio.sh}${image $HOME/.conky/teoRadio/images/case.png -p 0,0 -s 310x88}
${image $HOME/current_playing_thumb.jpg -p 18,12 -s 55x55}
#${goto 125}${execi 20 sed -n '1p' $HOME/temp | fold -s30}
#${execi 3 sed -n '1p' $HOME/current_playing}
${goto 125}${execi 30 sed -n '2p' $HOME/current_playing}
${goto 125}${execi 30 sed -n '3p' $HOME/current_playing}
]];
Thanks, Teo
Offline
Anytime buddy!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Offline
but, can't I do that right now in your script
#!/bin/sh exec 2>/dev/null url="https://www.radioswisspop.ch/en" curl -o image.jpg "$url/$(curl "$url" | xmllint --nonet --html --xpath "string(//div[@class=\"current-airplay\"]//div[@class=\"time-cover-w\"]/img/@src)" -)"
Fixed it for you.
Offline
^Thanks!
Offline