SuspiciousLookingOwl / scrape-yt

Simple lib to scrape information from youtube such as search results, video information, related videos, playlist information and up next video
https://www.npmjs.com/package/scrape-yt
MIT License
9 stars 3 forks source link

Search without passing type as a query param #15

Closed MikeDev96 closed 4 years ago

MikeDev96 commented 4 years ago

Applying the filter can sometimes remove videos from the results, I'm unsure if this is a YouTube issue or not.

Take the following links as examples:

This first link will bring up the correct video/song that I want: https://www.youtube.com/results?search_query=official+audio+Stand+High+Patrol+Commando

But when you apply the video filter (which is correct as it is a video...), you will see it disappears: https://www.youtube.com/results?search_query=official+audio+Stand+High+Patrol+Commando&sp=EgIQAQ%253D%253D

I've looked at the code and can see you're filtering the results by the type param as well as passing it in the query. It would be useful if we could pass a type but not have it included in the query.

As a test I commented out 4 lines in the dist code and it works as intended for me now.

https://i.imgur.com/4Yp7ZP0.png

SuspiciousLookingOwl commented 4 years ago

Seems like a Youtube issue, I will see if there's a workaround for this.

If not, I'm gonna add search type "all" which includes Channel, Video, and Playlist by searching without filter, and distinguish it manually from the scrapper.

MikeDev96 commented 4 years ago

Sounds good to me, thanks for the prompt response!

SuspiciousLookingOwl commented 4 years ago

Published the update to NPM (@1.4.0)