]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/plugins.py
[ie/podbayfm] Fix extraction (#10195)
[yt-dlp.git] / yt_dlp / plugins.py
index 6422c7a51d62b7da6231be389a16c041556a45b6..3cc879fd7e028bcb46f63de6077cfe15028e9ac1 100644 (file)
@@ -86,11 +86,14 @@ def _get_package_paths(*root_paths, containing_folder='plugins'):
         parts = Path(*fullname.split('.'))
         for path in orderedSet(candidate_locations, lazy=True):
             candidate = path / parts
-            if candidate.is_dir():
-                yield candidate
-            elif path.suffix in ('.zip', '.egg', '.whl') and path.is_file():
-                if parts in dirs_in_zip(path):
+            try:
+                if candidate.is_dir():
                     yield candidate
+                elif path.suffix in ('.zip', '.egg', '.whl') and path.is_file():
+                    if parts in dirs_in_zip(path):
+                        yield candidate
+            except PermissionError as e:
+                write_string(f'Permission error while accessing modules in "{e.filename}"\n')
 
     def find_spec(self, fullname, path=None, target=None):
         if fullname not in self.packages: