Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Could there be any problems when executing youtube-dl code in other than main thread? #5694
Comments
|
I'm not too experienced with threading in python, so I don't know if I can help too much. Could you post the output when it freezes using You are using a global variable for saving the output ( |
|
the weirdest thing is that it gets stuck in different places, sometimes here, or here, or other places. Thanks for the hint about the |
|
Run it under debugger and issue pause after it's stuck, look at the threads' stack frames to see who has actually stuck and where. |
I'm using youtube-dl script in some python environment where I can't execute
downloadon the main thread as it will block the UI. So I'm creating thread whenever I need to fetch video URL (I only need youtube video URL extracted from youtube video webpage URL).What I observe right now - sometimes (1 out of 200-300 requests) everything just freezes as it could happen with mutual thread blocking. I tried to debug it, and it seems that hangs are happening randomly. It may also be the environment in which I'm running this code.
So, I'm wondering, is it safe to execute the following code in other than main thread?
Brief description:
getVideoUrlAsyncis called from the main thread and youtube video page url is placed intoserviceUrlQ. New thread created, it calls youtube-dl code to fetch video URL and places it intooutQ(orvideoUrlQ).