this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: try OEmbed before declaring soft 404

When scraping detects a soft 404 (e.g. YouTube consent pages
returning a generic title), attempt an OEmbed lookup first.
The OEmbed API returns proper metadata regardless of consent
screens or JS rendering, avoiding false "Video Unavailable"
results.

+7 -1
+7 -1
internal/handler/preview.go
··· 188 188 h.cacheAndRespond(w, r, urlParam, meta) 189 189 return 190 190 } 191 - // If we detected a soft 404, stop here and return 404 so UI can render "missing" badge 191 + // If we detected a soft 404 from scraping (e.g. consent page with generic 192 + // "YouTube" title), verify with OEmbed before declaring dead. The OEmbed API 193 + // returns proper data regardless of consent screens or JS rendering. 192 194 if err.Error() == "status 404" { 195 + if oeMeta, oeErr := h.tryOEmbed(urlParam); oeErr == nil { 196 + h.cacheAndRespond(w, r, urlParam, oeMeta) 197 + return 198 + } 193 199 h.cacheErrorPreview(r, urlParam, "Video Unavailable", 404) 194 200 archiveData := h.attachArchiveData(r.Context(), urlParam) 195 201 resp := map[string]interface{}{