Skip to content

A feature-rich command-line audio/video downloader

[pp/XAttrMetadata] Only set "Where From" attribute on macOS (#13999)

bashonlybdeb3eb3f29e
diff --git a/yt_dlp/postprocessor/xattrpp.py b/yt_dlp/postprocessor/xattrpp.py
index f879989761..52404b7d7a 100644
--- a/yt_dlp/postprocessor/xattrpp.py
+++ b/yt_dlp/postprocessor/xattrpp.py
@@ -1,4 +1,5 @@
import os
+import sys
from .common import PostProcessor
from ..utils import (
@@ -54,8 +55,8 @@ class XAttrMetadataPP(PostProcessor):
if infoname == 'upload_date':
value = hyphenate_date(value)
elif xattrname == 'com.apple.metadata:kMDItemWhereFroms':
- # NTFS ADS doesn't support colons in names
- if os.name == 'nt':
+ # Colon in xattr name throws errors on Windows/NTFS and Linux
+ if sys.platform != 'darwin':
continue
value = self.APPLE_PLIST_TEMPLATE % value
write_xattr(info['filepath'], xattrname, value.encode())