this repo has no description
1
fork

Configure Feed

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

fix: improve YouTube soft 404 detection

Treat empty title after stripping " - YouTube" suffix as
a soft 404. YouTube now returns " - YouTube" instead of
"YouTube" for missing videos, bypassing the old check.

+8 -2
+8 -2
internal/handler/preview_youtube.go
··· 34 34 title = strings.TrimSuffix(title, " - YouTube") 35 35 meta["title"] = title 36 36 37 - // If scrape yielded no real title or image, fall through to OEmbed 37 + // Empty title after stripping suffix means the page had no real video title 38 + // (e.g. " - YouTube"), which is another form of YouTube's soft 404. 39 + if title == "" { 40 + return nil, fmt.Errorf("status 404") 41 + } 42 + 43 + // If scrape yielded no image, fall through to OEmbed 38 44 // which is more reliable for YouTube 39 - if title == "" || meta["image"] == "" { 45 + if meta["image"] == "" { 40 46 return nil, fmt.Errorf("incomplete scrape, falling back to oembed") 41 47 } 42 48