Fix permission error when copying files to network directory
- Replace shutil.copy2() with shutil.copyfile() in enhanced_provider.py - Replace shutil.copy() with shutil.copyfile() in aniworld_provider.py - copyfile() only copies content, avoiding metadata permission issues
This commit is contained in:
@@ -326,7 +326,8 @@ class AniworldLoader(Loader):
|
||||
|
||||
if os.path.exists(temp_path):
|
||||
logging.debug("Moving file from temp to final destination")
|
||||
shutil.copy(temp_path, output_path)
|
||||
# Use copyfile instead of copy to avoid metadata permission issues
|
||||
shutil.copyfile(temp_path, output_path)
|
||||
os.remove(temp_path)
|
||||
logging.info(
|
||||
f"Download completed successfully: {output_file}"
|
||||
|
||||
@@ -555,7 +555,8 @@ class EnhancedAniWorldLoader(Loader):
|
||||
# Verify downloaded file
|
||||
if file_corruption_detector.is_valid_video_file(temp_path):
|
||||
# Move to final location
|
||||
shutil.copy2(temp_path, output_path)
|
||||
# Use copyfile instead of copy2 to avoid metadata permission issues
|
||||
shutil.copyfile(temp_path, output_path)
|
||||
|
||||
# Calculate and store checksum for integrity
|
||||
integrity_mgr = get_integrity_manager()
|
||||
|
||||
Reference in New Issue
Block a user