TandoorRecipes / recipes

Application for managing recipes, planning meals, building shopping lists and much much more!
https://docs.tandoor.dev
Other
5.56k stars 589 forks source link

Recipe Import Bug on #1482

Closed Basti-Fantasti closed 2 years ago

Basti-Fantasti commented 2 years ago

Tandoor Version

1.0.5.2 and 1.0.6

Setup

Docker / Docker-Compose

Reverse Proxy

Nginx Proxy Manager (NPM)

Other

No response

Bug description

In the latest version I've tried to import a recipe in automatic mode, from a website I've imported recipes before but now I get an error:

e.g. this site:

Recipe Bad

gives the error (message in German):

There was an error loading a resource!{"error": true, "msg": "Die angefragte Seite hat ung\u00fcltige Daten zur\u00fcckgegeben oder die Daten konnten nicht verarbeitet werden."}

in a previous version of tandoor I was able to import this link from the same website without issues:

Recipe OK

When trying to import this recipe now I get the same error

I've enabled debug log outs in my .env file and have attached the logs when importing the recipe

Relevant logs

web_recipes_1    | Bad Request: /api/recipe-from-source/
web_recipes_1    | WARNING:django.request:Bad Request: /api/recipe-from-source/
web_recipes_1    | 172.26.0.4 - - [04/Feb/2022:20:56:24 +0100] "POST /api/recipe-from-source/ HTTP/1.0" 400 139 "https://mytandoor.host/data/import/url" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0"
nginx_recipes_1  | 172.26.0.1 - - [04/Feb/2022:19:56:24 +0000] "POST /api/recipe-from-source/ HTTP/1.1" 400 139 "https://mytandoor.host/data/import/url" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0" "91.1.237.208"
nginx_recipes_1  | 172.26.0.1 - - [04/Feb/2022:19:56:24 +0000] "GET /static/webfonts/poppins_latin_700.woff2 HTTP/1.1" 200 7832 "https://mytandoor.host/static/themes/tandoor.min.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0" "91.1.237.208"
web_recipes_1    | 172.26.0.4 - - [04/Feb/2022:20:56:24 +0100] "GET /static/webfonts/poppins_latin_700.woff2 HTTP/1.0" 200 0 "https://mytandoor.host/static/themes/tandoor.min.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0"
MarcusWolschon commented 2 years ago

The <script type="application/ld+json">on that website contains all kinds of stuff but not a machine readable recipe in ld+json format. If it worked before, then it seems the website has changed.

{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "WebSite",
      "@id": "https://slowcooker.de/#website",
      "url": "https://slowcooker.de/",
      "name": "Langsam kocht besser",
      "description": "Rezepte, Infos und Kochbücher für Slowcooker / Schongarer / Crockpot",
      "inLanguage": "de-DE-formal",
      "publisher": {
        "@id": "https://slowcooker.de/#person"
      }
    },
    {
      "@type": "Person",
      "@id": "https://slowcooker.de/#person",
      "name": "Gabi Frankemölle",
      "sameAs": [
        "https://www.facebook.com/langsamkochtbesser/",
        "https://www.instagram.com/gabi_fra_usa/",
        "https://www.pinterest.de/langsamkochtbesser/",
        "https://www.youtube.com/channel/UCWA4F4_hx-OQsxNA68kOP5A"
      ]
    },
    {
      "@type": "BreadcrumbList",
      "@id": "https://slowcooker.de/2020/bolognese-2-0-das-weltbeste-slowcooker-rezept/#breadcrumblist",
      "itemListElement": [
        {
          "@type": "ListItem",
          "@id": "https://slowcooker.de/#listItem",
          "position": 1,
          "item": {
            "@type": "WebPage",
            "@id": "https://slowcooker.de/",
            "name": "Home",
            "description": "Erste Anlaufstelle für Informationen zu Slowcooker, Crockpot, Multigarer und Schongarer mit 500+ Rezepten, Umrechnungstabellen, Kaufberatung und Kochbüchern",
            "url": "https://slowcooker.de/"
          },
          "nextItem": "https://slowcooker.de/2020/#listItem"
        },
        {
          "@type": "ListItem",
          "@id": "https://slowcooker.de/2020/#listItem",
          "position": 2,
          "item": {
            "@type": "WebPage",
            "@id": "https://slowcooker.de/2020/",
            "name": "2020",
            "url": "https://slowcooker.de/2020/"
          },
          "nextItem": "https://slowcooker.de/2020/bolognese-2-0-das-weltbeste-slowcooker-rezept/#listItem",
          "previousItem": "https://slowcooker.de/#listItem"
        },
        {
          "@type": "ListItem",
          "@id": "https://slowcooker.de/2020/bolognese-2-0-das-weltbeste-slowcooker-rezept/#listItem",
          "position": 3,
          "item": {
            "@type": "WebPage",
            "@id": "https://slowcooker.de/2020/bolognese-2-0-das-weltbeste-slowcooker-rezept/",
            "name": "Bolognese 2.0: Das weltbeste Slowcooker-Rezept",
            "description": "Die klassische Nudelsauce mit Hack und Tomaten gewinnt durch die Zubereitung im Crockpot enorm: Hier findet ihr mein jahrelang erprobtes Lieblingsrezept!",
            "url": "https://slowcooker.de/2020/bolognese-2-0-das-weltbeste-slowcooker-rezept/"
          },
          "previousItem": "https://slowcooker.de/2020/#listItem"
        }
      ]
    },
    {
      "@type": "Person",
      "@id": "https://slowcooker.de/author/gfra/#author",
      "url": "https://slowcooker.de/author/gfra/",
      "name": "Gabi Frankemölle",
      "sameAs": [
        "https://www.facebook.com/langsamkochtbesser/",
        "https://www.instagram.com/gabi_fra_usa/",
        "https://www.pinterest.de/langsamkochtbesser/",
        "https://www.youtube.com/channel/UCWA4F4_hx-OQsxNA68kOP5A"
      ]
    },
    {
      "@type": "WebPage",
      "@id": "https://slowcooker.de/2020/bolognese-2-0-das-weltbeste-slowcooker-rezept/#webpage",
      "url": "https://slowcooker.de/2020/bolognese-2-0-das-weltbeste-slowcooker-rezept/",
      "name": "Bolognese 2.0: Das weltbeste Slowcooker-Rezept für Pastasauce",
      "description": "Die klassische Nudelsauce mit Hack und Tomaten gewinnt durch die Zubereitung im Crockpot enorm: Hier findet ihr mein jahrelang erprobtes Lieblingsrezept!",
      "inLanguage": "de-DE-formal",
      "isPartOf": {
        "@id": "https://slowcooker.de/#website"
      },
      "breadcrumb": {
        "@id": "https://slowcooker.de/2020/bolognese-2-0-das-weltbeste-slowcooker-rezept/#breadcrumblist"
      },
      "author": "https://slowcooker.de/author/gfra/#author",
      "creator": "https://slowcooker.de/author/gfra/#author",
      "image": {
        "@type": "ImageObject",
        "@id": "https://slowcooker.de/#mainImage",
        "url": "https://slowcooker.de/wp-content/uploads/2020/01/bolognese2.jpg",
        "width": 1000,
        "height": 798,
        "caption": "Klassische Sauce Bolognese aus dem Slowcooker"
      },
      "primaryImageOfPage": {
        "@id": "https://slowcooker.de/2020/bolognese-2-0-das-weltbeste-slowcooker-rezept/#mainImage"
      },
      "datePublished": "2020-02-04T09:47:31+01:00",
      "dateModified": "2022-01-28T07:37:59+01:00"
    },
    {
      "@type": "Article",
      "@id": "https://slowcooker.de/2020/bolognese-2-0-das-weltbeste-slowcooker-rezept/#article",
      "name": "Bolognese 2.0: Das weltbeste Slowcooker-Rezept für Pastasauce",
      "description": "Die klassische Nudelsauce mit Hack und Tomaten gewinnt durch die Zubereitung im Crockpot enorm: Hier findet ihr mein jahrelang erprobtes Lieblingsrezept!",
      "inLanguage": "de-DE-formal",
      "headline": "Bolognese 2.0: Das weltbeste Slowcooker-Rezept",
      "author": {
        "@id": "https://slowcooker.de/author/gfra/#author"
      },
      "publisher": {
        "@id": "https://slowcooker.de/#person"
      },
      "datePublished": "2020-02-04T09:47:31+01:00",
      "dateModified": "2022-01-28T07:37:59+01:00",
      "commentCount": 35,
      "articleSection": "für Slowcooker, für Kinder, ganz einfach, Hauptgericht, Italien, Pasta, Sauce",
      "mainEntityOfPage": {
        "@id": "https://slowcooker.de/2020/bolognese-2-0-das-weltbeste-slowcooker-rezept/#webpage"
      },
      "isPartOf": {
        "@id": "https://slowcooker.de/2020/bolognese-2-0-das-weltbeste-slowcooker-rezept/#webpage"
      },
      "image": {
        "@type": "ImageObject",
        "@id": "https://slowcooker.de/#articleImage",
        "url": "https://slowcooker.de/wp-content/uploads/2020/01/bolognese2.jpg",
        "width": 1000,
        "height": 798,
        "caption": "Klassische Sauce Bolognese aus dem Slowcooker"
      }
    }
  ]
}
smilerz commented 2 years ago

@Basti-Fantasti it's possible they changed how the website presents the data. But right now, it doesn't have a format that can be imported.

You can open a feature request at https://github.com/hhursev/recipe-scrapers to see if they can add it to their supported sites.