1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-08-14 00:18:31 +00:00

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

Fix 3e918d825d

Closes #14004
Authored by: bashonly
This commit is contained in:
bashonly 2025-08-12 02:58:22 -05:00 committed by GitHub
parent b7de89c910
commit bdeb3eb3f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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())