youtube-dl icon indicating copy to clipboard operation
youtube-dl copied to clipboard

Embed-thumbnail fails with Twitch clips

Open Bertaz opened this issue 3 years ago • 2 comments

Checklist

  • [ ] I'm reporting a broken site support issue
  • [x] I've verified that I'm running youtube-dl version 2021.06.06
  • [x] I've checked that all provided URLs are alive and playable in a browser
  • [x] I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • [x] I've searched the bugtracker for similar bug reports including closed ones
  • [x] I've read bugs section in FAQ

Verbose log

youtube-dl:

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-wf', 'best', '--embed-thumbnail', '--download-archive', '.\\archive.txt', '-a', '.\\clipsLink.txt', '-v']
[debug] Batch file urls: ['https://clips.twitch.tv/PlayfulCoweringGooseStoneLightning--WzJYPuOxk4i3Qi0?tt_medium=my_clips', 'https://clips.twitch.tv/CrispyAntsyReubenBabyRage-dITUtFaLGeSXw3Yq?tt_medium=my_clips', 'https://clips.twitch.tv/FragileGloriousTubersAliens-cLbE6cbf8fXKU9_9?tt_medium=my_clips', 'https://clips.twitch.tv/PoorOriginalVanillaPeteZaroll-M7RBXE1u9EX-ICat?tt_medium=my_clips', 'https://clips.twitch.tv/GoldenHorribleShrewRalpherZ-8LVjToaX0E7XtvEI?tt_medium=my_clips', 'https://clips.twitch.tv/ObservantBadShingleLitty-oVeMKepeBzcT_4S_?tt_medium=my_clips', 'https://clips.twitch.tv/CoySpeedyPoultrySMOrc?tt_medium=my_clips', 'https://clips.twitch.tv/BelovedFaithfulClintGivePLZ?tt_medium=my_clips', 'https://clips.twitch.tv/DignifiedFunnySpiderPeoplesChamp?tt_medium=my_clips', 'https://clips.twitch.tv/SillyToughAlmondLeeroyJenkins?tt_medium=my_clips', 'https://clips.twitch.tv/FreezingCogentAniseUnSane?tt_medium=my_clips', 'https://clips.twitch.tv/StormyGoldenKangarooOpieOP?tt_medium=my_clips', 'https://clips.twitch.tv/UnsightlyBlatantChipmunkOMGScoots?tt_medium=my_clips', 'https://clips.twitch.tv/EnjoyableFurryBatteryWOOP?tt_medium=my_clips']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: ffmpeg N-102574-gaae810c233, ffprobe N-102574-gaae810c233
[debug] Proxy map: {}
[twitch:clips] PlayfulCoweringGooseStoneLightning--WzJYPuOxk4i3Qi0: Downloading clip access token GraphQL
[twitch:clips] PlayfulCoweringGooseStoneLightning--WzJYPuOxk4i3Qi0: Downloading clip GraphQL
[download] GommaGatto has already been recorded in archive
	[...]
[twitch:clips] CoySpeedyPoultrySMOrc: Downloading clip access token GraphQL
[twitch:clips] CoySpeedyPoultrySMOrc: Downloading clip GraphQL
[download] Entrate alternative has already been recorded in archive
[twitch:clips] BelovedFaithfulClintGivePLZ: Downloading clip access token GraphQL
[twitch:clips] BelovedFaithfulClintGivePLZ: Downloading clip GraphQL
[twitch:clips] 1017785185: Downloading thumbnail ...
[twitch:clips] 1017785185: Writing thumbnail to: Un altra piega-1017785185.jpg
[debug] Invoking downloader on 'https://production.assets.clips.twitchcdn.net/AT-cm%7C1017785185.mp4?sig=72b39f7306f35541798087e0998b14d7275b5ad0&token=%7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22clip_uri%22%3A%22https%3A%2F%2Fproduction.assets.clips.twitchcdn.net%2FAT-cm%257C1017785185.mp4%22%2C%22device_id%22%3Anull%2C%22expires%22%3A1626516959%2C%22user_id%22%3A%22%22%2C%22version%22%3A2%7D'
[download] Un altra piega-1017785185.mp4 has already been downloaded
[download] 100% of 14.84MiB
[atomicparsley] Adding thumbnail to "Un altra piega-1017785185.mp4"
[debug] AtomicParsley command line: AtomicParsley "Un altra piega-1017785185.mp4" --artwork "Un altra piega-1017785185.jpg" -o "Un altra piega-1017785185.temp.mp4"
ERROR:
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 2115, in post_process
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\postprocessor\embedthumbnail.py", line 116, in run
youtube_dl.postprocessor.embedthumbnail.EmbedThumbnailPPError

AtomicParsley:

λ AtomicParsley "Un altra piega-1017785185.mp4" --artwork "Un altra piega-1017785185.jpg" -o "Un altra piega-1017785185.temp.mp4"
AtomicParsley error: Un altra piega-1017785185.jpg
         image file is not jpg/png and cannot be embedded.

Description

Downloading clips from Twitch with --embed-thumbnail sometimes fails. AtomicParsley doesn't recognize the jpg file as a jpg. In the given list, which is ordered as creation date descending, all clips, except the first 2 and the last 4, fails. Re-formatting the image to jpg fixes the issue e.g. with mogrify.exe -format jpg *.jpg

Youtube-dl should say what the error is and even better try to reformat the image with mogrify or ffmpeg when AtomicParsley complains.

clipsLink.txt

Bertaz avatar Jul 16 '21 15:07 Bertaz

Similar to #29555 (same AtomicParsley error)

Bertaz avatar Jul 16 '21 15:07 Bertaz

You can embed image with FFmpeg now, so you don't even need AtomicParsley:

You were already able to embed image with FFmpeg when I opened the issue. The issue where --embed-thumbnail doesn't work how it's supposed to, isn't fixed. The pull requests linked would fix both the problems

I'm currently using yt-dlp/yt-dlp which had already fixed this issue before I reported it here. #30568 means in the future this issue may be solved, but unless you can only run python 2 I would argue to use yt-dlp in the mean time

Bertaz avatar May 08 '22 17:05 Bertaz