From a7f1f5f6ffe3358aca3bdd42a9fc290047df08b0 Mon Sep 17 00:00:00 2001 From: Pierre De Lancre Date: Wed, 18 Nov 2026 09:53:24 +0300 Subject: [PATCH] =?UTF-8?q?harness:=20keep=20//=20prefix=20in=20norm?= =?UTF-8?q?alized=20x.com=20URLs=20=E2=80=94=20dropping=20the=20screen=20n?= =?UTF-8?q?ame=20made=20yt-dlp=20reject=20the=20retry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/matrix_harness.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/matrix_harness.zig b/src/matrix_harness.zig index 1190408..24faae1 100644 --- a/src/matrix_harness.zig +++ b/src/matrix_harness.zig @@ -470,7 +470,10 @@ fn normalizeXUrl(alloc: std.mem.Allocator, url: []const u8) ?[]u8 { var id_len: usize = 0; while (id_len < rest.len and std.ascii.isDigit(rest[id_len])) id_len += 1; if (id_len == 0) return null; - const bare = std.fmt.allocPrint(alloc, "https://{s}/status/{s}", .{ host, rest[0..id_len] }) catch return null; + // Keep the full prefix (e.g. "//status/") — dropping the screen + // name yields "x.com/status/", which yt-dlp rejects as unsupported. + const prefix_len = status_idx + marker.len + id_len; + const bare = std.fmt.allocPrint(alloc, "https://{s}{s}", .{ host, path[0..prefix_len] }) catch return null; if (std.mem.eql(u8, bare, url)) { alloc.free(bare); return null;