AdguardTeam / AdguardTeam/AdGuardHome
Feature: Auto-fetch filter names from URL when adding custom blocklists/allowlists
- Lenguaje dominante
- TypeScript
- Estrellas
- 36.9k
- Forks
- 2.5k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
### Prerequisites
- [x] I have checked the [Wiki](https://github.com/AdguardTeam/AdGuardHome/wiki) and [Discussions](https://github.com/AdguardTeam/AdGuardHome/discussions) and found no answer
- [x] I have searched other issues and found no duplicates
- [x] I want to request a feature or enhancement and not ask a question
### The problem
Currently, when users add custom blocklists or allowlists to AdGuard Home, they need to manually:
1. Enter the filter URL
2. Manually type or copy-paste a descriptive name for the filter
This creates friction in the user experience, especially when:
- Adding multiple filters at once
- The filter list already has a descriptive title in its metadata (in comments like `! Title: Filter Name`)
- Users might not know what name to give to the filter
### Proposed solution
Implement an **automatic filter name fetching feature** that:
1. **Backend**: Add a new endpoint `/control/filtering/check_url` that:
- Accepts a filter URL via POST request
- Fetches the content from the URL
- Parses the filter file to extract the title from metadata comments (e.g., `! Title:`, `# Title:`)
- Returns the extracted title to the frontend
- Includes permissive URL validation that doesn't require file extensions (many valid filter lists don't have `.txt` extensions)
2. **Frontend**: Enhance the "Add custom filter" form to:
- Automatically call the new endpoint when a user enters a URL (with debouncing, e.g., 800ms)
- Auto-populate the "Name" field with the fetched title
- Allow users to override the auto-fetched name if desired
- Only auto-fetch if the name field is empty or unchanged from previous auto-fetch
- Show appropriate loading states and error handling
## Benefits
- **Improved UX**: Reduces manual work when adding filters
- **Accuracy**: Uses the official filter name from the list maintainer
- **Speed**: Faster filter configuration, especially for users adding multiple lists
- **Accessibility**: Makes it easier for less technical users to add custom filters
## Technical Considerations
- The auto-fetch should be non-blocking and not prevent users from manually entering names
- Implement appropriate timeout handling for slow or unresponsive URLs
- Consider caching mechanisms to avoid repeated fetches of the same URL
- Ensure the feature works in development mode with appropriate debug logging
- Should respect existing user input (don't override if user has already typed something)
## Additional Context
This feature would be similar to how many modern applications auto-populate metadata (like browser extensions that fetch titles from URLs, or music players that fetch track information).
### Alternatives considered and additional information
1. Pre-populate a database of known filter lists (but this requires maintenance and doesn't help with custom/private lists)
2. Require users to always manually enter names (current behavior, but suboptimal UX)
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.