-
Notifications
You must be signed in to change notification settings - Fork 66
TypeError: filterWrapper is not iterable #206
Comments
On further debugging, it looks like |
Yeah, I keep getting this error, while it doesn't seem to really appear at all for other users. Could the search be blocked outside the US, perhaps? |
I'm trying ytsr for the first time and finding the same issue |
I mitigated it somewhat simply by applying exponential backoff with 3 retries. There are still times when it fails though. |
might be the same issue here. You might want to go into the node_modules of your project and manually change it till the owner can put in a fix |
As above, C is not iterable at i.parseFilters... Approx 1/30 requests actually work/return results. Time/delay between requests (including 24 hours+) makes no difference. I am also outside US (ref @sdasda7777's question). Will update if using US localized IP solves the issue. |
I think the issue is nothing to do with ytsr, it is rejected by youtube. And returned nothing. |
i have run the filterWrapper code thru chatgpt and it give a safety check for the filterWrapper which seems to fix the issue As for non-iterable errors, this code should not produce any non-iterable errors on its own. It seems to be using various iterators like However, there is one potential issue with the code. Specifically, the line: const filterWrapper = (wrapper.subMenu || wrapper.submenu).searchSubMenuRenderer.groups; It's possible that this line could throw a TypeError if neither For example, you can modify the line as follows to add a safety check: const filterWrapper = ((wrapper.subMenu || wrapper.submenu)?.searchSubMenuRenderer || {}).groups || []; This change ensures that Other than this, the code looks fine and should work as intended, provided that the input JSON object ( |
Got the same error. |
Confirmed here (outside us), fix works. Damn… AI be outsmarting us |
It only hides the problem. It stops the function from crashing, but returns no results. So that's no fix. Pasting stuff into chatgpt without thinking is not a solution to anything. |
But i got results just fine, though i agree with latter, the fix does indeed work |
Maybe, but i got this error and after replacing the line i got the results |
How? That "fix" only returns an empty list if both scraped elements are undefined. |
Idk, i only know that i got always errors when starting the query and with this "fix" i got results |
Then those results are wrong, because you're not applying any filters. |
Because I am not using filters perhaps? From what i see it will return results but not filters, it doesn't prevent results from returning whats wrong with not using filters? Ok so it's not "proper" fix but it does return results if filters are not used, thats what we can agree on |
Agreed, as far as i can tell i get the results i expected or at least the results that i require to work with |
Can you tell me where utils.js file that you're talking about is? FreeTube is no doubt in need of an update and I have it installed on my computer with this very problem (which has been occuring for several months), yet I can't find the file you're talking about anywhere in my installation (it's a user-side installation in the Windows AppData folder). |
node_modules/ytsr/lib/utils.js |
Isn't this fixed by #203? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Started occurring on pretty much every search. The error is thrown in
ytsr/lub/utils:23
, called by thegetFilters
function.The text was updated successfully, but these errors were encountered: