LOADING
Fetch metadata video dan channel YouTube tanpa API key. Supports URL, handle (@), dan ID langsung.
const axios = require('axios');
const VIDEO_ID_REGEX = /(?:youtube\.com\/(?:watch\?v=|shorts\/|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})|^([a-zA-Z0-9_-]{11})$/;
function extractVideoId(input) {
const match = input.match(VIDEO_ID_REGEX);
return match ? (match[1] || match[2]) : null;
}
async function getVideoMeta(input) {
const videoId = extractVideoId(input);
if (!videoId) throw new Error('Invalid YouTube URL or video ID');
const quotaUser = Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2);
const ts = Date.now();
const parts = [
'snippet',
'statistics',
'contentDetails',
'status',
'liveStreamingDetails',
'localizations',
'recordingDetails',
'topicDetails',
'player',
].join(',');
const { data } = await axios.get('https://ytapi.apps.mattw.io/v3/videos', {
params: {
key: 'foo1',
quotaUser,
part: parts,
id: videoId,
_: ts,
},
headers: {
accept: 'application/json, text/javascript, */*; q=0.01',
origin: 'https://mattw.io',
referer: 'https://mattw.io/',
'user-agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36',
},
});
if (!data.items || data.items.length === 0) throw new Error('Video not found');
const item = data.items[0];
const s = item.snippet || {};
const st = item.statistics || {};
const cd = item.contentDetails || {};
const status = item.status || {};
const live = item.liveStreamingDetails || {};
const topic = item.topicDetails || {};
const thumbnails = s.thumbnails || {};
const bestThumb = thumbnails.maxres || thumbnails.standard || thumbnails.high || thumbnails.medium || thumbnails.default || null;
const result = {
id: item.id,
url: `https://www.youtube.com/watch?v=${item.id}`,
title: s.title || null,
description: s.description || null,
publishedAt: s.publishedAt || null,
channel: {
id: s.channelId || null,
title: s.channelTitle || null,
url: s.channelId ? `https://www.youtube.com/channel/${s.channelId}` : null,
},
category: {
id: s.categoryId || null,
},
tags: s.tags || [],
defaultLanguage: s.defaultLanguage || null,
defaultAudioLanguage: s.defaultAudioLanguage || null,
liveBroadcastContent: s.liveBroadcastContent || null,
thumbnails: {
default: thumbnails.default || null,
medium: thumbnails.medium || null,
high: thumbnails.high || null,
standard: thumbnails.standard || null,
maxres: thumbnails.maxres || null,
best: bestThumb ? bestThumb.url : null,
},
statistics: {
views: st.viewCount ? parseInt(st.viewCount) : null,
likes: st.likeCount ? parseInt(st.likeCount) : null,
comments: st.commentCount ? parseInt(st.commentCount) : null,
favorites: st.favoriteCount ? parseInt(st.favoriteCount) : null,
},
contentDetails: {
duration: cd.duration || null,
dimension: cd.dimension || null,
definition: cd.definition || null,
caption: cd.caption || null,
licensedContent: cd.licensedContent ?? null,
projection: cd.projection || null,
contentRating: cd.contentRating || {},
},
status: {
uploadStatus: status.uploadStatus || null,
privacyStatus: status.privacyStatus || null,
license: status.license || null,
embeddable: status.embeddable ?? null,
publicStatsViewable: status.publicStatsViewable ?? null,
madeForKids: status.madeForKids ?? null,
},
liveStreaming: Object.keys(live).length > 0 ? live : null,
topicCategories: topic.topicCategories || [],
topicIds: topic.topicIds || [],
player: item.player || null,
localizations: item.localizations || null,
recordingDetails: item.recordingDetails || null,
};
return result;
}
const input = process.argv[2];
if (!input) {
process.stderr.write('Usage: node yt-meta.js <video_url_or_id>\n');
process.exit(1);
}
getVideoMeta(input)
.then(r => process.stdout.write(JSON.stringify(r, null, 2) + '\n'))
.catch(e => {
process.stderr.write(e.message + '\n');
process.exit(1);
});const axios = require('axios');
const HEADERS = {
accept: 'application/json, text/javascript, */*; q=0.01',
origin: 'https://mattw.io',
referer: 'https://mattw.io/',
'user-agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36',
};
const CHANNEL_ID_REGEX = /^UC[a-zA-Z0-9_-]{22}$/;
const CHANNEL_URL_REGEX = /youtube\.com\/(?:channel\/(UC[a-zA-Z0-9_-]{22})|(?:@|user\/|c\/)([^/?&\s]+))/;
async function resolveChannelId(input) {
const trimmed = input.trim();
if (CHANNEL_ID_REGEX.test(trimmed)) return trimmed;
const urlMatch = trimmed.match(CHANNEL_URL_REGEX);
if (urlMatch && urlMatch[1]) return urlMatch[1];
const resolveUrl = urlMatch
? trimmed
: trimmed.startsWith('@')
? `https://youtube.com/${trimmed}`
: `https://youtube.com/@${trimmed}`;
const { data } = await axios.get('https://ytapi.apps.mattw.io/v1/resolve_url', {
params: { url: resolveUrl },
headers: HEADERS,
});
if (!data || !data.channelId) throw new Error('Could not resolve channel ID');
return data.channelId;
}
async function getChannelMeta(input) {
const channelId = await resolveChannelId(input);
const quotaUser = Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2);
const { data } = await axios.get('https://ytapi.apps.mattw.io/v3/channels', {
params: {
key: 'foo1',
quotaUser,
part: 'id,snippet,statistics,brandingSettings,contentDetails,localizations,status,topicDetails',
id: channelId,
_: Date.now(),
},
headers: HEADERS,
});
if (!data.items || data.items.length === 0) throw new Error('Channel not found');
const item = data.items[0];
const s = item.snippet || {};
const st = item.statistics || {};
const bs = item.brandingSettings || {};
const cd = item.contentDetails || {};
const status = item.status || {};
const topic = item.topicDetails || {};
const thumbnails = s.thumbnails || {};
const bestThumb = thumbnails.high || thumbnails.medium || thumbnails.default || null;
return {
id: item.id,
url: `https://www.youtube.com/channel/${item.id}`,
title: s.title || null,
description: s.description || null,
customUrl: s.customUrl || null,
publishedAt: s.publishedAt || null,
country: s.country || null,
defaultLanguage: s.defaultLanguage || null,
thumbnails: {
default: thumbnails.default || null,
medium: thumbnails.medium || null,
high: thumbnails.high || null,
best: bestThumb ? bestThumb.url : null,
},
statistics: {
subscribers: st.subscriberCount ? parseInt(st.subscriberCount) : null,
hiddenSubscriberCount: st.hiddenSubscriberCount ?? null,
views: st.viewCount ? parseInt(st.viewCount) : null,
videoCount: st.videoCount ? parseInt(st.videoCount) : null,
},
branding: {
title: bs.channel?.title || null,
description: bs.channel?.description || null,
keywords: bs.channel?.keywords || null,
country: bs.channel?.country || null,
bannerExternalUrl: bs.image?.bannerExternalUrl || null,
},
contentDetails: {
uploadsPlaylistId: cd.relatedPlaylists?.uploads || null,
},
status: {
privacyStatus: status.privacyStatus || null,
isLinked: status.isLinked ?? null,
longUploadsStatus: status.longUploadsStatus || null,
madeForKids: status.madeForKids ?? null,
},
topicCategories: topic.topicCategories || [],
localizations: item.localizations || null,
};
}
const input = process.argv[2];
if (!input) {
process.stderr.write('Usage: node yt-channel.js <channel_url|handle|@handle|channel_id>\n');
process.exit(1);
}
getChannelMeta(input)
.then(r => process.stdout.write(JSON.stringify(r, null, 2) + '\n'))
.catch(e => {
process.stderr.write(e.message + '\n');
process.exit(1);
});bashnode yt-video.js "https://youtu.be/1ZVH2q5AS_U?si=0IuYtjnoSBs0r3U1" node yt-video.js -qiMVr801zI
bash* Info dasar: id, url, title, description, publishedAt * Channel info (id, title, url) * Thumbnails semua resolusi + best (url resolusi tertinggi) * Statistics: views, likes, comments * Content details: durasi (ISO 8601), dimension, definition, caption * Status: privacyStatus, embeddable, madeForKids, dll * Live streaming details (jika ada) * Topic categories & IDs * Tags, language, localizations, recordingDetails
bashnode yt-channel.js "@Kurohiko" node yt-channel.js "https://youtube.com/@Kurohiko" node yt-channel.js "UCrhE2Aa-OnfgwUt5VG2oHog" node yt-channel.js "Kurohiko"
bash❯❯❯ node yt-video.js https://youtu.be/1ZVH2q5AS_U\?si\=hgZ6DGO-FIZzHx1V { "id": "1ZVH2q5AS_U", "url": "https://www.youtube.com/watch?v=1ZVH2q5AS_U", "title": "Hobi Baru Gw: Home Server / Home Lab dengan Mini PC Murah di Rumah", "description": "ngulik Home server pake Proxmox docker dengan berbagai service seperti immich, Home Assistant, paperless, Tailscale, dan masih banyak lagi.\n\n❤ Top Up Murah dikelola Kurohiko Langsung\nhttp://Kurohiko.id\n\nPemula Wild Rift?\nNonton ini https://youtube.com/playlist?list=PL_pQ5XqPmZVEFxMugsAyLcIK5ageW0QbW\n\nBergabung ke Membership Kurohiko\nhttps://www.youtube.com/channel/UCrhE2Aa-OnfgwUt5VG2oHog/join\n\nJoin Discord Home Server Indonesia\nhttps://discord.gg/Jzphb2eydS\n\nFollow Kurohiko:\nhttps://discord.gg/nRMnWfQFAV\nhttps://www.instagram.com/kurohiko_id/\nhttps://www.facebook.com/Kurohiko.id/\n\n#Homeserver #HomeLab", "publishedAt": "2026-03-23T09:54:46Z", "channel": { "id": "UCrhE2Aa-OnfgwUt5VG2oHog", "title": "Kurohiko", "url": "https://www.youtube.com/channel/UCrhE2Aa-OnfgwUt5VG2oHog" }, "category": { "id": "20" }, "tags": [ "wild rift" ], "defaultLanguage": "id", "defaultAudioLanguage": "id", "liveBroadcastContent": "none", "thumbnails": { "default": { "url": "https://i.ytimg.com/vi/1ZVH2q5AS_U/default.jpg", "width": 120, "height": 90 }, "medium": { "url": "https://i.ytimg.com/vi/1ZVH2q5AS_U/mqdefault.jpg", "width": 320, "height": 180 }, "high": { "url": "https://i.ytimg.com/vi/1ZVH2q5AS_U/hqdefault.jpg", "width": 480, "height": 360 }, "standard": { "url": "https://i.ytimg.com/vi/1ZVH2q5AS_U/sddefault.jpg", "width": 640, "height": 480 }, "maxres": { "url": "https://i.ytimg.com/vi/1ZVH2q5AS_U/maxresdefault.jpg", "width": 1280, "height": 720 }, "best": "https://i.ytimg.com/vi/1ZVH2q5AS_U/maxresdefault.jpg" }, "statistics": { "views": 35812, "likes": 1161, "comments": 200, "favorites": 0 }, "contentDetails": { "duration": "PT23M41S", "dimension": "2d", "definition": "hd", "caption": "false", "licensedContent": true, "projection": "rectangular", "contentRating": {} }, "status": { "uploadStatus": "processed", "privacyStatus": "public", "license": "youtube", "embeddable": true, "publicStatsViewable": true, "madeForKids": false }, "liveStreaming": null, "topicCategories": [ "https://en.wikipedia.org/wiki/Hobby", "https://en.wikipedia.org/wiki/Technology" ], "topicIds": [], "player": { "embedHtml": "<iframe width=\"480\" height=\"270\" src=\"//www.youtube.com/embed/1ZVH2q5AS_U\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen></iframe>" }, "localizations": { "id": { "title": "Hobi Baru Gw: Home Server / Home Lab dengan Mini PC Murah di Rumah", "description": "ngulik Home server pake Proxmox docker dengan berbagai service seperti immich, Home Assistant, paperless, Tailscale, dan masih banyak lagi.\n\n❤ Top Up Murah dikelola Kurohiko Langsung\nhttp://Kurohiko.id\n\nPemula Wild Rift?\nNonton ini https://youtube.com/playlist?list=PL_pQ5XqPmZVEFxMugsAyLcIK5ageW0QbW\n\nBergabung ke Membership Kurohiko\nhttps://www.youtube.com/channel/UCrhE2Aa-OnfgwUt5VG2oHog/join\n\nJoin Discord Home Server Indonesia\nhttps://discord.gg/Jzphb2eydS\n\nFollow Kurohiko:\nhttps://discord.gg/nRMnWfQFAV\nhttps://www.instagram.com/kurohiko_id/\nhttps://www.facebook.com/Kurohiko.id/\n\n#Homeserver #HomeLab" }, "en-US": { "title": "My New Hobby: Home Server / Home Lab with a Cheap Mini PC at Home", "description": "Explore home servers using Proxmox Docker with various services like immich, Home Assistant, Paperless, Tailscale, and many more.\n\n❤ Cheap Top-Ups managed by Kurohiko Directly\nhttp://Kurohiko.id\n\nWild Rift newbie?\n\nWatch this: https://youtube.com/playlist?list=PL_pQ5XqPmZVEFxMugsAyLcIK5ageW0QbW\n\nJoin the Kurohiko Membership\nhttps://www.youtube.com/channel/UCrhE2Aa-OnfgwUt5VG2oHog/join\n\nJoin the Indonesian Home Server Discord\nhttps://discord.gg/Jzphb2eydS\n\nFollow Kurohiko:\nhttps://discord.gg/nRMnWfQFAV\nhttps://www.instagram.com/kurohiko_id/\nhttps://www.facebook.com/Kurohiko.id/\n\n#Homeserver #HomeLab" } }, "recordingDetails": {} }
bash❯❯❯ node yt-channel.js "@Kurohiko" { "id": "UCrhE2Aa-OnfgwUt5VG2oHog", "url": "https://www.youtube.com/channel/UCrhE2Aa-OnfgwUt5VG2oHog", "title": "Kurohiko", "description": "Kitab MOBA Pemula di Link Kurohiko.id\nReview Game HOK, LoL Wild Rift , AOV Arena of Valor , Mobile Legends, dan MOBA Mobile Lainnya\n\n\nJangan Lupa Subscribe untuk dapat Updatean Game dan Reviews ya :) Gratis kok\n\nEmail : contact.kurohiko [@] gmail.com", "customUrl": "@kurohiko", "publishedAt": "2015-01-28T15:58:01Z", "country": "ID", "defaultLanguage": null, "thumbnails": { "default": { "url": "https://yt3.ggpht.com/IHWshTM8HCFKBKCZIDB5eJQk99t70ZC65qHjZehD_FIOzFmCcRVyy17Jt_OTQy3IT2esQXs86UQ=s88-c-k-c0x00ffffff-no-rj", "width": 88, "height": 88 }, "medium": { "url": "https://yt3.ggpht.com/IHWshTM8HCFKBKCZIDB5eJQk99t70ZC65qHjZehD_FIOzFmCcRVyy17Jt_OTQy3IT2esQXs86UQ=s240-c-k-c0x00ffffff-no-rj", "width": 240, "height": 240 }, "high": { "url": "https://yt3.ggpht.com/IHWshTM8HCFKBKCZIDB5eJQk99t70ZC65qHjZehD_FIOzFmCcRVyy17Jt_OTQy3IT2esQXs86UQ=s800-c-k-c0x00ffffff-no-rj", "width": 800, "height": 800 }, "best": "https://yt3.ggpht.com/IHWshTM8HCFKBKCZIDB5eJQk99t70ZC65qHjZehD_FIOzFmCcRVyy17Jt_OTQy3IT2esQXs86UQ=s800-c-k-c0x00ffffff-no-rj" }, "statistics": { "subscribers": 464000, "hiddenSubscriberCount": false, "views": 143347808, "videoCount": 3231 }, "branding": { "title": "Kurohiko", "description": "Kitab MOBA Pemula di Link Kurohiko.id\nReview Game HOK, LoL Wild Rift , AOV Arena of Valor , Mobile Legends, dan MOBA Mobile Lainnya\n\n\nJangan Lupa Subscribe untuk dapat Updatean Game dan Reviews ya :) Gratis kok\n\nEmail : contact.kurohiko [@] gmail.com", "keywords": "\"hero baru\" \"skin baru\" Kuro aov \"arena of valor\" kurohuko kurihiko kurohoko champion \"wild rift\" \"Champion baru\" \"League of Legends Wild Rift\"", "country": "ID", "bannerExternalUrl": "https://yt3.googleusercontent.com/eAE90J1eRIXcRYHrTxLhaUv7bHD7vbIRGJMZwdJzcVvNq3bSZd6uDYtX3yqZAjV-n0dkSt9U6A" }, "contentDetails": { "uploadsPlaylistId": "UUrhE2Aa-OnfgwUt5VG2oHog" }, "status": { "privacyStatus": "public", "isLinked": true, "longUploadsStatus": "longUploadsUnspecified", "madeForKids": false }, "topicCategories": [ "https://en.wikipedia.org/wiki/Role-playing_video_game", "https://en.wikipedia.org/wiki/Video_game_culture", "https://en.wikipedia.org/wiki/Action_game", "https://en.wikipedia.org/wiki/Action-adventure_game", "https://en.wikipedia.org/wiki/Strategy_video_game" ], "localizations": null }