Closed reply2za closed 1 year ago
Hi, where is this utils.js , I can't find it, I tried searching for Freetube on whereis Freetube but on my terminal it shows nothing, I'm a Linux newbie.
pls fix it
@Domjan1911
The utils.js file is within node modules. node modules
-> ytsr
-> lib
-> utils.js
The utils.js code I am using is this.
closing in favor of #203
Addresses issue#206
A quick and technically not ideal fix. This change adds a safety check so that if
wrapper.subMenu
returns undefined, then the method returns an empty filter map, instead of throwing an error. This will likely always be the case now and this code does not address the root issue.The fact of the matter is that YouTube likely updated their payload data (thus breaking the filter feature). The main fix would be updating the path to
searchFilterGroupRenderer
, which still exists. The point of this PR, at the very least, is to add a safety check to allow for YTSR to return search data, which is much better than not returning anything at all whenever YouTube updates their response.Furthermore, I did take a look into the new payload and found that filter data could maybe be retrieved like this:
I did not make a PR with this code (yet) for a few reasons.
Firstly because all the tests that rely on local HTML data fail, because this code only expects the new payload format. Also the typings have to be updated.Update: I updated the code to support both the old and new payload formats.
Thanks, Reply2za