[downloader/http] xattr values should be bytes
authorYen Chi Hsuan <yan12125@gmail.com>
Sat, 1 Oct 2016 11:58:13 +0000 (19:58 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sat, 1 Oct 2016 11:58:13 +0000 (19:58 +0800)
youtube_dl/downloader/http.py

index 11294d106064414e2fe538b3c53327fb617b08f5..af405b9509572bfd42bb11bd48bec5300d8105b3 100644 (file)
@@ -182,7 +182,7 @@ class HttpFD(FileDownloader):
 
                 if self.params.get('xattr_set_filesize', False) and data_len is not None:
                     try:
-                        write_xattr(tmpfilename, 'user.ytdl.filesize', str(data_len))
+                        write_xattr(tmpfilename, 'user.ytdl.filesize', str(data_len).encode('utf-8'))
                     except (XAttrUnavailableError, XAttrMetadataError) as err:
                         self.report_error('unable to set filesize xattr: %s' % str(err))