[Bug]: FreshnessScorer defaults to current_year=2024, so this year's URLs score like undated ones
Los mantenedores suelen responder en 1 día
@Siddharth-DWT ya está trabajando en esto.
Desde el 21/10/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start with crawl4ai/deep_crawling/scorers.py and inspect FreshnessScorer's current_year default and _extract_year; reproduce the listed URL scores. Check the documentation example that uses FreshnessScorer(weight=0.8). Done when the default ranks a URL from the current year above an undated URL, while an explicitly supplied current_year keeps working as before.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
crawl4ai version
0.9.5 (also on main and develop)
Expected Behavior
As the docstring says, "more recent years score higher": with the default settings a URL dated this year scores highest.
Current Behavior
current_year defaults to a hard-coded 2024, and _extract_year discards any year later than current_year as invalid. So today, with the default:
- a
/2026/or/2025/URL scores 0.5, the same as a URL with no date - a
/2024/URL scores 1.0
BestFirstCrawlingStrategy with a default FreshnessScorer therefore ranks 2024 content above current content. The docs use it with the default (FreshnessScorer(weight=0.8)).
Is this reproducible?
Yes
Inputs Causing the Bug
Any FreshnessScorer() without current_year.
Steps to Reproduce
Run the snippet below.
Code snippets
from crawl4ai.deep_crawling.scorers import FreshnessScorer
scorer = FreshnessScorer()
for url in [
"https://example.com/blog/2026/10/01/post",
"https://example.com/blog/2024/01/01/post",
"https://example.com/about",
]:
print(url, scorer.score(url))
# 2026 -> 0.5, 2024 -> 1.0, undated -> 0.5
OS
Windows 11 (platform-independent)
Python version
3.13
Browser
Not involved
Error logs & Screenshots (if applicable)
None; no error is raised.
Fix: default current_year to None and use date.today().year; an explicit current_year keeps working as before. I'll open a PR against develop referencing this issue.
Investigated with AI assistance; I ran the reproduction and checked the output myself.
- Lenguaje dominante
- Python
- Estrellas
- 87.2k
- Forks
- 9.1k
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 25
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de unclecode/crawl4ai
-
BUG: UserAgentGenerator.generate ignores browser_type and returns a random browser stackPosiblemente ocupada @HhH666-ux la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
[Bug]: Hardened docker-compose (read_only) keeps full Chromium from starting: crashpad needs a writable ~/.configPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto🐞 Bug 📌 Root caused
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
unclecode/crawl4ai#2494 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Feature]: Crawl4aiDockerClient has no public option for the API token the 0.9 server requiresAbierto⚙ Done ✨ Enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
⚙ Done 🐞 Bug 📌 Root caused
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
[Bug]: PDF images saved with save_images_locally=True come back with an empty src in result.mediaAbierto⚙ Done 🐞 Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
unclecode/crawl4ai#2469 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de unclecode/crawl4ai
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Install the skills as a Claude Code pluginPosiblemente ocupada @ruban-24 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 6 días
-
Make the usage of time-zone aware UTC timestamps the norm across the pynxtools NOMAD ecosystemAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
FAIRmat-NFDI/pynxtools#874 ·
-
Eval: PublicationAbiertodata
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100