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

    Constructors

    Properties

    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: null | string = null

    Current base URL for the active discovery session

    Methods

    • Returns the URL of the known placeholder image for this provider, if any

      Used by ImageRepair to detect recipes stored with placeholder content by comparing MD5 hashes of local files against the placeholder.

      Returns null | string

      The placeholder image URL, or null if this provider has no known placeholder

    • Fetches just the image URL for a recipe page on-demand

      Used for visibility-based lazy loading of images. Fetches the recipe page HTML and extracts the image URL from JSON-LD schema data.

      Parameters

      • url: string

        Recipe page URL to fetch image for

      • signal: AbortSignal

        Abort signal for cancellation

      Returns Promise<null | string>

      Promise resolving to image URL or null if not found/failed

    • 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