|
@ -13,6 +13,9 @@ from ..utils import ( |
|
|
encodeFilename, |
|
|
encodeFilename, |
|
|
sanitize_open, |
|
|
sanitize_open, |
|
|
sanitized_Request, |
|
|
sanitized_Request, |
|
|
|
|
|
write_xattr, |
|
|
|
|
|
XAttrMetadataError, |
|
|
|
|
|
XAttrUnavailableError, |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -179,9 +182,8 @@ class HttpFD(FileDownloader): |
|
|
|
|
|
|
|
|
if self.params.get('xattr_set_filesize', False) and data_len is not None: |
|
|
if self.params.get('xattr_set_filesize', False) and data_len is not None: |
|
|
try: |
|
|
try: |
|
|
import xattr |
|
|
|
|
|
xattr.setxattr(tmpfilename, 'user.ytdl.filesize', str(data_len)) |
|
|
|
|
|
except(OSError, IOError, ImportError) as err: |
|
|
|
|
|
|
|
|
write_xattr(tmpfilename, 'user.ytdl.filesize', str(data_len)) |
|
|
|
|
|
except (XAttrUnavailableError, XAttrMetadataError) as err: |
|
|
self.report_error('unable to set filesize xattr: %s' % str(err)) |
|
|
self.report_error('unable to set filesize xattr: %s' % str(err)) |
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|