<div class="yt-container">
  <h1>YouTube Video Downloader</h1>

  <div class="search-box">
    <input type="text" id="url" placeholder="Paste YouTube link">
    <button onclick="fetchVideo()">Download</button>
  </div>

  <div id="result"></div>
</div>

<style>
.yt-container {
  max-width: 800px;
  margin: auto;
  padding: 20px;
  text-align: center;
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-box input {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid #ccc;
}

.search-box button {
  background: #00c853;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
}

.video-card {
  margin-top: 20px;
}

.format {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.format button {
  background: #00c853;
  border: none;
  padding: 6px 12px;
  color: white;
  border-radius: 6px;
}
</style>

<script>
async function fetchVideo() {
  const url = document.getElementById("url").value;

  const res = await fetch("https://api.themultitools.com/video-downloader", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ url })
  });

  const data = await res.json();

  if (!data.success) {
    document.getElementById("result").innerHTML =
      `<p style="color:red">${data.error}</p>`;
    return;
  }

  let html = `
    <div class="video-card">
      <img src="${data.thumbnail}" width="100%">
      <h3>${data.title}</h3>
  `;

  data.formats.forEach(f => {
    html += `
      <div class="format">
        <span>${f.quality} (${f.ext})</span>
        <a href="${f.url}" target="_blank">
          <button>Download</button>
        </a>
      </div>
    `;
  });

  html += `</div>`;

  document.getElementById("result").innerHTML = html;
}
</script><?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//themultitools.com/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://themultitools.com/page-sitemap.xml</loc>
		<lastmod>2026-04-28T14:56:24+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Rank Math SEO Plugin (c) Rank Math - rankmath.com -->