From bdeb3eb3f29eebbe8237fbc5186e51e7293eea4a Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Tue, 12 Aug 2025 02:58:22 -0500 Subject: [PATCH] [pp/XAttrMetadata] Only set "Where From" attribute on macOS (#13999) Fix 3e918d825d7ff367812658957b281b8cda8f9ebb Closes #14004 Authored by: bashonly --- yt_dlp/postprocessor/xattrpp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yt_dlp/postprocessor/xattrpp.py b/yt_dlp/postprocessor/xattrpp.py index f87998976..52404b7d7 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 @@ def run(self, info): 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())