youtube
youtube copied to clipboard
cannot parse JSON
panic: got malformed json searching for page 0 of query "animus vox": cannot parse JSON: cannot parse empty string; unparsed tail: ""
I got the same when using the example, perhaps the library no longer works?
@lithdew I believe the issue is that we are querying https://www.youtube.com/search_ajax?
, but the required headers have not been set. The following headers must be sent in the request:
x-youtube-client-name: 56
x-youtube-client-version: 20200911
This is easily tested using Postman. When one or both headers are not included, the response is empty. If both headers are included, the response contains search results as we would expect. Here's a screenshot:
I would submit a fix for this myself, but I see that you're using your own http library to perform the request and I'm not at all familiar with how it works. I imagine this should be pretty simple, however.