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

--metadata-from-title does not add composer metadata #16878

Open
Darksonn opened this issue Jun 30, 2018 · 0 comments
Open

--metadata-from-title does not add composer metadata #16878

Darksonn opened this issue Jun 30, 2018 · 0 comments

Comments

@Darksonn
Copy link

@Darksonn Darksonn commented Jun 30, 2018

  • I've verified and I assure that I'm running youtube-dl 2018.06.25
  • I've at least skimmed through the README, most notably the FAQ and BUGS sections
  • I've searched the bugtracker for similar issues including closed ones
  • I've checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The commandline option --metadata-from-title allows adding various tags to the metadata of the file, however it appears to ignore the tags actually found by the option if they're not in this list of tags.

As an example, see the command below:

$ youtube-dl -v --ignore-config https://soundcloud.com/lilbearshawty/nirvana --metadata-from-title ".*prod[.]? +(?P<composer>[a-z]+).*" --add-metadata 
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--ignore-config', 'https://soundcloud.com/lilbearshawty/nirvana', '--metadata-from-title', '.*prod[.]? +(?P<composer>[a-z]+).*', '--add-metadata']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.06.25
[debug] Python version 3.6.5 (CPython) - Linux-4.17.2-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 4.0.1, ffprobe 4.0.1, rtmpdump 2.4
[debug] Proxy map: {}
[soundcloud] lilbearshawty/nirvana: Resolving id
[soundcloud] lilbearshawty/nirvana: Downloading info JSON
[soundcloud] 382186547: Downloading track url
[soundcloud] 382186547: Downloading m3u8 information
[soundcloud] 382186547: Downloading m3u8 information
[soundcloud] 382186547: Checking http_mp3_128_url video format URL
[soundcloud] 382186547: Checking hls_mp3_128_url video format URL
[soundcloud] 382186547: Checking hls_opus_64_url video format URL
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://cf-media.sndcdn.com/0CwKhFKg78df.128.mp3?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLW1lZGlhLnNuZGNkbi5jb20vMEN3S2hGS2c3OGRmLjEyOC5tcDMiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE1MzAzOTA2ODF9fX1dfQ__&Signature=bE3NTgujnuavmrOtlOmTeWKU5N4R1hQT690SSBFLPci-VZTIRIHlnD6UPEp4jp97Y6lUHB5kyRRipJPIhdqNas3Lsf1CeB0LA~9fHCxaGKdLbiaOzfbnC0KJlK2uBwnzURLzimCLQsSY~tuGiV3EeJfNgQq5L1RCCvi-iN51oSC1WHiChAGFlpZq8w-~20poHFy7SCI7libOh6djWYW~SA0Mgef6XlOUtV8J7bbJ6n24LAhZlygzWLDGKj2tJEiRAiYSqxTN5qXz-6SZEN~E-aQExSzrGzx4IRH4KHgkJpBQ7eyLU8lNHxS1JvlBrmyw~Igq0bsohIjFGaGXUycoqQ__&Key-Pair-Id=APKAJAGZ7VMH2PFPW6UQ'
[download] nirvana (prod. rusher)-382186547.mp3 has already been downloaded
[download] 100% of 2.45MiB
[fromtitle] parsed composer: rusher
[ffmpeg] Adding metadata to 'nirvana (prod. rusher)-382186547.mp3'
[debug] ffmpeg command line: ffmpeg -y -i 'file:nirvana (prod. rusher)-382186547.mp3' -c copy -metadata 'title=nirvana (prod. rusher)' -metadata date=20180111 -metadata 'description=happy birthday 2 me !' -metadata 'comment=happy birthday 2 me !' -metadata purl=https://soundcloud.com/lilbearshawty/nirvana -metadata 'artist=♡❀lilbearshawty❀♡' 'file:nirvana (prod. rusher)-382186547.temp.mp3'

Here we have used the regular expression .*prod[.]? +(?P<composer>[a-z]+).* to select the composer of the music file from the filename, and as seen from [fromtitle] parsed composer: rusher it correctly used this to find the composer.

However if we run the command exiftool nirvana\ \(prod.\ rusher\)-382186547.mp3 | grep Composer we will find that it produces no output, since the tag was not actually added to the file.

We can also see that this is the case from the ffmpeg commandline on the last line of the output, where the composer is absent.

If we add -metadata composer=rusher to the commandline and run it manually, we will find that it is successfully added to the file:

$ ffmpeg -y -i 'file:nirvana (prod. rusher)-382186547.mp3' -c copy -metadata 'title=nirvana (prod. rusher)' -metadata date=20180111 -metadata 'description=happy birthday 2 me !' -metadata 'comment=happy birthday 2 me !' -metadata composer=rusher -metadata purl=https://soundcloud.com/lilbearshawty/nirvana -metadata 'artist=♡❀lilbearshawty❀♡' 'file:nirvana (prod. rusher)-382186547.temp.mp3' >/dev/null 2>/dev/null
$ exiftool nirvana\ \(prod.\ rusher\)-382186547.temp.mp3 | grep Composer
Composer                        : rusher

This issue is not present on the known tags. An example using the tag artist is shown below:

$ youtube-dl -v --ignore-config https://soundcloud.com/lilbearshawty/nirvana --metadata-from-title ".*prod[.]? +(?P<artist>[a-z]+).*" --add-metadata 
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--ignore-config', 'https://soundcloud.com/lilbearshawty/nirvana', '--metadata-from-title', '.*prod[.]? +(?P<artist>[a-z]+).*', '--add-metadata']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.06.25
[debug] Python version 3.6.5 (CPython) - Linux-4.17.2-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 4.0.1, ffprobe 4.0.1, rtmpdump 2.4
[debug] Proxy map: {}
[soundcloud] lilbearshawty/nirvana: Resolving id
[soundcloud] lilbearshawty/nirvana: Downloading info JSON
[soundcloud] 382186547: Downloading track url
[soundcloud] 382186547: Downloading m3u8 information
[soundcloud] 382186547: Downloading m3u8 information
[soundcloud] 382186547: Checking http_mp3_128_url video format URL
[soundcloud] 382186547: Checking hls_mp3_128_url video format URL
[soundcloud] 382186547: Checking hls_opus_64_url video format URL
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://cf-media.sndcdn.com/0CwKhFKg78df.128.mp3?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLW1lZGlhLnNuZGNkbi5jb20vMEN3S2hGS2c3OGRmLjEyOC5tcDMiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE1MzAzOTE1NzV9fX1dfQ__&Signature=dZzz527uiKYn92pGFJTXs0W~FaeoMEyST1P6HfabzTHRZs2QtSeyfwNUOFqf9HHzSxNHBo~3YEHLJW1zwDznvtK9RNRxqhjQjfcLpNypRo83uWwvE8LBRwN5y6FHawCK0oGUesMIH3XzzUiLP~Typc7zZJfavWwzYj78I8-SJ45RiunGfYZR3~ts-X-jCLasG24NoYlIkliu9jqEl5QgLjC0suMetZ451lmtZDM4tq5FItJZmYZdyWzCL5gJrGwWsmdONQYjwRzGLlp4lgnkPsrWQM8ZPtYLj19xzFFh7xxCi1~Dgb9um8hfbDIt13aN5WvBxXRGJ~XO2grPtALk5g__&Key-Pair-Id=APKAJAGZ7VMH2PFPW6UQ'
[download] Destination: nirvana (prod. rusher)-382186547.mp3
[download] 100% of 2.44MiB in 00:01
[fromtitle] parsed artist: rusher
[ffmpeg] Adding metadata to 'nirvana (prod. rusher)-382186547.mp3'
[debug] ffmpeg command line: ffmpeg -y -i 'file:nirvana (prod. rusher)-382186547.mp3' -c copy -metadata 'title=nirvana (prod. rusher)' -metadata date=20180111 -metadata 'description=happy birthday 2 me !' -metadata 'comment=happy birthday 2 me !' -metadata purl=https://soundcloud.com/lilbearshawty/nirvana -metadata artist=rusher 'file:nirvana (prod. rusher)-382186547.temp.mp3'
$ exiftool nirvana\ \(prod.\ rusher\)-382186547.mp3 | grep Artist
Artist                          : rusher

The issue must be that the tag composer is ignored for some reason. I assume this is because somewhere it loops through the aforementioned list of tags and only adds the ones it knows to the ffmpeg commandline, or it is otherwise filtered on the way there.

My main proposal is that unknown tags in the --metadata-from-title option should be added to the ffmpeg command, since there are surely other tags than composer with this issue, but I suppose that adding composer to the list of known tags would also be a solution.

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