List and export recipes from your Cookidoo collections.
This program allows you to list and export recipes from your created and saved collections on Cookidoo. The export is in JSON compatible with Paprika 3.
In order to list or export the recipes, a valid subscription is needed.
This program is derived from auino/cookidump; see that program for origins, citiations, disclaimers, etc.
-
Install Python 3
-
Install Python dependencies for the dumpCollections.py script:
pip3 install -U -r requirements.txt
-
Download the Chrome WebDriver, naming it appropriately for the current architecture, and update the script
cookidump
if needed for your architecture. -
Install npm
-
Install prettier, and the plugin prettier-plugin-sort-json
cookidump [-r recipes_folder] [-j json_folder] [-p pattern]
where:
-
-r recipes_folder
names a folder (directory) where the lists of recipes in each collection will go If this option is not specified, the default is./recipes
.
Note: If this option is not specified and no-p pattern
option is specified, then the default recipes folder./recipes
is deleted and recreated; this includes the nested folder containing the JSON recipe files. In other words, if you do not want to start from scratch, you must specify a pattern or a recipes folder. -
-j json_folder
names a folder (directory) where the JSON files for each recipe are written. This folder is named relative to the recipes folder. If the-j json_folder
option is not specified, no JSON is written. -
-p pattern
provides a filter for deciding which collections and/or recipes will be dumped. The pattern is of the formregular_expression[::regular_expression]
. The first regular expression is used to match collection names; only collections matching the given regular expression are listed. The second regular expression (if given) is used to match recipes; only recipes matching the given regular expression are dumped to JSON files (and then only if the-j json_folder
option is specified). If you want to dump certain recipes from any collection, use a filter of the form.::recipe_pattern
; the initial dot will match all collections. If you want to dump all recipes from certain collections, use a filter of the formcollection_pattern::.
.
The program will open a Google Chrome window and wait until you are logged in into your Cookidoo account. The script currently hard-codes the starting URL for the USA Cookidoo - you can change that as appropriate for your locale.
The program creates a file per created or saved collection, plus one for your bookmarks, plus one for your created recipes. That file contains lines such as:
r470647 https://cookidoo.thermomix.com/recipes/recipe/en-US/r470647 Sesame Orange Chicken
the recipe id (such as r470647), which is a globally unique ID for the recipe (a recipe has that same ID in all instances of Cookidoo), the recipe URL (which starts off differently in each Cookidoo regional instance, but ends with the same recipe ID), and the recipe name.
The program also creates a couple of index files, containing the names of your collections and the number of recipes in that collection.
Output is represented by an index.html
file, included in outputdir
, plus a set of recipes inside of structured folders.
By opening the generated index.html
file on your browser, it is possible to have a list of recipes downloaded and surf to the desired recipe.
The number of exported recipes is limited to around 1000
for each execution.
Hence, use of filters may help in this case to reduce the number of recipes exported.
A different approach, previously adopted, is based on the retrieval of structured data on recipes. More information can be found on the datastructure branch. Output is represented in this case in a different (structured) format, hence, it has to be interpreted. Such interpretation is not implemented in the linked previous commit.
- Bypass the limited number of exported recipes
- Parse downloaded recipes to store them on a database, or to generate a unique linked PDF
- Make Chrome run headless for better speeds
- Set up a dedicated container for the program
- @vikramsoni2, regarding JSON saves plus minor enhancements
- @mrwogu, regarding additional information to be extracted on the generated JSON file, plus suggestions on the possibility to save recipes on dedicated JSON files
- @nilskrause, regarding argument parsing and updates on the link to download the Chrome WebDriver
- @NightProgramming, regarding the use of selenium version 3
- @morela, regarding the update of the tool to support a newer version of Selenium
- @ndjc, fixing some deprecation warnings
The authors of this program are not responsible of the usage of it. This program is released only for research and dissemination purposes. Also, the program provides users the ability to locally and temporarily store recipes accessible through a legit subscription. Before using this program, check Cookidoo subscription terms of service, according to the country related to the exploited subscription. Sharing of the obtained recipes is not a legit activity and the authors of this program are not responsible of any illecit and sharing activity accomplished by the users.
You can find me on Twitter as @auino.
This program is derived from auino/cookidump; see that program for origins, citiations, disclaimers, etc.
-
Install Python 3
-
Install Python dependencies for the dumpCollections.py script:
pip3 install -r requirements.txt
-
Download the Chrome WebDriver, naming it appropriately for the current architecture, and update the script
cookidump
if needed for your architecture. -
Install npm
-
Install prettier, and the plugin prettier-plugin-sort-json
cookidump [-r recipes_folder] [-j json_folder] [-p pattern]
where:
-
-r recipes_folder
names a folder (directory) where the lists of recipes in each collection will go If this option is not specified, the default is./recipes
.
Note: If this option is not specified and no-p pattern
option is specified, then the default recipes folder./recipes
is deleted and recreated; this includes the nested folder containing the JSON recipe files. In other words, if you do not want to start from scratch, you must specify a pattern or a recipes folder. -
-j json_folder
names a folder (directory) where the JSON files for each recipe are written. This folder is named relative to the recipes folder. If the-j json_folder
option is not specified, no JSON is written. -
-p pattern
provides a filter for deciding which collections and/or recipes will be dumped. The pattern is of the formregular_expression[::regular_expression]
. The first regular expression is used to match collection names; only collections matching the given regular expression are listed. The second regular expression (if given) is used to match recipes; only recipes matching the given regular expression are dumped to JSON files (and then only if the-j json_folder
option is specified). If you want to dump certain recipes from any collection, use a filter of the form.::recipe_pattern
; the initial dot will match all collections. If you want to dump all recipes from certain collections, use a filter of the formcollection_pattern::.
.
The program will open a Google Chrome window and wait until you are logged in into your Cookidoo account. The script currently hard-codes the starting URL for the USA Cookidoo - you can change that as appropriate for your locale.
The program creates a file per created or saved collection, plus one for your bookmarks, plus one for your created recipes. That file contains lines such as:
r470647 https://cookidoo.thermomix.com/recipes/recipe/en-US/r470647 Sesame Orange Chicken
the recipe id (such as r470647), which is a globally unique ID for the recipe (a recipe has that same ID in all instances of Cookidoo), the recipe URL (which starts off differently in each Cookidoo regional instance, but ends with the same recipe ID), and the recipe name.
The program also creates a couple of index files, containing the names of your collections and the number of recipes in that collection.