Giter Club home page Giter Club logo

Comments (7)

djdynamix avatar djdynamix commented on May 12, 2024

In case it helps anyone, I'm currently successfully using the library here: https://github.com/mrklintscher/YoutubeSearch along with YoutubeExplode, and it seems to be working well. Using this code with a WPF ListView:

listView.Items.Clear();
string querystring = txtSearch.Text;
int querypages = 3;

        var items = new VideoSearch();

        string vidLink = "";
        
        foreach (var item in items.SearchQuery(querystring, querypages))
        { 
            listView.Items.Add(new vidItem { Name = HttpUtility.HtmlDecode(item.Title), Url = item.Url });
        }

I then just pull a URL from the ListView into Youtube Explode with a mouse event handler.

I hope this helps.

from youtubeexplode.

SlowLogicBoy avatar SlowLogicBoy commented on May 12, 2024

@djdynamix nice catch, but it's a GPL -.-

from youtubeexplode.

Tyrrrz avatar Tyrrrz commented on May 12, 2024

That library uses normal search (https://www.youtube.com/results?search_query=test) and just parses the HTML for results. This can be replicated easily but I'm not sure how volatile it is.

from youtubeexplode.

SlowLogicBoy avatar SlowLogicBoy commented on May 12, 2024

I think it's better to use that library separately, if you want and if there is a need just map ones model to another. I would prefer ajax/api calls instead of html parsing.

from youtubeexplode.

Tyrrrz avatar Tyrrrz commented on May 12, 2024

You can probably parse mobile version of the site: https://m.youtube.com/results?search_query=dogs&app=m. It's very compact and hasn't been changed in a long time from what I can see. You would just need to regex all video links (/watch?v=) and continuation token (&ctoken=) for next page.

There are also some search options: you can search for playlists and channels instead of videos, and can filter by upload date.

from youtubeexplode.

Tyrrrz avatar Tyrrrz commented on May 12, 2024

I got it working somehow, with pages, although it's still not the same as YouTube's search but it's kinda close and better than nothing I guess.

from youtubeexplode.

Tyrrrz avatar Tyrrrz commented on May 12, 2024

Worth noting that the Video objects returned by the search lack keywords and their description is trimmed. This is how the request returns them...

from youtubeexplode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.