milaq / YCast

Self hosted vTuner internet radio service emulation
Other
240 stars 93 forks source link

manipulate stations.yml with web-service and som extentions on landing page #117

Open ThHanika opened 2 years ago

ThHanika commented 2 years ago

I hop it helps, here the website

YCast webpage

Essoloani commented 2 years ago

Despite all the work you have provided I am still at the same stage. The filter.yml and resently.yml files are not created. I think problem related to my version of linux on pi.

pi@raspberrypi:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)"

ThHanika commented 2 years ago

Show me your logs.... it seems an access-problem

Essoloani commented 2 years ago

service.log

Essoloani commented 2 years ago

ycast.log

ThHanika commented 2 years ago

ycast.log

2022-02-11 18:41:20 INFO: **YCast (1.1.0)** server starting

??? please take the new version.. it must start with:

2022-02-11 08:12:32 INFO: YCast (1.2.4) server starting
2022-02-11 08:12:32 INFO: Initialize base directory /.ycast
2022-02-11 08:12:32 INFO:    try Work-Dir: /home/ycast/.ycast
2022-02-11 08:12:32 INFO: using var directory: /home/ycast/.ycast
2022-02-11 08:12:32 INFO: Initialize Limits and Filters

and it seems, that your icon-cache is also not working..

Essoloani commented 2 years ago

I deleted the log files. I did a fresh install. I restarted pi. No log file created.

Essoloani commented 2 years ago

1 [Unit] 2 Description=YCast service 3 After=network.target 4 5 [Service] 6 Type=simple 7 WorkingDirectory=/var/www/ycast 8 9 # StandardOutput=file:/var/www/ycast/service.log 10 # StandardError=file:/var/www/ycast/ycast.log 11 12 StandardOutput=syslog 13 StandardError=syslog 14 SyslogIdentifier=ycast 15 16 Restart=always 17 RestartSec=130 18 ExecStart=/usr/bin/python3 -m ycast -c /var/www/ycast/stations.yml -d 19 20 [Install] 21 WantedBy=multi-user.target 22

ThHanika commented 2 years ago

your logs are switched to system-logs!!! :-D

hard coded files are commented out. It was not necessary to change your ycast.system file

for easier debugging take your old service.file and ... it is not usable to restart your rasp. use this command:

sudo systemctl restart ycast.service sudo systemctl status ycast.service

BTW: to scan your syslog: sudo journalctl | grep ycast

Essoloani commented 2 years ago

ycastlog.txt

ThHanika commented 2 years ago

Aaahh, it seems, you have a shadow installation of ycast. commands to fix: pip uninstall ycast and sudo pip uninstall ycast

check it with sudo pip list and pip list

and reinstall

~$ pip list | grep ycast
ycast                        1.2.4            

BTW: for root user, you have to install ycast with sudo: sudo pip install ...

Essoloani commented 2 years ago

Aaahh, it seems, you have a shadow installation of ycast. commands to fix: pip uninstall ycast and sudo pip uninstall ycast

You are right! I uninstalled both versions by running twice:

pip uninstall ycast

Essoloani commented 2 years ago

Successfully installed ycast-1.2.4 pi@raspberrypi:~ $ pip list | grep ycast ycast 1.2.4

Essoloani commented 2 years ago

ycastlog2.txt

ThHanika commented 2 years ago

what says:

sudo pip list | grep ycast

??? I see ycast 1.1.0 or logs now in files?

Essoloani commented 2 years ago

It's a mystery.

pi@raspberrypi:~ $ sudo pip list | grep ycast
ycast              1.2.4
ThHanika commented 2 years ago

do you use docker?

Essoloani commented 2 years ago

pi@raspberrypi:~ $ sudo systemctl restart ycast.service pi@raspberrypi:~ $ sudo systemctl status ycast.service

● ycast.service - YCast service
   Loaded: loaded (/etc/systemd/system/ycast.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2022-02-12 16:28:31 CET; 1min 7s ago
 Main PID: 5472 (python3)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/ycast.service
           └─5472 /usr/bin/python3 -m ycast -c /var/www/ycast/stations.yml -d

févr. 12 16:28:32 raspberrypi ycast[5472]: 2022-02-12 16:28:32 INFO: Initialize Limits and Filters
févr. 12 16:28:32 raspberrypi ycast[5472]: 2022-02-12 16:28:32 WARNING: YAML file '/var/www/ycast/.ycast/filter.yml' not found
févr. 12 16:28:32 raspberrypi ycast[5472]:  * Serving Flask app 'ycast.server' (lazy loading)
févr. 12 16:28:32 raspberrypi ycast[5472]:  * Environment: production
févr. 12 16:28:32 raspberrypi ycast[5472]:    WARNING: This is a development server. Do not use it in a production deployment.
févr. 12 16:28:32 raspberrypi ycast[5472]:    Use a production WSGI server instead.
févr. 12 16:28:32 raspberrypi ycast[5472]:  * Debug mode: off
févr. 12 16:28:32 raspberrypi ycast[5472]: 2022-02-12 16:28:32 WARNING:  * Running on all addresses.
févr. 12 16:28:32 raspberrypi ycast[5472]:    WARNING: This is a development server. Do not use it in a production deployment.
févr. 12 16:28:32 raspberrypi ycast[5472]: 2022-02-12 16:28:32 INFO:  * Running on http://192.168.1.24:80/ (Press CTRL+C to quit)
Essoloani commented 2 years ago

do you use docker?

No, I do not think so.

ThHanika commented 2 years ago

show: ls /var/www/ycast/.ycast/

Essoloani commented 2 years ago

This is a nice development!

pi@raspberrypi:~ $ ls /var/www/ycast/.ycast/ filter.yml

ThHanika commented 2 years ago

if you hear your radio-station, you will find "recently.yml" in this direcctory. And get some stations on your start-page

Essoloani commented 2 years ago

After going through RadioBrowser

pi@raspberrypi:~ $ ls /var/www/ycast/.ycast/
cache  filter.yml  recently.yml
ThHanika commented 2 years ago

And you see the icon-cache is working now

Essoloani commented 2 years ago

if you hear your radio-station, you will find "recently.yml" in this direcctory. And get some stations on your start-page

That's great! Everything is working. Thank you very much for your work and your patience.

Essoloani commented 2 years ago

recently.yml: i have a feeling that this file does not support all UFT-8 characters.

ThHanika commented 2 years ago

I make no conversions. I save it as it is. Where is your problem? Display on your Yamaha-device?

Essoloani commented 2 years ago

I make no conversions. I save it as it is. Where is your problem? Display on your Yamaha-device?

"Ch\xE9rie Fm": http://185.52.127.168/fr/30201/mp3_128.mp3?access_token=d5a25a36a4064489a376ff5595be1133|https://isabellecham.com/wp-content/uploads/2018/08/logo-cherie-fm-france_2017_Edilivre.png|5

Must be "Chérie Fm"

FYI: My AVR is Denon Ceol N9

Essoloani commented 2 years ago

Should .vtuner.com be redirected to make the web service work?

ThHanika commented 2 years ago

Should .vtuner.com be redirected to make the web service work? It is not necessary in your case...

ThHanika commented 2 years ago

Must be "Chérie Fm"

OK, I know more now..., the yaml- specification (recently.yml and station.yml) have restricted using of character-codes, python escape invalid characters in UTF8 code sequences. https://yaml.org/spec/1.2.2/#311-dump

Essoloani commented 2 years ago

Should .vtuner.com be redirected to make the web service work? It is not necessary in your case...

On pi www.vtuner.com opens the Vtuner site. I probably didn't understand how to make the web service work. Besides, I'm currently using a PHP editor to edit my favorites.

ThHanika commented 2 years ago

only ip-adress of your raspbery?

Essoloani commented 2 years ago

only ip-adress of your raspbery?

It's better with the IP. :-D

Essoloani commented 2 years ago

Only the first category of my favorites is displayed and the others are deleted by adding a station. And again the UFT-8 problem, all the existing accented characters are modified.

ThHanika commented 2 years ago

I hope you have a backup, and... the web is still evolving. Ahh, I see you didn't select a category in the bookmark header... then 'others' will automatically be set as the bookmark category! In this case, all other bookmark items with a different category are hidden, but not deleted. If you clear the Category field, all bookmarks will reappear. (I was thinking about how it is possible to be able to specify arbitrary names for further categories. Of course, this may be a bit confusing)

ThHanika commented 2 years ago

And again the UFT-8 problem, all the existing accented characters are modified.

Even if I repeat myself, the é is not a legal character in a *.yaml file. It is encoded. The stations.yml is just a location. I tried it: The character is displayed correctly on the AVR amplifier.

BTW: If you modified the stations.yml and set the é in the stations.yml file, it es possible, the python cannot decode it. (OffTopic: "Chérie Fm" is a nice station... :+1:

Essoloani commented 2 years ago

The two attached files show the modifications of stations.yml after using the web service. Listes de stations.txt Listes de stations2.txt .

ThHanika commented 2 years ago

Aaah thank you for the file, there is a bug with empty favicon-link. It stops on error-exception. Fix in process on the website

Essoloani commented 2 years ago

Perfect for me!

mnowok commented 1 year ago

Could you create a Docker image with your fork? I use ycast docker on Qnap with success, but it looks like your commits would not be merged into original project anytime...

ThHanika commented 1 year ago

Sorry, I have no knowhow about docker.

mnowok commented 1 year ago

Me too ☹️ Maybe I'll ask some ycast docker maintainer to do it. There are at least a few Dockers with ycast so i think it is just a matter of changing ycast repository in docker configuration.

Essoloani commented 1 year ago

The filter.yml file is not automatically created in my working directory, is this normal? I only have the file /var/www/ycast/.ycast/recently.yml

ThHanika commented 1 year ago

This is normal. a default Dictionary is created in memory, and up to now, there is nothing to save. But there is an newcommer, fit in nextcloud developement. He makes global filters editable by web-frontend (working in prozess)

ThHanika commented 1 year ago

Could you create a Docker image with your fork? I use ycast docker on Qnap with success, but it looks like your commits would not be merged into original project anytime...

@ThHanika/YCast is now a docker-file made