Export to GitHub

get-flash-videos - issue #531

Feature Request: Put the source URL in the file's xattrs


Posted on Aug 20, 2013 by Massive Monkey

I just noticed today that Chrome has an excellent feature -- it puts the URL that you download a file from in the file's extended attributes.

Here's an example:

file: Bret Victor - Media for Thinking the Unthinkable (2013).mp4

user.xdg.origin.url="http://pdl.vimeocdn.com/51867/368/167262784.mp4?token=1370019941_fd03e60e7a0dc088e95e66dd3fd4a0bf" user.xdg.referrer.url="http://vimeo.com/67076984"

I think it would be great if get-flash-videos supported this feature. It would make it easy to archive videos, but still give people links to them, or be able to download a higher-quality version at a later date.

Comment #1

Posted on Aug 20, 2013 by Massive Monkey

Here's a nice simple Perl wrapper around the xattr system calls: http://search.cpan.org/~opi/Linux-UserXAttr-0.02/lib/Linux/UserXAttr.pm

Comment #2

Posted on Aug 20, 2013 by Massive Monkey

Another good use for these xattrs is as a sanity check when resuming a download, so that you don't accidentally resume a youtube video with a different video ID.

It might also be useful to store other metadata, like the quality level. I've downloaded corrupted videos by accident before by doing something like this:

$ get-flash-videos

^C $ get-flash-videos -r medium

If the quality level was stored in the xattr, when the user tried to download at a different quality setting, it could prompt the user to overwrite the file, or to resume with the proper quality setting.

Comment #3

Posted on Aug 26, 2013 by Massive Camel

get_flash_videos has to be portable and work on Windows, MAC, and so on. I use OpenBSD myself. The clue this isn't portable is in the name, to be sure look at the cpan perl version/platform coverage.

The example given the token may only be valid for a short period, storing that may not be such a good idea if that is the case.

The mp4 file format includes quality already, ffprobe can extract, mp4 may also include additional metadata.

Comment #4

Posted on Aug 27, 2013 by Massive Monkey

There are some good use cases for this feature:


1) The Archivist

People who are archiving content from Youtube, Vimeo, etc., so that if a video gets taken down, they'll have a record of where it came from. They could then figure out a way to publish it so that people looking for the original can find it.


2) The Video Creator/Remixer (for attribution)

If you're using other people's clips in your own video, you should be giving attribution. This would allow you to easily keep a record of where the clips came from without having to resort to manually maintaining your own database of filenames and urls.


The concern about portability shouldn't be an issue. If an operating system doesn't support extended attributes, then get-flash-videos can still download the file.

I'm not sure if you were aware, but all modern filesystems support extended attributes. See: http://en.wikipedia.org/wiki/Extended_attribute

The two major platofrms have a different name for them -- "Resource Forks" on Mac OSX, "Alternate Data Streams" on Windows -- but they function identically. (In fact, Linux's NTFS driver just pretends that NTFS' "Alternate Data Streams" are xattrs.)

Status: New

Labels:
Type-Defect Priority-Medium