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

write ID, URL to metadata #16196

Closed
exekutive opened this issue Apr 16, 2018 · 25 comments
Closed

write ID, URL to metadata #16196

exekutive opened this issue Apr 16, 2018 · 25 comments

Comments

@exekutive
Copy link

@exekutive exekutive commented Apr 16, 2018

I would like to be able to write a Youtube video's ID and/or URL to the output file metadata. My testing suggests that, using the 'add-metadata' option only the writes the video title, channel name (author), and description.

version 2018.04.16

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 16, 2018

URL is already written.

@dstftw dstftw closed this Apr 16, 2018
@exekutive
Copy link
Author

@exekutive exekutive commented Apr 16, 2018

Please show me where.

screen shot 2018-04-15 at 21 55 35
screen shot 2018-04-15 at 21 56 28

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 16, 2018

@exekutive
Copy link
Author

@exekutive exekutive commented Apr 16, 2018

Sorry, I don't understand source code. Can you please elaborate ...
Is it an issue with the input format, or output?

I think it would be nice to at least write at least something, like URL or ID, to the album field or whatever. It's important to record where a video was downloaded from.

@exekutive
Copy link
Author

@exekutive exekutive commented Apr 19, 2018

which formats DO support it?

@Najrim
Copy link

@Najrim Najrim commented Nov 28, 2018

I was trying to do the same thing. In case someone else is having trouble, here's how it works:

  • Use the --add-metadata option when you download something
  • Edit: you also need --audio-format to be opus, ogg or something else that can hold the purl tag. Mp3 doesn't work.
  • Open the downloaded file in a tag editor such as Ex Falso. The url is in a field called purl.
  • If you want it to be in the album field, find a method to copy it over.
    • In Ex Falso it's simple. Double blick purl and replace it with album or whatever you want it to be.
@exekutive
Copy link
Author

@exekutive exekutive commented Nov 29, 2018

Nope. Still don't see it.

screen shot 2018-11-28 at 23 11 13

@Najrim
Copy link

@Najrim Najrim commented Nov 30, 2018

I only tried it with the --audio-format opus option. I think ogg and flac uses the same way of saving metadata so those should work too. What format did you use? I tried mp3 now and it doesn't add that tag.

@Najrim
Copy link

@Najrim Najrim commented Nov 30, 2018

It doesn't need to be a pure music file. If your config is empty you will get the PURL tag in a mkv file if you do:

youtube-dl --add-metadata --audio-format ogg youtube.com/watch?v=videoid
@exekutive
Copy link
Author

@exekutive exekutive commented Dec 5, 2018

MP4, because it's widely adopted.
I never use ogg, flac or mkv.
Like I suggested before: If a URL tag isn't directly supported, then it could written to one of the many other tags, such as album (since it is not used anyway).

@Najrim
Copy link

@Najrim Najrim commented Dec 7, 2018

Seems someone is working on it: #17904

Really looking forward to this. Thanks @mx1up

When this is merged I think we can write something like --postprocessor-args "-metadata album=%(url)s".

@mx1up
Copy link

@mx1up mx1up commented Dec 11, 2018

yep, that's correct :) it already works here locally but requires some review by @dstftw / youtube-dl team before it can be merged.

@exekutive
Copy link
Author

@exekutive exekutive commented Dec 13, 2018

Great! I hope the author decides it's worthwhile this time and not just dismiss it.

@megapro17
Copy link

@megapro17 megapro17 commented Mar 19, 2019

Seems someone is working on it: #17904

Really looking forward to this. Thanks @mx1up

When this is merged I think we can write something like --postprocessor-args "-metadata album=%(url)s".

Not working anymore

@mx1up
Copy link

@mx1up mx1up commented Mar 20, 2019

I'll have a look

@megapro17
Copy link

@megapro17 megapro17 commented Mar 20, 2019

So I think problem is here #17904

@exekutive
Copy link
Author

@exekutive exekutive commented Mar 29, 2019

Seems someone is working on it: #17904

Really looking forward to this. Thanks @mx1up

When this is merged I think we can write something like --postprocessor-args "-metadata album=%(url)s".

It's not working for me. Is it still being worked on?

@megapro17
Copy link

@megapro17 megapro17 commented Mar 29, 2019

Seems someone is working on it: #17904
Really looking forward to this. Thanks @mx1up
When this is merged I think we can write something like --postprocessor-args "-metadata album=%(url)s".

It's not working for me. Is it still being worked on?

Just use webm or mkv

@exekutive
Copy link
Author

@exekutive exekutive commented Mar 30, 2019

no thanks. Those are useless formats.

@exekutive
Copy link
Author

@exekutive exekutive commented Mar 30, 2019

I think you need to unplug yourself from the computer once in a while.

@exekutive
Copy link
Author

@exekutive exekutive commented Apr 1, 2019

I think that it's none of your business what I use. I also think you are taking this matter far too personally. I also think you need a reality check. MP4 plays on everything. The containers you call "open and free" are actually "not widely adopted". I also think you have nothing valuable to add to this thread and are wasting your time.

@con-f-use
Copy link

@con-f-use con-f-use commented May 25, 2019

So is there currently a way to embed the video URL in the meta data?

Because when I do something like:

$ youtube-dl --add-metadata --postprocessor-args "-metadata copyright=%(url)s" -f "bestvideo[ext=webm]+bestaudio/best"

What I get is:

image


What format people want is up to them. However, if they choose to use non-open ones, they shoudn't be surprised when other software can't play nice with their choice.

@exekutive
Copy link
Author

@exekutive exekutive commented Dec 31, 2019

MP4 uses a standard ISO container. Show me where it says you need licensed software to write metadata.

@sepehrkiller
Copy link

@sepehrkiller sepehrkiller commented Jan 28, 2020

can we do anything to save in a txt file or in metadata file? or the .description file?
anyone knows anything about this? it would be cool to be able to save url in a txt file alongside the video

@jxu
Copy link
Contributor

@jxu jxu commented Jul 10, 2020

@sepehrkiller it is saved in --write-info-json which can be filtered with jq. alternatively --get-url gets raw url and --get-id gets video id to print to stdout

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
8 participants
You can’t perform that action at this time.