Merge pull request #2822 from michael-genson/fix/add-url-to-opengraph-scraper

fix: Use Scraped URL instead of Open Graph URL when importing a recipe via URL
This commit is contained in:
boc-the-git 2023-12-11 15:57:28 +11:00 committed by GitHub
commit a6ec488864
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,10 +208,6 @@ class RecipeScraperPackage(ABCScraperStrategy):
class RecipeScraperOpenGraph(ABCScraperStrategy): class RecipeScraperOpenGraph(ABCScraperStrategy):
"""
Abstract class for all recipe parsers.
"""
async def get_html(self, url: str) -> str: async def get_html(self, url: str) -> str:
return await safe_scrape_html(url) return await safe_scrape_html(url)
@ -241,7 +237,7 @@ class RecipeScraperOpenGraph(ABCScraperStrategy):
"recipeIngredient": ["Could not detect ingredients"], "recipeIngredient": ["Could not detect ingredients"],
"recipeInstructions": [{"text": "Could not detect instructions"}], "recipeInstructions": [{"text": "Could not detect instructions"}],
"slug": slugify(og_field(properties, "og:title")), "slug": slugify(og_field(properties, "og:title")),
"orgURL": og_field(properties, "og:url"), "orgURL": self.url,
"categories": [], "categories": [],
"tags": og_fields(properties, "og:article:tag"), "tags": og_fields(properties, "og:article:tag"),
"dateAdded": None, "dateAdded": None,