milaq / ycast Goto Github PK
View Code? Open in Web Editor NEWSelf hosted vTuner internet radio service emulation
License: Other
Self hosted vTuner internet radio service emulation
License: Other
Hi milaq,
For your information, I would like to modify my stations.yml file from another machine without stopping the daemon. To do so I've simply added:
"my_stations.set_config(None)"
in "landing" function.
So I can edit the file from a desktop computer, let YCast running on another (server) computer, and on the HTR simply going to the top menu, the file is reloaded.
My plan also is to include automatically some podcasts from RSS feeds, and to write them in my stations.yml file.
I've already tested that podcasts I usually download work properly as stations in the .yml file (so, without the need to download them on a server, and without the need of a DLNA player application => this is really better than what I had with vTuner).
What I would like is to automate completely the process.
Do you think it could be an interesting feature to add ? (station.yml or another config file would contain RSS links and automatically include them in the menu)
Thanks,
Alfred.
Some may find the deployment cumbersome. Create a nice docker image for those.
Hello,
I'm trying Ycast with my HTR-4067. It doesn't work as is, I needed to change the code, but it still doesn't work.
I'm using Wireshark to understand the protocol and to fix some differences I've noticed when my HTR connects to vtuner.
In first I needed to remove the xml header to the initial response (the one with "EncryptedToken"), otherwise it doesn't work at all.
Then I needed to add DirCount xml tag to the folder items, otherwise I got [NO CONTENT] when selecting a folder on the HTR.
Then I got some 404 error in YCast logs, because of the following request:
/ycast/Jazz&mac=b7a831738b8bf520d624e495fe8d6e04&dlang=fre&fver=W
(Jazz is the folder name).
I don't know if this is correct but I modified
category = url_to_text(self.path[len(YCAST_LOCATION) + 2:].partition('?')[0])
into
category = url_to_text(self.path[len(YCAST_LOCATION) + 2:].partition('&')[0])
so the folder content is properly sent and I've no longer 404 errors.
With these changes, I now get the folder and station names properly (based on yml file), but when I select a station I get "Access Error". I'm not sure if this is the same issue as the other one reported (that's why I preferred to open a new issue with my particular device).
I've tried several format for the URL radio, including the example ones and the current vtuner one (http://radioyamaha.vtuner.com/setupapp/yamaha/asp/func/dynamOD.asp?id=999999&ex45v=xxxxxx which works properly in a browser), also tried with IP address to avoid DNS resolution, but every time I get Access Error.
When I look with Wireshark there is nothing sent by the HTR when I select the radio, so probably it is something in the format of the station that is wrong.
I've also tried to add some missing tags in the station (StationID, StationDesc, StationFormat...) since I see them when analyzing the vtuner case, but no change.
I've all the Wireshark captures (with my Ycast server and with vtuner server but with no registration) if required.
Since I didn't register to the new vtuner system, I don't have a real capture with my real favorite folder.
Any help is welcome.
Thanks,
Fred.
I was thinking of doing exactly the same thing you have done for myself (MITM the vtuner connection and build a replacement) but you have done that for me.
Just a thank you from someone who is sick from waiting 2 minutes till vtuner decides to load stations.
I use Denon DRA-100. I see "Radiobrowser" on the hardware, but it's empty. "My Stations" - empty. "Recently played" - works, "Search by Keyword" - works.
I used the default stations.yml file and a slightly modified one. No errors reported in the command line.
Hello @milaq
Thank you for quite interesting vtuner alternative, I am trying to use YCast with Marantz Consolette and found that new stations added to radio-browser.info are not showing up on the device, do you think it might be linked with fact that YCast is using old API http://www.radio-browser.info/webservice/json/
and radio-browser introduced new API?
Do you have any plans to update YCast and change it to new API https://api.radio-browser.info/
The api endpoints at www.radio-browser.info/webservice will be taken down at August 1. of 2020.
Thank you for your work.
Briefly tested: can play radio stations from the list and the station image is correctly displayed in the app. So I guess everything works properly ๐ Thank you!
YCast in Docker container:
FROM python:3-alpine
RUN apk update && apk add build-base zlib-dev jpeg-dev
RUN pip install ycast
ENTRYPOINT [ "python", "-m", "ycast" ]
$ sudo docker run --rm -it -p 80:80 ycast -d
Local DNS server (configured in router so AV receiver gets it via DHCP):
$ sudo docker run --rm -it -p 53:53/tcp -p 53:53/udp -e WILDCARD_DNS='vtuner.com=192.168.XXX.XXX' -e DNS_FORWARDER=1.1.1.1 -e ALLOW_RECURSION='192.168.XXX.0/24,127.0.0.1' cytopia/bind
I was wondering how feasible, it would be to modify Ycast script to access http://radio-browser.info database, either locally (having nginx running it) or directly through the original internet website, for browsing radio stations by similar features/categories as those being fazed out from Yamaha AVRs (and I guess other AVRs as well) vTuner service?
Sincerely,
Z-N
Add a menu entry to the main menu where the user can see which stations were played recently.
We need to either proxy the listen urls or find an elegant way to track listening behaviour without proxying.
Hi Micha,
Can you take at following file, pls
Vito
yamaha_start.txt
I have been trying to add station JPEG files to the YCast server and so far nothing appears to work. I am brand new to Flask and while I have some ideas from viewing the YCast code, I don't have direct experience with Flask.
I did insert a logging.error()
line into station_icons.py
in the get_icons()
method to display both the cache_path
and the station_icon_file
, but there is nothing in the log.
This is leaving me to believe that icon file functionality has not yet been coded into YCast.
Could you confirm if icon file functionality works, please?
Using PiHole on Raspbian on a Raspberry Pi 4, I have this working well, with browsing and searching and 'Last Played' all functional.
However, I have erratic success with stations.yml. I wonder if certain kinds of URL are OK and some not; or are international stations problematic? I haven't been able to pick out the precise issue. On the Onkyo (which is older) 'My Stations' simply does not appear; on the Marantz it says 'My Stations feature is not configured'. I have two Onkyo Receivers, and 2 of the Marantz, and they are always in sync about this. I have had it working on both, but the stations.yml was at an earlier stage then. My guess is that it is a formatting issue of some sort, as I don't get any errors as such. Do they have to be 'VTuner approved' URLs - I got a hint of that in someone's post elsewhere?
In my attempts to get ycast running, I ran into a small isse:
I solved this by adding the IP-address to the server_name in my NGINX ycast.conf:
server_name *.vtuner.com 192.168.150.39;
Hi to All Interested:
In previous posts I was frequently receiving, and thus mentioning "ACCESS ERROR" on my Yamaha RX-V773.
And problems with non-ASCII extended characters in folders and station names.
Turns out it is/was related to python version and flask version running on the ycast running system.
The ycast project mentions: >>>Dependencies: Python version: 3<<<
However, my system was running by default python 2.7, which has problems with UTF-8 character-set, which was mitigated in python3.
And thus by default system also installed flask based on python 2.7.
This situation was causing constant "ACCESS ERROR(s)", when trying to browse folders or stations containing UTF-8 charset.
I finally managed to correct these issues (errors), by installing flask running on python3.
For those not sure "what and how to", this is how you might try to mitigate/remedy some of the "ACCESS ERROR(s)".
Check your python version:
cmd: (Uppercase=Capital "V")
:~$ python -V
Python 2.7.15+
:~$ python3 -V
Python 3.6.8
to install python3 flask on Ubuntu (my 18.04LTS) do:
:~$ sudo apt install python3-pip
(this one below without sudo, according to docs from internet)
:~$ pip3 install Flask
and finally from ycast folder run:
:~$ python3 -m ycast -c stations.yml -p 8010
or something similar depending what ver of ycast you are running (I am currently using dev branch for radiobrowser as well).
I Hope this might help and clarify some errors you might encounter.
This is probably not a solution for tuner authentication and mac errors or DNS errors; this is only pertaining with stations lists.
Z-N
Great software, thanks for building this.
FYI network setup:
denon.vtuner.com
Works without issue.
Thanks! :)
For custom self-hosted Radiobrowser deployments
I have switched to the dev branch, but this is not working probably with the RX-A830. It will only display the first 10 records. I think paging was introduced in later products only.
Would it be possible to en/disable the paging functionality?
Hello,
Not an issue but a suggestion.
When I'm connected to vTuner Radio Guide I can find the URL of a station, for example :
https://yradio.vtuner.com/setupapp/yamaha/asp/func/dynampls.asp?link=1&id=21301
==> please note the ID 21301
URL redirect to :
https://yradio.vtuner.com/pls/pls21301.m3u
==> ID 21301 here again
I try yo use the first URL or the second (redirected) in stations.yml but Ycast can't read the stream. Do you think it's possible to support this ? It would be easy to import bookmarked webradios of vTuner service. Or tell me if it's possible to use a radio-browser.info stream URL in stations.yml ? There is a lot of entry and scroll is not easy to find a radio with yamaha remote.
Thank you
Hi Micha,
UPDATE_as of Aug-18th-2019 9:50 AM CEDT(-Central European Daylight Saving Time)
This is my progress report to let you know regarding your project.
I have tested: Latest commit ed6baa6 from 10 hours ago.
Test unit: Yamaha RX-V773
So far everything is working as it should.
I wanted to attach 2 modified files for your review:
I have modified radiobrowser.py to point to my local nginx server instead of radio-browser.info site.
I have also added language section for radiobrowser stations.
Thus radiobrowser.py and server.py have slight modifications and additions, which I am attaching as zipped, for your review and consideration
radiobrowser.zip
server.zip
Otherwise the ycast project is excelling.
Fantastic job!
I hope quite a few people will benefit from this.
Also, segler-alex of radio-browser.info has mentioned ycast project on his web pages.
Thanks.
Sincerely,
Z-N
I started looking at ycast this week, it is great.
I am using ycast with nginx on a virtual machine.
While trying to get it to work I noticed some errors in the NGINX error log related to IPv6 localhost connection.
As ycast only seems to support ipv4 I changed the nginx config file and replaced the localhost in the proxy_pass to
proxy_pass http://127.0.0.1:8010;
This avoids the (harmless) IPv6 attempts. It may be appropriate to change the sample configuration?
Some stations only hand out playlist links, not direct links to the stream (e.g. pls
or m3u
).
We could use a way to handle that.
Hello and thank you for developing ycast :)
When I start ycast with debug option :
ExecStart=/usr/bin/python3 -m ycast -l 192.168.0.14 -p 8010 -c /home/pi/ycast/stations.yml -d
Debug seems to stay off :
systemd[1]: Started YCast internet radio service.
python3[13623]: 2020-02-10 00:11:52 INFO: YCast (1.0.0) server starting
python3[13623]: * Serving Flask app "ycast.server" (lazy loading)
python3[13623]: * Environment: production
python3[13623]: WARNING: This is a development server. Do not use it in a production deployment.
python3[13623]: Use a production WSGI server instead.
python3[13623]: * Debug mode: off # <<< HERE, WHY OFF ?
But debug is working in terminal. Maybe just a display issue ? or maybe just flask debug mode and not associated with ycast ?
As a Python noob and yamaha receiver owner, i try to understand your ycast server.
I am missing the file ycast.py
Am i doing something wrong?
Zofman
Your project helped my a lot! It works with a Marantz NR1605.
Hi
I would like to contribute with the test I did with my RX-A1040
unfortunately, this is not working.
here is the setup
DNS radioyamaha.vtuner.com => nginx server (runing on a NAS synology)
DNS conf:
server {
listen 80;
server_name *.vtuner.com
192.168.2.110:80
""
;
access_log /var/log/nginx/ycast_access.log;
error_log /var/log/nginx/ycast_error.log;
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:8181;
}
}
The reason why I've put my RFC1918 IP add 192.168.2.110 is because I've discovered my RX-A1040 set the Host field with the IP address and not the FQDN...
I'm using the release package 0.9.8 of ycast with python3
I've finally managed to get "access error" (previously I've obtained "please wait" and nothing shown in the Ycast consol)
Here are 2 pcap: one is the trace of the RX-A1040 taking with the official server on internet
the second one is the trace with ycast
cheers
cap_yam_ycast_prod_0_9_8.pcap.zip
packet_trace_LAN_INTERNE.pcap.zip
FYI: Successfully tested with Denon AVR 1713.
The custom stations (stations.yml) list is displayed and selectable, but not played.
Thanks for your work! But, often I get the message "access error" on the screen when I start the RX-773
FYI YCast works fine with Yamaha RX-A810
Denon AVR-X2200W working well, but I see these errors in the log after a power-on:
2020-04-19 15:47:54 ERROR: Unhandled upstream query (/setupapp/denon/asp/func/dynamOD.asp)
2020-04-19 15:48:27 ERROR: Unhandled upstream query (/setupapp/denon/asp/func/dynamOD.asp)
And if I follow the Denon webUI interface link for 'Jump to vTuner' :
2020-04-19 16:01:54 ERROR: Unhandled upstream query (/setupapp/denon/asp/AuthLogin/SignIn.asp)
It worked well with my Yamaha RX-A820. Thanks for sharing your code!
Iโve been running YCast for 2 weeks and using it with a Yamaha RX-V775. All working nicely with the current master
branch ๐
Currently reading My Stations from stations.yml results in a random order for both the categories as well as the stations within each category. This is a "feature" of PyYAML and python dictionaries.
I would like to see the order of the categories and stations as they appear in the station.yml file.
I installed oyaml (https://github.com/wimglenn/oyaml) and changed line 4 of my_stations.py from:
import yaml
to:
import oyaml as yaml
This transparently produced the desired result.
Please consider this for the default behaviour of YCast.
P.S. I am testing with a Yamaha R-N301 and YCast is working beautifully. YCast is installed on a Raspberry Pi 2 that is also running Pi-Hole.
Thanks for creating this project.
I am trying to setup ycast for a yamaha RX-N600.
I am running armbian(debian) buster on cubietruck and Python 3.7.3
On my router (mikrotik) i use static DNS for radioyamaha.vtuner.com and radioyamaha2.vtuner.com
I use iptables to redirect ports:
iptables -t nat -A PREROUTING -s 192.168.10.10 -p tcp --dport 80 -j REDIRECT --to-port 8010
Here is the debug info:
root@cubietruck:~# python3 -m ycast -l 0.0.0.0 -p 8010 -d
2020-02-22 19:28:28 INFO: YCast (1.0.0) server starting
2020-02-22 19:28:28 DEBUG: Debug logging enabled
* Serving Flask app "ycast.server" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
2020-02-22 19:28:28 INFO: * Running on http://0.0.0.0:8010/ (Press CTRL+C to quit)
2020-02-22 19:28:31 INFO: 192.168.10.10 - - [22/Feb/2020 19:28:31] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=928ad10a91dc51f4c4a315cefdabea96&dlang=eng&fver=M HTTP/1.1" 200 -
2020-02-22 19:28:36 INFO: 192.168.10.10 - - [22/Feb/2020 19:28:36] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=928ad10a91dc51f4c4a315cefdabea96&dlang=eng&fver=M HTTP/1.1" 200 -
2020-02-22 19:28:40 INFO: 192.168.10.10 - - [22/Feb/2020 19:28:40] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=928ad10a91dc51f4c4a315cefdabea96&dlang=eng&fver=M HTTP/1.1" 200 -
2020-02-22 19:28:43 INFO: 192.168.10.10 - - [22/Feb/2020 19:28:43] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=928ad10a91dc51f4c4a315cefdabea96&dlang=eng&fver=M HTTP/1.1" 200 -
2020-02-22 19:33:34 INFO: 192.168.10.4 - - [22/Feb/2020 19:33:34] "GET /ycast/ HTTP/1.1" 200 -
2020-02-22 19:35:20 INFO: 192.168.10.10 - - [22/Feb/2020 19:35:20] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=928ad10a91dc51f4c4a315cefdabea96&dlang=eng&fver=M HTTP/1.1" 200 -
2020-02-22 19:35:23 INFO: 192.168.10.10 - - [22/Feb/2020 19:35:23] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=928ad10a91dc51f4c4a315cefdabea96&dlang=eng&fver=M HTTP/1.1" 200 -
^Croot@cubietruck:~#
On the RX-N600 i get Connect error
If I try the ycast on my browser i get:
-1Dirhttp://192.168.10.7:8010/ycast/radiobrowser/?vtuner=truehttp://192.168.10.7:8010/ycast/radiobrowser/?vtuner=true4Dirhttp://192.168.10.7:8010/ycast/my_stations/?vtuner=truehttp://192.168.10.7:8010/ycast/my_stations/?vtuner=true3
Here is the tcpdump file
ycast_debug.zip
Any suggestion?
Detect the station broadcast format and present it in the XML info
Hi all,
has anyone got this working with a Yamaha RX-V2700 and/or RX-V3800?
I got from the Yamaha's "Connector error", in the logging of YCast I see:
2020-04-26 13:21:18 INFO: 192.168.1.10 - - [26/Apr/2020 13:21:18] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?token=0 HTTP/1.1" 200 -
2020-04-26 13:21:53 INFO: 192.168.1.10 - - [26/Apr/2020 13:21:53] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=4b....&dlang=eng&fver=M HTTP/1.1" 200 -
Any help is appreciated!
Best regards,
Robert
thank you for your work!
just to report - it's working on my setup: raspberry pi zero w with pi-hole and Marantz NA6005.
We need different syntax for the various vendors.
E.g.: Some AVRs expect ItemCount
and some don't.
Hi all,
i am trying to integrate a Sagemcom radio into ycast.
It is isung the url wistron.vtuner.com which i was able to redirect to ycast.
when staring ycast with debugging i see these errors:
2020-02-23 20:47:12 ERROR: Unhandled upstream query (/setupapp/Wistron/asp/browsexpa/navXML.asp)
2020-02-23 20:47:12 INFO: 127.0.0.1 - - [23/Feb/2020 20:47:12] "GET /setupapp/Wistron/asp/browsexpa/navXML.asp?gofile=LocationLevelTwo&mac=XXXXXXXXXXXXXXXXXXXXXXXXXX&dlang=ger&fver=1.754333 HTTP/1.0" 404 -
2020-02-23 20:48:12 ERROR: Unhandled upstream query (/setupapp/Wistron/asp/browsexpa/FavXML.asp)
2020-02-23 20:48:12 INFO: 127.0.0.1 - - [23/Feb/2020 20:48:12] "GET /setupapp/Wistron/asp/browsexpa/FavXML.asp?empty=&mac=XXXXXXXXXXXXXXXXXXXXXXXXXX&dlang=eng&fver=1.754333 HTTP/1.0" 404 -
2020-02-23 20:52:44 ERROR: Unhandled upstream query (/setupapp/Wistron/asp/Browsexpa/Search.asp)
2020-02-23 20:52:44 INFO: 127.0.0.1 - - [23/Feb/2020 20:52:44] "GET /setupapp/Wistron/asp/Browsexpa/Search.asp?sSearchtype=2&Search=Alternative&mac=XXXXXXXXXXXXXXXXXXXXXXXXXX&dlang=eng&fver=1.754333 HTTP/1.0" 404 -
Does anyone now, how to resolve the issue?
Cheers, Micha
Hi,
Thanks a lot for writing this software.
It is confirmed working on a Yamaha R-N301 :)
Was thinking about the same idea today and a little search revealed your project.
My idea would be to create a general media collections server, that you could redirect your Yamaha and other vTuner consumers to. The server would allow adding new streaming sources to the collection by plugins that for instance allow self defined media urls (like your projects does) but also proxying other online services that provide streamable content.
On the client side, output plugins would provide a similar categorisation filter like vTunter by interest/region/etc., do caching etc.
The VTuner style API would be just one of several output APIs to serve the media collection to more than one type of consumer (Yamaha).
So far only an idea. Time will tell how much time I can spend on this ;-)
It works perfectly! Thanks for your work on this! :)
Some AVR models don't follow 302 redirects for some reason.
Hi, i checked with my Onkyo PR-SC5509 and it works without any issues.
Perhaps this applies to the whole Onkyp (x)xx9 series (model year 2011).
It seems like only a few icon formats are supported correctly.
Figure out what is supported and how we can supply (cached) station icons on the fly.
I use local apache2 server, Turris omnia (OpenWRT) router and Denon DRA-100. It works! Thank you!!!
Hello Micha,
I would suggest to set (in radiobrowser.py file):
SHOW_BROKEN_STATIONS = as True, since BROKEN it is very often related to geo-localization, and radio-browser server is residing in Germany, and very often determines NOT WORKING (BROKEN) as False positive, while they are working in other countries (I did find couple of such cases)
Another issue, is to remove "Exact" part from searches, since due to database structure "Exact" part of statements eliminates quite a number of stations choices.
stations_json = request('stations/search?order=name&reverse=false&countryExact=true&country=' + str(country))
stations_json = request('stations/search?order=name&reverse=false&languageExact=true&language=' + str(language))
stations_json = request('stations/search?order=name&reverse=false&tagExact=true&tag=' + str(genre))
Very Briefly: This is a limitation of database searches, when original fields in language and tags have multiple entries, separated (delimited) by spaces or commas (this is not uniform).
The "Exact" statement eliminates any LIKE '%....%' searches and cuts them off.
Try for example Aboriginal Languages or Creole (there is more).
I better have finding e.g. "Dari" language in Man-Dari-n (=Mandarin), or Ewe, etc, rather than nothing at all.
I hope I make myself clear.
Sincerely,
Z-N
Works with Denon DRA-N5 (CEOL Piccolo).
Thanks for YCast!
Start from command line:
pi@raspberrypi:~ $ python3 -m ycast -l 127.0.0.1 -p 8010 -c /home/pi/stations.yml -d
2020-02-18 17:45:22 INFO: YCast (1.0.0) server starting
2020-02-18 17:45:22 DEBUG: Debug logging enabled
* Serving Flask app "ycast.server" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off <-- Is that OK?
2020-02-18 17:45:22 INFO: * Running on http://127.0.0.1:8010/ (Press CTRL+C to quit)
Denon Ceol N9 is working with ycast using pihole
Thx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.