Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would like to add extended attributes to saved file #8668

Closed
sgargbugreporter opened this issue Feb 26, 2016 · 7 comments
Closed

Would like to add extended attributes to saved file #8668

sgargbugreporter opened this issue Feb 26, 2016 · 7 comments

Comments

@sgargbugreporter
Copy link

@sgargbugreporter sgargbugreporter commented Feb 26, 2016

Hi,

I want to add extended attributes (for example discussed in https://www.freedesktop.org/wiki/CommonExtendedAttributes/) to the downloaded file. I see that there is an option "xattr_set_filesize" available.

Can someone point me to where I can add extended attributes to the downloaded file. I am primarily looking to store the source URL and other metadata as extended attributes.

Thanks.

@sgargbugreporter
Copy link
Author

@sgargbugreporter sgargbugreporter commented Feb 26, 2016

There is an error in the extended attributes code in the youtube_dl/downloader/http.py file.

Patch attached.
http.py.patch.txt

@sgargbugreporter
Copy link
Author

@sgargbugreporter sgargbugreporter commented Feb 26, 2016

I have added extended attributes code in youtube_dl/YoutubeDL.py. Patch attached.

This is in the post_process() function. Any better place to put it?

Thanks.
YoutubeDL.py.patch.txt

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 12, 2016

Sorry for the late response. Looks like the two patches point to different problems.

For http.py.patch.txt: Could you create a pull request and describe what's the problem you have encountered before this patch? From your patch I guess you've got a similar problem as #5498 - you need to use python-pyxattr 0.5.0 or above for youtube-dl.

For YoutubeDL.py.patch.txt: There are already some attributes defined in xattr_mapping of xattrpp.py. Add more attributes there. These attributes are not written by default. Use --xattr to enable them.

@sgargbugreporter
Copy link
Author

@sgargbugreporter sgargbugreporter commented Mar 26, 2016

Regarding version ox xattr, I am using xattr. Details below:

Metadata-Version: 1.1
Name: xattr
Version: 0.7.9
Summary: Python wrapper for extended filesystem attributes
Home-page: http://github.com/xattr/xattr
Author: Bob Ippolito
Author-email: bob@redivi.com
License: MIT License

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 26, 2016

Is there any error message? Please post the command with -v and all outputs.

@sgargbugreporter
Copy link
Author

@sgargbugreporter sgargbugreporter commented Mar 26, 2016

I have the patched version. I was using xattr and had to do the patching. Have just installed "python-pyxattr 0.5.5-2", and uninstalled xattr. It works with my patched version. We rebuild a fresh (non-patched) version and test again.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 1, 2016

I've rewritten some xattr related codes in youtube-dl. Some changes are quite similar to your proposed patches, so I bet all problems are solved. Feel free to leave comments if there are still issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.