Closed AlfredJ91 closed 4 years ago
Hello Alfred, Two things to suggest:
Hello,
I've tried your suggestions.
There is no error in terminal and normally my stations are not using non ASCII characters.
I've tried the branch version, no more success so far:
So the with the dev branch I'm not able to see my stations (from .yml) on the HTR.
No error on terminal, I don't know where the logs are going to (I've seen it uses logging function), and if it has to be enabled somehow.
Thanks,
Alfred.
Hello Alfred, Sorry to hear you have all these problems. My knowledge is not adequate to assist you deeper, but I have one more suggestion: ---When I was trying to access original vTuner service, I was getting to the point of getting their "ransom" messages for service, when I clicked on the link (on this message), I was getting an audio file playing message about this payment. I am saying there was an audio recording playing on my tuner. So, maybe, you would be able to sniff with wireshark, if your HTR tuner is getting this audio file and how it is talking to vTuner service and vice versa. Maybe it will provide more hints. Otherwise, you might need to wait for Micha-developer of the ycast app, and maybe he will be of any better assistance to you. Well, Good Luck, and I sincerely hope you will succeed and finally connect to ycast. Best, Z-N
Hello Z-N,
Thanks for your help.
Yes, this is what I've started to do (analyzing the vtuner audio message). What I've already seen is there is an HTTP 302 answer (Object Moved) to finally get the audio .mp3 file. This is not emulated by YCast. I will post here if finally I get it working.
Thanks again,
AlFred
Some AVRs blindly append additional request parameters with an ampersand (that's bogus btw).
The vTuner API seems to hack around that issue by passing a predefined empty set of parameters for every target URI (?empty=
).
Maybe we need to do that too. I'll have a look at it.
Well, I added a bogus parameter to every URL to potentially fix some of the issues mentioned here. See https://github.com/milaq/YCast/commit/f10110dc9207a937cd30e78f8e832f26219edac5 for more details.
Please test the latest dev branch and kindly report back.
Hello milaq,
Thanks for the update. I've retrieved the latest dev branch, and now the status is the same as the master branch: I get properly my stations displayed on the HTR, but I get "Access error" when I select one of them.
Note: on the dev branch I needed to change two things (like on the master branch):
There are no special characters in my station URL, but there is probably still something wrong (for the HTR) when sending the Dir Item content or Station Item content.
On the master branch I succeeded to have one station playing properly by forcing it directly without sending the Dir information (I've reproduced what I get with the original vTuner service playing the audio message to register the new service). So I guess it's more when sending the Dir Item there is something not understood, or missing for the HTR.
Regards,
Alfred.
Hey Alfred,
thanks for your swift response. I checked my packet captures again and it you were right with the access token response formatting. The vTuner API does not send a XML header with it. I removed it in the latest dev branch (see https://github.com/milaq/YCast/commit/63b87dfa9586c46ae0744d9d3cb07e55c1fdcf7d).
After looking though my packet captures again, I noticed that for my Yamaha AVR the original API does not send an ItemCount
element. The Onkyo receives it.
So I am assuming that the API decides whether to send specific XML items by vendor/device. That's bad news for us as we wan't a unified API and not have additional code to respect specific vendor and/or device differences.
Could you send me your packet captures via email (the one with DirCount
for the HTR-4067), so that I can have a look at it? That'd be awesome.
Thanks and cheers
Hi Milaq,
Thanks for update about the xml header.
Yes, I can send you some captures I've done, but I don't find you email address. Is it really mentioned somewhere here on git ?
Thanks,
Alfred.
Hey Alfred,
you can find my email address in any of my commits. E.g.: https://github.com/milaq/YCast/commit/63b87dfa9586c46ae0744d9d3cb07e55c1fdcf7d.patch
Thanks
So, I dug out some early packet captures of mine, where the DirCount
is used and implemented support for it. See https://github.com/milaq/YCast/commit/4accb0bef18a7d2f6bbf312d43898213f4f2a58e
If supported by the AVR, it should also display the item count in the parent directory now.
Please test and report back.
Note: This has quite the effect on the Radiobrowser API. For every folder, the API request number is way higher now. We should ask @segler-alex whether the strain is alright. Additionally I was thinking about some API throttling here and there, so we don't consume too much bandwidth.
Cheers
Hi milaq,
I was away from home, I could test today only.
The new version works is Ok for the folders, I now see my station names on the HTR display, with no code modification. Thanks for that.
However, as soon as I select one of my stations, I still get "ACCESS ERROR". No error in YCast logs. I know my station URL is correct, because I've modified the master branch to have YCast sending directlty one unique station to BrowseXML/loginXML & BrowseXML/statxml requests and this works properly (with no folder selection and no station selection). Actually I've simulated what I see when I connect to the vtuner service and replaced http://vtuner.com/setupapp/yamaha/mp3/YradioSample.mp3 with my station URL.
Looking at the discusion wit Zippo2000, I've tried the single_station branch but there I get "No Content" when I select Radio Browser. I'm not sure if I should configure Something else to have the list of stations there. An extract of the logs: 2019-08-21 19:06:07 DEBUG: Radiobrowser API request: tags?hidebroken=true 2019-08-21 19:06:07 DEBUG: Starting new HTTP connection (1): www.radio-browser.info 2019-08-21 19:06:07 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/tags?hidebroken=true HTTP/1.1" 200 None 2019-08-21 19:06:07 DEBUG: Radiobrowser API request: countries?hidebroken=true 2019-08-21 19:06:07 DEBUG: Starting new HTTP connection (1): www.radio-browser.info 2019-08-21 19:06:07 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/countries?hidebroken=true HTTP/1.1" 200 None 2019-08-21 19:06:07 DEBUG: Radiobrowser API request: stations?order=votes&reverse=true&limit=200 2019-08-21 19:06:07 DEBUG: Starting new HTTP connection (1): www.radio-browser.info 2019-08-21 19:06:07 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/stations?order=votes&reverse=true&limit=200 HTTP/1.1" 200 None
If you have any suggestion, I will try it.
Thanks,
Alfred
The new version works is Ok for the folders, I now see my station names on the HTR display, with no code modification. Thanks for that.
I am not exactly sure which codebase you used which got you working station listings. The latest dev branch? And at what commit id?
However, as soon as I select one of my stations, I still get "ACCESS ERROR". No error in YCast logs. I know my station URL is correct, because I've modified the master branch to have YCast sending directlty one unique station to BrowseXML/loginXML & BrowseXML/statxml requests and this works properly (with no folder selection and no station selection). Actually I've simulated what I see when I connect to the vtuner service and replaced http://vtuner.com/setupapp/yamaha/mp3/YradioSample.mp3 with my station URL.
Can you send me the code which you used for emulating? Better yet, please also send me the packet capture where you saw the single station access. That would be awesome :+1:
I am supposing we either miss something or the vTuner API behaves totally different with every AVR. I'd assume the latter from the clusterfuck I've been seeing with this API layout. I guess we need to keep trying to make it as universal as possible.
I recently got a Denon AVR. There, the receiver gets all station urls proxied by the API and can request single stations by id too. This would be good for us as we want to track the station requests either way for https://github.com/milaq/YCast/issues/17. Maybe most AVRs just request a direct stream URL with the id=xxxx
parameter. I could say that for sure if I see more packet captures from traffic between your AVR and the original vTuner API.
Thanks and regards
I've made some minor adjustments to the fetch_single_station branch. You should now get a response if your AVR requests a single station from the 'My Stations' category. The Radiobrowser category may also work now.
I am not exactly sure which codebase you used which got you working station listings. The latest dev branch? And at what commit id?
I've used the current dev branch (commit 8504097).
Can you send me the code which you used for emulating? Better yet, please also send me the packet capture where you saw the single station access. That would be awesome
Ok, I will do that in a separate email.
I've made some minor adjustments to the fetch_single_station branch. You should now get a response if your AVR requests a single station from the 'My Stations' category. The Radiobrowser category may also work now.
Ok I will try it.
Thanks,
AlFred.
Hello Milaq,
I tested the latest "fetch_single_station" branch, and it works now for RadioBrowser menu. I tested several radios (including the ones I have in my station.yml) and they work fine. However, when I select MyStation menu and one of my stations, it doesn't work, no error on HTR but the sound cut, and it plays again the last station that worked before. I guess if finally it works with my HTR for RadioBrowser menu, it is possible to have MyStation menu working as well, and we are not far from it!
I tested also the dev branch, but there I get [NO CONTENT].
Thanks,
AlFred
Hey Fred, thanks for the captures and your testing.
Well, that's weird. The current dev branch (from https://github.com/milaq/YCast/commit/19e0ff8649c36b0b9cd57c339e2339833aad3902) has support for single station fetches and is en par feature-wise.
I just compared the XML output and code of both versions again and didn't find anything that should be different for the receiver. Maybe I am missing something. I'll have a look at it again tomorrow.
In the meantime, can you post a debug output of the server messages using the latest dev branch version (https://github.com/milaq/YCast/archive/dev.zip) when the errors happen?
Thanks and cheers
Another note: As another user pointed out via email, the custom IDs may not exceed 15 character for some AVRs. I fixed the ID generation in the latest dev branch in that regard: https://github.com/milaq/YCast/commit/c6f4fe1691ae8a6287b912944af9c87c02d86b6f
More notes:
Another user pointed out that he has issues with the redirect we do in the dev
branch. He uses an RX-V777.
The fetch_single_station
branch doesn't do redirects.
Maybe all devices from the RX-Vx77 series have problems with that.
Hello Milaq,
I've just tested the dev branch, and still [NO CONTENT], here is the log:
2019-08-26 18:22:01 INFO: 192.168.0.30 - - [26/Aug/2019 18:22:01] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?token=0 HTTP/1.1" 200 - 2019-08-26 18:22:09 INFO: 192.168.0.30 - - [26/Aug/2019 18:22:09] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=XXXX&dlang=fre&fver=W&start=1&howmany=8 HTTP/1.1" 302 - 2019-08-26 18:22:09 INFO: 192.168.0.30 - - [26/Aug/2019 18:22:09] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=XXXX&dlang=fre&fver=W&start=1&howmany=8 HTTP/1.1" 302 - 2019-08-26 18:22:10 DEBUG: Radiobrowser API request: stations/byid/125136 2019-08-26 18:22:10 DEBUG: Starting new HTTP connection (1): www.radio-browser.info 2019-08-26 18:22:10 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/stations/byid/125136 HTTP/1.1" 200 893 2019-08-26 18:22:10 INFO: 192.168.0.30 - - [26/Aug/2019 18:22:10] "GET /setupapp/Yamaha/asp/BrowseXML/statxml.asp?mac=XXXX&fver=W&id=RB_125136 HTTP/1.1" 200 - 2019-08-26 18:22:10 DEBUG: Radiobrowser API request: stations/byid/125136 2019-08-26 18:22:10 DEBUG: Starting new HTTP connection (1): www.radio-browser.info 2019-08-26 18:22:10 DEBUG: Radiobrowser API request: stations/byid/125136 2019-08-26 18:22:10 DEBUG: Starting new HTTP connection (1): www.radio-browser.info 2019-08-26 18:22:10 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/stations/byid/125136 HTTP/1.1" 200 893 2019-08-26 18:22:10 DEBUG: Station with ID 'RB_125136' requested 2019-08-26 18:22:10 INFO: 192.168.0.30 - - [26/Aug/2019 18:22:10] "GET /ycast/play?id=RB_125136 HTTP/1.1" 302 - 2019-08-26 18:22:10 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/stations/byid/125136 HTTP/1.1" 200 893 2019-08-26 18:22:10 DEBUG: Station icon cache miss. Fetching and converting station icon for station id 'RB_125136' 2019-08-26 18:22:10 DEBUG: Starting new HTTPS connection (1): lh3.googleusercontent.com 2019-08-26 18:22:10 DEBUG: https://lh3.googleusercontent.com:443 "GET /I1Q_ohFz4PlMfK-u9uS7pWafi_eTtKdSEPrwnfCkB28u7qm8JtcBMo2sneSUWC19J-Q=w300 HTTP/1.1" 200 37029 2019-08-26 18:22:10 DEBUG: STREAM b'IHDR' 16 13 2019-08-26 18:22:10 DEBUG: STREAM b'sBIT' 41 4 2019-08-26 18:22:10 DEBUG: b'sBIT' 41 4 (unknown) 2019-08-26 18:22:10 DEBUG: STREAM b'zTXt' 57 95 2019-08-26 18:22:10 DEBUG: STREAM b'IDAT' 164 8192 2019-08-26 18:22:10 INFO: 192.168.0.30 - - [26/Aug/2019 18:22:10] "GET /ycast/icon?id=RB_125136 HTTP/1.1" 200 -
Yes, maybe the problem is the redirect.
Thanks,
Alfred.
Hello to All Interested, This radio station which you choose, @AlfredJ91, in your last error log, does NOT work on my Yamaha RX-V773, as well. Please, try other stations. I am also getting error 302. 2019-08-26 19:11:56 DEBUG: Radiobrowser API request: stations/byid/125136 2019-08-26 19:11:56 DEBUG: Starting new HTTP connection (1): radiobrowser 2019-08-26 19:11:56 DEBUG: http://radiobrowser:80 "GET /webservice/json/stations/byid/125136 HTTP/1.1" 200 None 2019-08-26 19:11:56 DEBUG: Station with ID 'RB_125136' requested 2019-08-26 19:11:56 INFO: 127.0.0.1 - - [26/Aug/2019 19:11:56] "GET /ycast/play?id=RB_125136 HTTP/1.0" 302 - It works using GUI web interface, but does NOT in ycast. From db, I identified it as: Jazz24 (KNKX 88.5 HD2 Tacoma, WA) [256 AAC+] It seems to be redirected according to http(s) protocol https://prod-18-234-41-31.wostreaming.net/ppm-jazz24aac256-ibc1?session-id=c87692a136c88fd9f5f9a9d8121a http://3.89.116.41/ppm-jazz24aac256-ibc1?session-id=32f7bd9696d0b26e84a3a86ca24a8 Not sure if this gonna help, but try other stations. My Yamaha, once cannot play one station, it skips it and automatically goes to another in the list, until it finds working one. Sincerely, Z-N
Hello Z-N,
Thanks for your comment.
Actually my issue is I get directly [NO CONTENT] on screen when I use the dev branch. I don't select any radio, and I can't even display RadioBrowser menu or MyStation menu.
When I use the fetch_single_station, I don't have this issue, RadioBrowser and MyStations coming from the .yml are displaying properly and I can browse the folders.
Regards,
AlFred.
Another note, and summary.
When I use the single_fetch branch, the station is playing directly properly and I get the following log: 2019-08-27 17:25:51 INFO: 192.168.0.30 - - [27/Aug/2019 17:25:51] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?token=0 HTTP/1.1" 200 - 2019-08-27 17:25:51 INFO: 192.168.0.30 - - [27/Aug/2019 17:25:51] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=XXXXX&dlang=fre&fver=W&start=1&howmany=8 HTTP/1.1" 200 - 2019-08-27 17:25:51 INFO: 192.168.0.30 - - [27/Aug/2019 17:25:51] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=XXXXX&dlang=fre&fver=W&start=1&howmany=8 HTTP/1.1" 200 - 2019-08-27 17:25:52 DEBUG: Radiobrowser API request: stations/byid/125136 2019-08-27 17:25:52 DEBUG: Starting new HTTP connection (1): www.radio-browser.info 2019-08-27 17:25:52 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/stations/byid/125136 HTTP/1.1" 200 893 2019-08-27 17:25:52 INFO: 192.168.0.30 - - [27/Aug/2019 17:25:52] "GET /setupapp/Yamaha/asp/BrowseXML/statxml.asp?mac=XXXXX&fver=W&id=RB_125136 HTTP/1.1" 200 -
When I use the new redirect branch I get the following log: 2019-08-27 17:13:21 INFO: 192.168.0.30 - - [27/Aug/2019 17:13:21] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?token=0 HTTP/1.1" 200 - 2019-08-27 17:13:31 INFO: 192.168.0.30 - - [27/Aug/2019 17:13:31] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=XXXXX&dlang=fre&fver=W&start=1&howmany=8 HTTP/1.1" 302 - 2019-08-27 17:13:31 INFO: 192.168.0.30 - - [27/Aug/2019 17:13:31] "GET /setupapp/Yamaha/asp/BrowseXML/loginXML.asp?mac=XXXXX&dlang=fre&fver=W&start=1&howmany=8 HTTP/1.1" 302 - 2019-08-27 17:13:32 DEBUG: Radiobrowser API request: stations/byid/125136 2019-08-27 17:13:32 DEBUG: Starting new HTTP connection (1): www.radio-browser.info 2019-08-27 17:13:32 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/stations/byid/125136 HTTP/1.1" 200 893 2019-08-27 17:13:32 INFO: 192.168.0.30 - - [27/Aug/2019 17:13:32] "GET /setupapp/Yamaha/asp/BrowseXML/statxml.asp?mac=XXXXX&fver=W&id=RB_125136 HTTP/1.1" 200 - 2019-08-27 17:13:32 DEBUG: Radiobrowser API request: stations/byid/125136 2019-08-27 17:13:32 DEBUG: Starting new HTTP connection (1): www.radio-browser.info 2019-08-27 17:13:32 DEBUG: Radiobrowser API request: stations/byid/125136 2019-08-27 17:13:32 DEBUG: Starting new HTTP connection (1): www.radio-browser.info 2019-08-27 17:13:32 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/stations/byid/125136 HTTP/1.1" 200 893 2019-08-27 17:13:32 DEBUG: Radiobrowser API request: url/125136 2019-08-27 17:13:32 DEBUG: Starting new HTTP connection (1): www.radio-browser.info 2019-08-27 17:13:32 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/stations/byid/125136 HTTP/1.1" 200 893 2019-08-27 17:13:32 INFO: 192.168.0.30 - - [27/Aug/2019 17:13:32] "GET /ycast/icon?id=RB_125136 HTTP/1.1" 200 - 2019-08-27 17:13:32 DEBUG: http://www.radio-browser.info:80 "GET /webservice/json/url/125136 HTTP/1.1" 200 246 2019-08-27 17:13:32 DEBUG: Station with ID 'RB_125136' requested 2019-08-27 17:13:32 INFO: 192.168.0.30 - - [27/Aug/2019 17:13:32] "GET /ycast/play?id=RB_125136 HTTP/1.1" 302 -
and [NO CONTENT] on the screen.
But anyway, I'm more interested in having MyStation folder working than the RadioBrowser. To summarize:
Regards,
Alfred.
Hey Alfred,
thanks for your tests. It seems like at least some AVRs doesn't do redirects properly or in a format which is not understood correctly.
I was hoping that the redirect_shenanigans branch would work with the problematic receivers. Please see my comment here: https://github.com/milaq/YCast/issues/5#issuecomment-525062008
I'll continue to try to get redirects running but may turn off station tracking in the dev branch. I'll keep you posted.
Cheers
I went ahead and disabled station tracking by default. This should make the stations work again on the affected receiver models.
See https://github.com/milaq/YCast/commit/1b4ba071b7f27cf853ca572a5ed1dbb9d090494d
Please let me know if that fixes the issue for you.
Hi Milaq,
Yes, it works now !
I've used the latest dev branch and now everything is working for me: RadioBrowser and MyStations, and stations are playing fine.
So, Yamaha HTR-4067 / RX-477 can be added to the list of supported devices :-)
Thanks a lot for your support.
If you need additional testing, let me know.
Alfred.
Thanks for your response and offering of testing assistance @AlfredJ91
Another user and I have found out that some Yamaha AVRs use some kind of whitelist. See https://github.com/milaq/YCast/issues/19
We are working on finding out what exactly is whitelisted. I'll keep you posted and let you know when we have found out what the whitelist is. I'll may come back to you for some testing then.
Thanks and cheers
Merging with https://github.com/milaq/YCast/issues/19. Please report any additional issues there.
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.