scraperjavascript336
Linkvertise - Fast URL Resolver & Metadata Engine
Engine resolver untuk link Linkvertise (linkvertise.com, direct-link.net, link-to.net, dll) via native GraphQL API. Mengambil destination URL, target host, title, dan info publisher tanpa ad wall.
Vamz Spectre13 Okt 2026164 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/linkvertise" -o linkvertise.js
# 2. Jalankan script
node linkvertise.js
Dependencies npm yang Dibutuhkan:
npm install None (Built-in Node.js 18+)Panduan Penggunaan:
curl -sL "https://code.vamxapi.my.id/snippet/raw/linkvertise" -o linkvertise.js && node linkvertise.js "https://direct-link.net/7075573/6GDiMfTXagIO"
linkvertise.js(164 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/**
* ========================================================
* Name: Linkvertise Resolver & Metadata Scraper
*
* Cara Download:
* curl -sL "https://code.vamxapi.my.id/snippet/raw/linkvertise" -o linkvertise.js
*
* Cara Eksekusi:
* node linkvertise.js "https://direct-link.net/7075573/6GDiMfTXagIO"
* node linkvertise.js "https://linkvertise.com/7075573/6GDiMfTXagIO"
*
* Author: Vamz Spectre
* Source: https://vamxapi.my.id
* ========================================================
*/
/**
* Resolver Linkvertise Engine via Official GraphQL Endpoint
* Mendukung linkvertise.com, direct-link.net, link-to.net, link-target.net, dll.
*/
async function linkvertise(inputUrl) {
if (!inputUrl) throw new Error("URL Linkvertise wajib disertakan!");
let resolvedUrl = inputUrl.trim();
// 1. Resolve redirect untuk domain alias (direct-link.net, link-to.net, dll)
try {
const headRes = await fetch(resolvedUrl, {
method: "GET",
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
},
redirect: "manual"
});
const loc = headRes.headers.get("location");
if (loc) {
resolvedUrl = new URL(loc, resolvedUrl).href;
}
} catch {}
// 2. Parse userId dan hash/slug
const parsed = new URL(resolvedUrl);
const parts = parsed.pathname.split("/").filter(Boolean);
const userId = parts[0] === "access" ? parts[1] : parts[0];
const slug = parts[0] === "access" ? parts[2] : parts[1];
if (!userId || !slug) {
throw new Error("Format URL Linkvertise tidak valid (harus mengandung user_id dan slug)");
}
// 3. Query Linkvertise GraphQL API
const query = `
query getLink($input: PublicLinkIdentificationInput!) {
linkByIdentifier(linkIdentificationInput: $input) {
id
url
target_host
target_type
title
is_premium_only
view_count
description
href
publisher {
id
name
}
}
getContent(input: $input) {
... on DetailPageTargetData {
type
url
paste
}
... on ContentAccessTaskSet {
__typename
tasks {
id
status
__typename
}
}
}
}
`;
const gqlRes = await fetch("https://publisher.linkvertise.com/graphql", {
method: "POST",
headers: {
"Content-Type": "application/json",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"Origin": "https://linkvertise.com",
"Referer": "https://linkvertise.com/"
},
body: JSON.stringify({
query,
variables: {
input: {
userIdAndUrl: { user_id: String(userId), url: String(slug) }
}
}
})
});
if (!gqlRes.ok) {
throw new Error(`GraphQL request gagal: HTTP ${gqlRes.status}`);
}
const json = await gqlRes.json();
const linkData = json.data?.linkByIdentifier;
if (!linkData) {
const errMsg = json.errors?.[0]?.message || "Linkvertise link tidak ditemukan atau sudah dihapus";
throw new Error(errMsg);
}
const contentData = json.data?.getContent;
let targetUrl = contentData?.url || null;
let pasteContent = contentData?.paste || null;
if (!targetUrl && linkData.target_host) {
targetUrl = linkData.target_host.startsWith("http")
? linkData.target_host
: `https://${linkData.target_host}`;
}
return {
success: true,
input_url: inputUrl,
resolved_url: resolvedUrl,
title: linkData.title,
target_host: linkData.target_host,
destination: targetUrl,
paste_content: pasteContent,
target_type: linkData.target_type,
is_premium_only: Boolean(linkData.is_premium_only),
view_count: linkData.view_count,
publisher: linkData.publisher
};
}
/**
* CLI Runner:
* Langsung eksekusi jika dijalankan via terminal: node linkvertise.js "link"
*/
const argUrl = process.argv[2];
if (argUrl) {
linkvertise(argUrl)
.then(result => {
console.log(JSON.stringify(result, null, 2));
})
.catch(err => {
console.error(JSON.stringify({ success: false, error: err.message }, null, 2));
process.exit(1);
});
} else if (process.argv[1] && process.argv.length <= 2) {
console.log("Usage: node linkvertise.js \"<link>\"");
}
if (typeof module !== "undefined" && module.exports) {
module.exports = { linkvertise, default: linkvertise };
}