diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index d1ef1b98..fbbc23c9 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -258,13 +258,14 @@ def get_from_youtube_scraper(url, request): ] } - # TODO add automation here try: automation_engine = AutomationEngine(request, source=url) - video = YouTube(url=url) + video = YouTube(url) + video.streams.first() # this is required to execute some kind of generator/web request that fetches the description default_recipe_json['name'] = automation_engine.apply_regex_replace_automation(video.title, Automation.NAME_REPLACE) default_recipe_json['image'] = video.thumbnail_url - default_recipe_json['steps'][0]['instruction'] = automation_engine.apply_regex_replace_automation(video.description, Automation.INSTRUCTION_REPLACE) + if video.description: + default_recipe_json['steps'][0]['instruction'] = automation_engine.apply_regex_replace_automation(video.description, Automation.INSTRUCTION_REPLACE) except Exception: pass diff --git a/vue/src/components/RecipeViewComponent.vue b/vue/src/components/RecipeViewComponent.vue index 16e3b611..07a051ad 100644 --- a/vue/src/components/RecipeViewComponent.vue +++ b/vue/src/components/RecipeViewComponent.vue @@ -277,9 +277,7 @@ export default { } }, handleResize: function () { - if (document.getElementById('nutrition_container') !== null) { - this.ingredient_height = document.getElementById('ingredient_container').clientHeight - document.getElementById('nutrition_container').clientHeight - } else { + if (document.getElementById('ingredient_container') !== null) { this.ingredient_height = document.getElementById('ingredient_container').clientHeight } },