Skip to content

Commit

Permalink
fix(Search): Return search results even if there are ads (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue authored Mar 27, 2023
1 parent ade5feb commit 2c5907f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser/youtube/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Search extends Feed<ISearchResponse> {
if (!contents)
throw new InnertubeError('No contents found in search response');

this.results = contents.firstOfType(ItemSection)?.contents;
this.results = contents.filterType(ItemSection).find((section) => section.contents && section.contents.length > 0)?.contents;

this.refinements = this.page.refinements || [];
this.estimated_results = this.page.estimated_results;
Expand Down

0 comments on commit 2c5907f

Please sign in to comment.