Preparing search index...

    HelloFresh recipe provider implementation

    Extends BaseRecipeProvider with HelloFresh-specific URL patterns, category discovery, and ingredient filtering for French/English recipes.

    Hierarchy (View Summary)

    Index
    id: "hellofresh" = 'hellofresh'

    Unique provider identifier

    name: "HelloFresh" = 'HelloFresh'

    Display name for the provider

    logoUrl: "https://media.hellofresh.com/w_256,q_100,f_auto,c_limit,fl_lossy/hellofresh_website/logo/Hello_Fresh_Lockup.png" = HELLOFRESH_LOGO_URL

    URL to the HelloFresh logo

    currentBaseUrl: string | null = null

    Current base URL for the active discovery session

    • Extracts a real image URL directly from page HTML, without invoking the recipe scraper.

      Default implementation returns null, signalling the caller (typically useRecipeScraper) to fall back to the scraper-based image. Subclasses may override when they have a cheaper or more reliable path (for example, Quitoque returns a placeholder via the scraper but exposes the real image in JSON-LD schema markup).

      Parameters

      • _html: string

        Raw HTML content of the recipe page

      Returns string | null

      Image URL when found via the provider-specific path, otherwise null

    • Fetches HTML content from a URL with timeout handling

      Parameters

      • url: string

        URL to fetch

      • Optionalsignal: AbortSignal

        Optional abort signal for cancellation

      Returns Promise<string>

      Promise resolving to the HTML content

      Error if request fails or times out

    • Gets the base URL for the user's regional HelloFresh site

      Always fetches the current language setting to ensure the correct regional site is used even if the user changed language settings.

      Returns Promise<string>

      Promise resolving to the regional HelloFresh URL

      Error if the user's language is not supported by HelloFresh

    • Discovers recipe category URLs from the HelloFresh recipes page

      Fetches the main recipes page and extracts all category links, filtering out individual recipe pages.

      Parameters

      • baseUrl: string

        The regional HelloFresh base URL

      • Optionalsignal: AbortSignal

        Optional abort signal for cancellation

      Returns Promise<string[]>

      Promise resolving to array of category page URLs

    • Extracts recipe links from HTML content

      Parses HTML to find recipe URLs matching the HelloFresh pattern (URLs ending with 24-character hex IDs). Extracts titles from URL slugs for immediate display.

      Parameters

      • html: string

        Raw HTML content to parse

      Returns { url: string; title?: string; imageUrl?: string }[]

      Array of recipe links with URLs and extracted titles

    • Extracts category links from HTML content

      Parses HTML to find category URLs matching the HelloFresh pattern, filtering out individual recipe pages (those ending with hex IDs).

      Parameters

      • html: string

        Raw HTML content to parse

      • baseUrl: string

        Base URL for resolving relative links

      Returns string[]

      Array of unique category URLs

    • Extracts a human-readable title from a recipe URL slug

      Converts URL slugs like "chicken-tikka-masala-abc123" to readable titles like "Chicken tikka masala".

      Parameters

      • url: string

        Full recipe URL

      Returns string

      Formatted title with first letter capitalized