PageSourceSearch

https://viddler.com/assets/youtube-thumbnail-downloader-Dk02_OJD.js

js viddler.com collected 2026-10-02 02:14:37 UTC 6,122 bytes, 3 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0f726-7dc8-7242-8ef6-20d0a2f5df3e")}catch(e){}}();import{u as T,d as j,r as d,j as t,o as k,B as b}from"./index-DCg2N-ax.js";import{T as D}from"./tool-page-xyzZDU_k.js";import{I as Y}from"./input-DF5Vgg2m.js";import{L as N}from"./label-CIYHSsxI.js";import{C as S}from"./copy-CQ5EKnpp.js";import{D as L}from"./download-C-n2vFkf.js";function U(l){const a=l.trim();if(!a)return null;if(/^[\w-]{11}$/.test(a))return a;let s;try{s=new URL(a.startsWith("http")?a:`https://${a}`)}catch{return null}const o=s.hostname.replace(/^www\./,"").replace(/^m\./,"");if(o==="youtu.be"){const i=s.pathname.slice(1).split("/")[0];return/^[\w-]{11}$/.test(i)?i:null}if(o==="youtube.com"||o==="youtube-nocookie.com"||o==="music.youtube.com"){if(s.pathname.startsWith("/watch")){const u=s.searchParams.get("v")||"";return/^[\w-]{11}$/.test(u)?u:null}const i=s.pathname.match(/^\/(?:shorts|embed|live|v)\/([\w-]{11})/);if(i)return i[1]}return null}const q=[{file:"maxresdefault",label:"Max resolution (HD)",dims:"1280x720"},{file:"sddefault",label:"Standard definition",dims:"640x480"},{file:"hqdefault",label:"High quality",dims:"480x360"},{file:"mqdefault",label:"Medium quality",dims:"320x180"},{file:"default",label:"Small",dims:"120x90"}];function c(l,a){return`https://i.ytimg.com/vi/${l}/${a}.jpg`}function E(){const{logEvent:l}=T();j();const[a,s]=d.useState(""),[o,i]=d.useState(null),[u,f]=d.useState(""),[v,m]=d.useState({}),[x,p]=d.useState(""),w=()=>{const e=U(a);if(!e){i(null),f("That does not look like a YouTube link. Paste a watch, share, or Shorts URL.");return}f(""),m({}),i(e),l("seo_tool_used",void 0,{slug:"youtube-thumbnail-downloader"})},g=async e=>{if(o)try{const n=await fetch(c(o,e));if(!n.ok)throw new Error("not available");const h=await n.blob(),r=document.createElement("a");r.href=URL.createObjectURL(h),r.download=`${o}-${e}.jpg`,r.click(),URL.revokeObjectURL(r.href),l("seo_tool_used",void 0,{slug:"youtube-thumbnail-downloader",action:"download",size:e})}catch{window.open(c(o,e),"_blank","noopener")}},y=async e=>{o&&(await navigator.clipboard.writeText(c(o,e)),p(e),setTimeout(()=>p(""),1500))};return t.jsx("div",{className:"opus-home",style:k,children:t.jsx(D,{slug:"youtube-thumbnail-downloader",metaTitle:"YouTube Thumbnail Downloader (HD, All Sizes) | Viddler",metaDescription:"Download any YouTube video thumbnail in full HD 1280x720 plus every smaller size. Paste the video link, preview all thumbnails, save with one click. Free, no signup.",heroTitle:"YouTube thumbnail downloader",heroSubtitle:"Paste a YouTube link and grab the thumbnail in every available size, up to full HD 1280x720. Free, instant, and nothing to install.",faqs:[{q:"How do I download a YouTube thumbnail?",a:"Paste the video URL above and press Get thumbnails. The tool shows every size YouTube stores for that video. Click Download next to the size you want and the JPG saves to your device."},{q:"What sizes do YouTube thumbnails come in?",a:"YouTube stores up to five sizes per video: 1280x720 (maxresdefault), 640x480 (sddefault), 480x360 (hqdefault), 320x180 (mqdefault), and 120x90 (default). Not every video has the HD size. It exists when the uploader provided a high resolution image."},{q:"Why is there no HD thumbnail for my video?",a:"The 1280x720 maxresdefault image only exists if the video was uploaded with an HD custom thumbnail or was processed in HD. When it is missing, the 480x360 hqdefault version is the best one available and exists for every video."},{q:"Is it legal to download YouTube thumbnails?",a:"Downloading a thumbnail for reference, previews, or linking to the video is common practice. The image itself belongs to the video creator, so get permission before reusing someone else's thumbnail in your own content or marketing."},{q:"Does this work for YouTube Shorts and youtu.be links?",a:"Yes. The tool accepts watch URLs, youtu.be share links, Shorts links, embed URLs, and even a bare 11 character video ID. It reads the video ID and fetches the thumbnails directly from YouTube's image servers."}],ctaTitle:"Making videos of your own?",ctaSubtitle:"Viddler hosts your videos ad-free with clean embeds and per-viewer watch tracking. Free plan, no credit card.",children:t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"max-w-xl",children:[t.jsx(N,{htmlFor:"yt-url",className:"mb-2 block",children:"YouTube video link"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Y,{id:"yt-url",placeholder:"https://www.youtube.com/watch?v=...",value:a,onChange:e=>s(e.target.value),onKeyDown:e=>e.key==="Enter"&&w()}),t.jsx(b,{onClick:w,children:"Get thumbnails"})]}),u&&t.jsx("p",{className:"mt-2 text-sm text-destructive",children:u})]}),o&&t.jsx("div",{className:"grid gap-6 sm:grid-cols-2",children:q.filter(e=>!v[e.file]).map(e=>t.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[t.jsx("img",{src:c(o,e.file),alt:`YouTube thumbnail ${e.dims}`,className:"w-full bg-muted",loading:"lazy",onError:()=>m(n=>({...n,[e.file]:!0})),onLoad:n=>{const h=n.currentTarget;
1e.file!=="default"&&h.naturalWidth<=120&&m(r=>({...r,[e.file]:!0}))}}),t.jsxs("div",{className:"p-3 flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:e.label}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e.dims})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(b,{size:"sm",variant:"outline",onClick:()=>y(e.file),"aria-label":`Copy ${e.dims} thumbnail URL`,children:[t.jsx(S,{className:"h-4 w-4 mr-1"}),x===e.file?"Copied":"URL"]}),t.jsxs(b,{size:"sm",onClick:()=>g(e.file),"aria-label":`Download ${e.dims} thumbnail`,children:[t.jsx(L,{className:"h-4 w-4 mr-1"}),"Download"]})]})]})]},e.file))})]})})})}export{E as default,U as parseYouTubeId};
2
3//# chunkId=01a0f726-7dc8-7242-8ef6-20d0a2f5df3e

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.