HelpSeeker / CoubDownloader

A simple downloader for coub.com
GNU General Public License v3.0
68 stars 13 forks source link

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process #14

Closed AderBajusz closed 1 year ago

AderBajusz commented 2 years ago

Hi! I'm unfortunately quite a noob and haven't been able to solve this. I've tried running this command: coub.py --retries -1 --connections 1 -n --limit-num 2475 -m news#top But I keep getting the following error after a few downloads:

Traceback (most recent call last):
  File "C:\Users\user\Downloads\CoubDownloader-master\CoubDownloader-master\coub.py", line 2008, in <module>
    main()
  File "C:\Users\user\Downloads\CoubDownloader-master\CoubDownloader-master\coub.py", line 1995, in main
    attempt_process(coubs)
  File "C:\Users\user\Downloads\CoubDownloader-master\CoubDownloader-master\coub.py", line 1960, in attempt_process
    asyncio.run(process(coubs), debug=False)
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "C:\Users\user\Downloads\CoubDownloader-master\CoubDownloader-master\coub.py", line 1929, in process
    await asyncio.gather(*tasks)
  File "C:\Users\user\Downloads\CoubDownloader-master\CoubDownloader-master\coub.py", line 1109, in process
    self.merge()
  File "C:\Users\user\Downloads\CoubDownloader-master\CoubDownloader-master\coub.py", line 1054, in merge
    os.remove(self.v_name)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '1qdvuw.mp4'
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000025F94FAAB80>
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
    self._check_closed()
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

Before this I'd try choosing a directory for the downloads, but it would also fail: coub.py --retries -1 -p D:\Coubs\Politics -n --limit-num 2475 -m news#top

Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000024C57ABAB80> Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__ self.close() File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close self._loop.call_soon(self._call_connection_lost, None) File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon self._check_closed() File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed

I've been partially successful with the first command, but now it keeps failing too after a few downloads.

Thanks for the help! RIP Coub

HelpSeeker commented 2 years ago

Does the problem still happen? Unfortunately I haven't been able to reproduce it.

Did you open one of the streams with a media player, before the program was finished?

AderBajusz commented 2 years ago

Hi! The problem persists, I keep getting the same errors. I don't think there is anything running that would be trying to read the files while the program is running