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

Thumbnail is not embedded into audio files even with "Embed Thumbnails" turned on #538

Open
SSS-Says-Snek opened this issue Aug 24, 2024 · 2 comments

Comments

@SSS-Says-Snek
Copy link

I'm using tubesync to download audio files from my playlist and play them on my phone (with the Musicolet app). I turned on both "Embed thumbnail" and "Embed metadata", and while metadata seems to be working fine, the thumbnails are not appearing in the previews.
image

What I tried

I tried many different combinations of embedding thumbnail, embedding metadata, writing NFO, and changing the audio codec. None of them had any embedded thumbnails.

I also wrote a test script to see if anything was wrong with yt-dlp. However, I saw that this actually did embed the thumbnail into the file:

import yt_dlp

ytopts = {
    'format': 'm4a',
    'writethumbnail': True,
    'postprocessors': [{'key': 'FFmpegMetadata', 'add_metadata': True}, {'key': 'EmbedThumbnail'}],
    'quiet': False
}
with yt_dlp.YoutubeDL(ytopts) as y:
    y.download(['https://www.youtube.com/watch?v=aSXtXLAVgkE'])

with the output

[youtube] Extracting URL: https://www.youtube.com/watch?v=aSXtXLAVgkE
[youtube] aSXtXLAVgkE: Downloading webpage
[youtube] aSXtXLAVgkE: Downloading ios player API JSON
[youtube] aSXtXLAVgkE: Downloading web creator player API JSON
[youtube] aSXtXLAVgkE: Downloading m3u8 information
[info] aSXtXLAVgkE: Downloading 1 format(s): 140
[info] Downloading video thumbnail 46 ...
[info] Writing video thumbnail 46 to: Rachmaninoff: Piano Concerto #3 (Weissenberg 1968) [with score] [aSXtXLAVgkE].webp
[download] Destination: Rachmaninoff: Piano Concerto #3 (Weissenberg 1968) [with score] [aSXtXLAVgkE].m4a
[download] 100% of   40.05MiB in 00:00:04 at 9.37MiB/s
[FixupM4a] Correcting container of "Rachmaninoff: Piano Concerto #3 (Weissenberg 1968) [with score] [aSXtXLAVgkE].m4a"
[Metadata] Adding metadata to "Rachmaninoff: Piano Concerto #3 (Weissenberg 1968) [with score] [aSXtXLAVgkE].m4a"
[ThumbnailsConvertor] Converting thumbnail "Rachmaninoff: Piano Concerto #3 (Weissenberg 1968) [with score] [aSXtXLAVgkE].webp" to png
[EmbedThumbnail] mutagen: Adding thumbnail to "Rachmaninoff: Piano Concerto #3 (Weissenberg 1968) [with score] [aSXtXLAVgkE].m4a"
Tubesync Test script
image image

I skimmed tubesync's codebase, and I think that my test script's writethumbnail option may have something to do with it? I'm not sure though, since I can't test it because manually running tubesync without a container doesn't seem to be working for me (#534)

I also might be entirely getting the wrong idea of what embedding thumbnails is supposed to do 😅 Regardless, loving tubesync rn! Keep up the good work!

@DorH92
Copy link

DorH92 commented Aug 25, 2024

Same here. Thumbnail doesn't get embedded in the audio files..

@meeb
Copy link
Owner

meeb commented Aug 25, 2024

Thanks for the issue. There are occasions where a relatively esoteric combination of yt-dlp and ffmpeg flags are required to get some metadata features to work. tubesync does set the same keys as you:

https://github.com/meeb/tubesync/blob/main/tubesync/sync/youtube.py#L164

The only difference is tubesync doesn't set 'writethumbnail': True for yt-dlp because thumbnails are downloaded separately and enabling this would download two copies of thumbnails with different file names.

I'll poke into it but it would seem that this particular container / encoding pair might require 'writethumbnail': True to work if your test is correct.

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

No branches or pull requests

3 participants