fix(downloads): a signed-in Facebook reel keeps its title, and an mp3 stays an mp3
Since a Facebook cookie was added on prod, every reel came down titled "Video": measured on dev, a signed-in read gives yt-dlp the placeholder "Video" (an 18+ reel read as Chrome gives "Facebook") while the post's text is still in the description. A new SourceAdapter.title hook takes the whole first line of the description in that case, and both title writes (the early fill and the finished download) go through it, so the row, the file name and the share preview carry the post's text again. The line is not cut with an ellipsis: normalize_title's NFKC turns "…" into "..." and collapses it to ".", which read as a finished sentence (seen in dev UAT). The "Audio (MP3)" profile's extracted .mp3 was remuxed into an .mp4 by the browser-safe step (the audio spec is clamped to container mp4 too) and served as video/mp4, which iPad's WebKit will not play (prod job 268). Audio mode now skips that step, so an .mp3 is served as audio/mpeg and an .m4a as audio/mp4. Audio downloads version their cache identity on their own (v5), so a cached remuxed audio re-derives without re-downloading every cached video.
This commit is contained in:
@@ -158,3 +158,15 @@ def test_a_normal_cut_list_is_untouched():
|
||||
segs = [{"start_s": 0, "end_s": 5}, {"start_s": 10, "end_s": 12}]
|
||||
out = editmod.normalize_edit_spec({"segments": segs})
|
||||
assert len(out["segments"]) == 2
|
||||
|
||||
|
||||
def test_audio_versions_its_cache_identity_apart_from_video(monkeypatch):
|
||||
# The .mp3/.m4a-stays-itself fix must re-derive cached remuxed audio WITHOUT re-downloading every
|
||||
# cached video: bumping one version moves only its own mode's signature.
|
||||
audio, video = {"mode": "a", "audio_format": "mp3"}, {"mode": "av"}
|
||||
before = formats.format_sig(audio), formats.format_sig(video)
|
||||
monkeypatch.setattr(formats, "_AUDIO_SIG_VERSION", formats._AUDIO_SIG_VERSION + 1)
|
||||
assert formats.format_sig(audio) != before[0]
|
||||
assert formats.format_sig(video) == before[1]
|
||||
monkeypatch.setattr(formats, "_SIG_VERSION", formats._SIG_VERSION + 1)
|
||||
assert formats.format_sig(video) != before[1]
|
||||
|
||||
Reference in New Issue
Block a user