Rebase old pull request to master.
Requires the xattr package.
When used, the xattribute user.ytdl.filesize will be set with the expected filesize. This can be useful for re-streaming the download somewhere else.
After reverting filesize xattr from master, re-add changes as feature…
Old pull request and discussion was #1176
Adapted in master. Thank you for your contribution!