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;