-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
destroyProcessByID not working with external executables running in child processes #261
Comments
I am using following commands if that helps
|
If you're using an external downloader like ffmpeg or aria2c, it should be launched and running in another process, which is out of our controll. We can only use the Java API to destroy the original process which runs yt-dlp |
uh ho, any work around for this? |
@JunkFood02 Is it not possible to get PID of ffmpeg and kill that via BuildProcess()/RunTime execution?.
|
@farimarwat I'm quite busy right now but feel free to try it yourself and submit a PR! If you need additional input then don't hesitate to ask |
More findings:
So the solution would be to figure out the process id that yt-dlp is using to start |
I need permissions to create PR. Kindly send me contribution link. Because when ever i try to push a commit, it gives error: PS C:\Users\BISMILLAH\Downloads\youtubedl-android> git push origin master I am working on the issue and almost near to solve this. |
@farimarwat Please fork this repository and have the work done in your own repo, from which you can submit the pull request to this one Refer to GitHub docs: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork |
The ProcessBuilder() starts process for Python lib. Python lib further creates a process for ffmpeg if used for downloading. So the process returned by .start() method is only capable to kill child process(python) of the app not sub process(ffmpeg). As this(ffmpeg) belongs to the app tree, so we are able to kill it even android has restrctions to kill other's app process. Tree for process: App Process(PID) -Python Process(PID) --FFMPEG Process(PID) Now the issue was that if we use "destroyProcessById()" the FFMPEG process still continue to download the app. So we have to manually kill this as well. This patch will solve the bug.
See also: JunkFood02/Seal#180 |
@JunkFood02 I have updated my code to target only the selected process. I have tested it and working fine. |
@farimarwat Just build the library on your own fork with jitpack https://jitpack.io/#farimarwat/youtubedl-android |
Hey, I am downloading an RTMP file from a site and using a Timer that reads the size of the file from the disk every second.
Downloading works fine but it continues even after I call
destroyProccessById()
and it returns true.In the screenshot, as you can see, the timer prints the file size that is continuously increasing, which means file is being downloaded in the background.
Any remedy for this?
The text was updated successfully, but these errors were encountered: