Repository: yt-dlp
Issue: Keep intermediate files selectively
Labels: enhancement,core:post-processor

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm requesting a feature unrelated to a specific site
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've verified that I'm running yt-dlp version **2023.03.04** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Provide a description that is worded well enough to be understood

Would be nice to have a feature of something like  `--match-keep-files *.png` to keep both the png and jpg files after conversion of thumbnails when using a command such as `-convert-thumbnails png`

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output
```C:\Users\Mohammad Noor\Documents\yt-dlp> dl.exe -vU https://www.youtube.com/watch?v=G0EN4S4nNnw
[debug] Command-line config: ['-vU', 'https://www.youtube.com/watch?v=G0EN4S4nNnw']
[debug] User config "C:\Users\Mohammad Noor\AppData\Roaming\yt-dlp\config.txt": ['-P', 'D:/Youtube', '-o', '%(playlist_title)s\\%(title)s.%(ext)s', '-f', 'bestvideo+bestaudio', '--cookies-from-browser', 'chrome', '--write-thumbnail', '--convert-thumbnails', 'png', '--embed-thumbnail', '--write-description', '--add-metadata', '--merge-output-format', 'mkv', '--write-link', '-o', 'thumbnail:%(playlist_title)s\\Thumbnails\\%(title)s.%(ext)s', '-o', 'description:%(playlist_title)s\\Descriptions\\%(title)s.%(ext)s', '-o', 'link:%(playlist_title)s\\Links\\%(title)s.%(ext)s']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19043-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 2023-01-09-git-13d04e30d7-full_build-www.gyan.dev (setts), ffprobe 2023-01-09-git-13d04e30d7-full_build-www.gyan.dev, phantomjs 2.1.1
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[Cookies] Extracting cookies from chrome
[debug] Extracting cookies from: "C:\Users\Mohammad Noor\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies"
[debug] Found local state file at "C:\Users\Mohammad Noor\AppData\Local\Google\Chrome\User Data\Local State"
[Cookies] Extracted 3295 cookies from chrome
[debug] cookie version breakdown: {'v10': 3295, 'other': 0, 'unencrypted': 0}
[debug] Proxy map: {}
[debug] Loaded 1786 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.03.04, Current version: stable@2023.03.04
Current Build Hash: 5590c57bd0433ed239a2deaaf92e2ad6f37fe50f53664c821575cafe106a9421
yt-dlp is up to date (stable@2023.03.04)
[youtube] Extracting URL: https://www.youtube.com/watch?v=G0EN4S4nNnw
[youtube] G0EN4S4nNnw: Downloading webpage
[debug] [youtube] Extracted SAPISID cookie
[youtube] G0EN4S4nNnw: Downloading android player API JSON
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[info] G0EN4S4nNnw: Downloading 1 format(s): 248+251
[info] Writing video description to: D:\Youtube\NA\Descriptions\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.description
[info] Downloading video thumbnail 41 ...
[info] Writing video thumbnail 41 to: D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.webp
[info] Writing internet shortcut (.url) to: D:\Youtube\NA\Links\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.url
[ThumbnailsConvertor] Converting thumbnail "D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.webp" to png
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -f image2 -pattern_type none -i "file:D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.webp" -update 1 -movflags "+faststart" "file:D:\Youtube\NA\Episode 9 Preview  ｜ The Last of Us ｜ HBO Max.png"
Deleting original file D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.webp (pass -k to keep)
[debug] Invoking dashsegments downloader on "https://rr1---sn-gvbxgn-tt1es.googlevideo.com/videoplayback?expire=1678138496&ei=IAgGZNCdBoq0lu8Pk72SwAY&ip=99.246.76.79&id=o-AAbzNq9DBwECaa1XnN-aDPuvLZKS03yVAlYjZqvL4TBR&itag=248&source=youtube&requiressl=yes&mh=WH&mm=31%2C26&mn=sn-gvbxgn-tt1es%2Csn-vgqsknlz&ms=au%2Conr&mv=m&mvi=1&pl=21&initcwndbps=2268750&spc=H3gIhlUgIljclCxDLhE0TBB21Voi4Mqp2mgblp4e_f-6&vprv=1&svpuc=1&mime=video%2Fwebm&gir=yes&clen=3577525&dur=36.077&lmt=1678077867350428&mt=1678116559&fvip=5&keepalive=yes&fexp=24007246&c=ANDROID&txp=5535434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhANV07Yi2NM1xk0URTEmEHxzM3Avkx9Bsf9e24-oPTOBRAiBUWCDDO5FoDhDfSEcQSZ8KoT6XgEWeJHjVbGvA0f8WlA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgEO3hJsXDIKxxK5oUE3k093scLbL2Xkq6vi5DJGamSOwCICKCSE64ILM74eI0g7g2y5C3LyHBHaExrInQNvzNrmEn"
[dashsegments] Total fragments: 1
[download] Destination: D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.f248.webm
[debug] File locking is not supported. Proceeding without locking
[download] 100% of    3.41MiB in 00:00:00 at 8.49MiB/s
[debug] Invoking dashsegments downloader on "https://rr1---sn-gvbxgn-tt1es.googlevideo.com/videoplayback?expire=1678138496&ei=IAgGZNCdBoq0lu8Pk72SwAY&ip=99.246.76.79&id=o-AAbzNq9DBwECaa1XnN-aDPuvLZKS03yVAlYjZqvL4TBR&itag=251&source=youtube&requiressl=yes&mh=WH&mm=31%2C26&mn=sn-gvbxgn-tt1es%2Csn-vgqsknlz&ms=au%2Conr&mv=m&mvi=1&pl=21&initcwndbps=2268750&spc=H3gIhlUgIljclCxDLhE0TBB21Voi4Mqp2mgblp4e_f-6&vprv=1&svpuc=1&mime=audio%2Fwebm&gir=yes&clen=403281&dur=36.101&lmt=1678075197377360&mt=1678116559&fvip=5&keepalive=yes&fexp=24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRAIgOGXgjihm5H5gzJ-1WGyiXZ1AU-7EQNAXOLUXsanSnLcCICnPvmY0WZKkbqIdaFThpF2x1epq5q55-rZgNOyoZCYi&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgEO3hJsXDIKxxK5oUE3k093scLbL2Xkq6vi5DJGamSOwCICKCSE64ILM74eI0g7g2y5C3LyHBHaExrInQNvzNrmEn"
[dashsegments] Total fragments: 1
[download] Destination: D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.f251.webm
[download] 100% of  393.83KiB in 00:00:00 at 2.45MiB/s
[Merger] Merging formats into "D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.mkv"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.f248.webm" -i "file:D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.f251.webm" -c copy -map "0:v:0" -map "1:a:0" -movflags "+faststart" "file:D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.temp.mkv"
Deleting original file D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.f248.webm (pass -k to keep)
Deleting original file D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.f251.webm (pass -k to keep)
[Metadata] Adding metadata to "D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.mkv"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.mkv" -map 0 -dn -ignore_unknown -c copy -write_id3v1 1 -metadata "title=Episode 9 Preview | The Last of Us | HBO Max" -metadata "date=20230306" -metadata "description=Season Finale of The Last of Us premieres next Sunday at 9 pm ET on HBO Max.
#thelastofus #tlou

About HBO Max:
HBO Max is WarnerBrosDiscovery’s direct-to-consumer offering with 10,000 hours of curated premium content. HBO Max offers powerhouse programming for everyone in the home, bringing together HBO, a robust slate of new original series, key third-party licensed programs and movies, and fan favorites from WarnerMedia’s rich library including Warner Bros., New Line, DC, CNN, TNT, TBS, truTV, Turner Classic Movies, Cartoon Network, Adult Swim, Crunchyroll, Rooster Teeth, Looney Tunes and more. #HBOMax #WarnerBrosDiscovery

SUBSCRIBE TO HBO MAX
http://bit.ly/HBOMaxYouTube

GET HBO MAX
https://itsh.bo/ways-to-get

MORE HBO MAX
HBO Max: https://hbom.ax/YT 
Follow HBO Max on Instagram: http://bit.ly/HBOMaxInstagram
Follow HBO Max on TikTok: https://hbom.ax/HBOMaxTT
Follow HBO Max on Twitter: http://bit.ly/HBOMaxTwitter 
Like HBO Max on Facebook: http://bit.ly/HBOMaxFacebook" -metadata "synopsis=Season Finale of The Last of Us premieres next Sunday at 9 pm ET on HBO Max.
#thelastofus #tlou

About HBO Max:
HBO Max is WarnerBrosDiscovery’s direct-to-consumer offering with 10,000 hours of curated premium content. HBO Max offers powerhouse programming for everyone in the home, bringing together HBO, a robust slate of new original series, key third-party licensed programs and movies, and fan favorites from WarnerMedia’s rich library including Warner Bros., New Line, DC, CNN, TNT, TBS, truTV, Turner Classic Movies, Cartoon Network, Adult Swim, Crunchyroll, Rooster Teeth, Looney Tunes and more. #HBOMax #WarnerBrosDiscovery

SUBSCRIBE TO HBO MAX
http://bit.ly/HBOMaxYouTube

GET HBO MAX
https://itsh.bo/ways-to-get

MORE HBO MAX
HBO Max: https://hbom.ax/YT 
Follow HBO Max on Instagram: http://bit.ly/HBOMaxInstagram
Follow HBO Max on TikTok: https://hbom.ax/HBOMaxTT
Follow HBO Max on Twitter: http://bit.ly/HBOMaxTwitter 
Like HBO Max on Facebook: http://bit.ly/HBOMaxFacebook" -metadata "purl=https://www.youtube.com/watch?v=G0EN4S4nNnw" -metadata "comment=https://www.youtube.com/watch?v=G0EN4S4nNnw" -metadata "artist=HBO Max" -movflags "+faststart" "file:D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.temp.mkv"
[debug] ffprobe command line: ffprobe -hide_banner -show_format -show_streams -print_format json "file:D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.mkv"
[EmbedThumbnail] ffmpeg: Adding thumbnail to "D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.mkv"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.mkv" -map 0 -dn -ignore_unknown -c copy -attach "D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.png" "-metadata:s:2" "mimetype=image/png" "-metadata:s:2" "filename=cover.png" -movflags "+faststart" "file:D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.temp.mkv"
[MoveFiles] Moving file "D:\Youtube\NA\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.png" to "D:\Youtube\NA\Thumbnails\Episode 9 Preview ｜ The Last of Us ｜ HBO Max.png"```