27 lines
No EOL
690 B
Zig
27 lines
No EOL
690 B
Zig
const std = @import("std");
|
|
const url = @import("url.zig");
|
|
const json = @import("json.zig");
|
|
|
|
const dbg_print = std.debug.print;
|
|
const eql = std.mem.eql;
|
|
|
|
|
|
pub fn main() !void {
|
|
// gpa allocator
|
|
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
|
defer _ = gpa.deinit();
|
|
const allocator = gpa.allocator();
|
|
|
|
const args = try std.process.argsAlloc(allocator);
|
|
defer std.process.argsFree(allocator, args);
|
|
|
|
if (eql(u8, args[1], "help")) {
|
|
dbg_print("Help :)\n", .{});
|
|
}
|
|
|
|
const data = try url.fetch(allocator, "https://tidal.401658.xyz/track/?id=286266927&quality=LOSSLESS");
|
|
defer allocator.free(data);
|
|
|
|
try json.extract(allocator, data);
|
|
|
|
} |