Git Product home page Git Product logo

Comments (5)

alexmercerind avatar alexmercerind commented on September 27, 2024

Hi @BertAssistant !

I'm kinda confused about this one.

from youtube-search-python.

alexmercerind avatar alexmercerind commented on September 27, 2024

Hi @BertAssistant !

Can you please remove the following line from your code & let me know if it still shows that on terminal?

url = StreamURLFetcher().get(target, 251)

I also recommend to make global object of the StreamURLFetcher, & address its instance, instead of every time instanciating StreamURLFetcher.

Because that's the only thing that can go wrong, I guess.

from youtube-search-python.

BertAssistant avatar BertAssistant commented on September 27, 2024

Hi @BertAssistant !

Can you please remove the following line from your code & let me know if it still shows that on terminal?

url = StreamURLFetcher().get(target, 251)

Because that's the only thing that can go wrong, I guess.

Here is my code now :
image

Here is the log :
image

I think the main problem (Could not make requests) is StreamURLFetcher(). On my local console it works fine, but not with the server console

from youtube-search-python.

alexmercerind avatar alexmercerind commented on September 27, 2024

Hello @BertAssistant !

As you probably read my documentation of the project, the StreamURLFetcher is derived from PyTube & its a slow process.

Thing is that, when you message too frequently, the things get kinda bad as it uses some global variables, which do not make it thread safe.
So,
all I can say is to change this line:

url = StreamURLFetcher().get(target, 251)

to:

# Store this globally.
fetcher = StreamURLFetcher()

def yourMessageFunction(self, ...):
    # Address the object.
    url = fetcher.get(target, 251)

By this, the performance will also improve & possibly your bug will also get fixed.

You can see this project from someone else, how he/she has stored the object globally.

from youtube-search-python.

alexmercerind avatar alexmercerind commented on September 27, 2024

Hope this gets it resolved.
Thanks.

Closing. Feel free to make further query.

from youtube-search-python.

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.