Skip to content

Commit

Permalink
[YoutubeDL] only filter unclosed streams
Browse files Browse the repository at this point in the history
  • Loading branch information
Lesmiscore committed Nov 23, 2021
1 parent 9f16e83 commit 26665a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yt_dlp/YoutubeDL.py
Expand Up @@ -2727,9 +2727,9 @@ def wrapper(self: 'YoutubeDL', *args, **kwargs):
try:
return func(self, *args, **kwargs)
finally:
streams = list(self._opened_streams)
streams = list(x for x in self._opened_streams if not getattr(x, 'closed', False))
self._opened_streams[:] = []
if streams:
self._opened_streams[:] = []
self.write_debug(f'Cleaning up {len(streams)} streams')
for st in streams:
if not st:
Expand Down

0 comments on commit 26665a9

Please sign in to comment.