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.
···3434 title = strings.TrimSuffix(title, " - YouTube")
3535 meta["title"] = title
36363737- // If scrape yielded no real title or image, fall through to OEmbed
3737+ // Empty title after stripping suffix means the page had no real video title
3838+ // (e.g. " - YouTube"), which is another form of YouTube's soft 404.
3939+ if title == "" {
4040+ return nil, fmt.Errorf("status 404")
4141+ }
4242+4343+ // If scrape yielded no image, fall through to OEmbed
3844 // which is more reliable for YouTube
3939- if title == "" || meta["image"] == "" {
4545+ if meta["image"] == "" {
4046 return nil, fmt.Errorf("incomplete scrape, falling back to oembed")
4147 }
4248