Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Software
Recipes To PDF
Commits
0fd4f768
Commit
0fd4f768
authored
Oct 14, 2022
by
Nicolas Lenz
Browse files
Fix token headers for new version
parent
547c5225
Changes
1
Hide whitespace changes
Inline
Side-by-side
recipes-to-pdf
View file @
0fd4f768
...
...
@@ -69,7 +69,7 @@ def read_recipe(input: dict) -> Recipe:
def
list_recipe_ids
()
->
list
[
int
]:
r
=
requests
.
get
(
f
"https://recipes.eisfunke.com/api/recipe/"
,
headers
=
{
"Authorization"
:
f
"
Token
{
token
}
"
},
headers
=
{
"Authorization"
:
f
"
Bearer
{
token
}
"
},
json
=
{
"page_size"
:
0
},
)
...
...
@@ -82,7 +82,7 @@ def list_recipe_ids() -> list[int]:
def
get_recipe
(
id
:
int
)
->
Recipe
:
r
=
requests
.
get
(
f
"
{
instance
}
/api/recipe/
{
id
}
/"
,
headers
=
{
"Authorization"
:
f
"
Token
{
token
}
"
},
headers
=
{
"Authorization"
:
f
"
Bearer
{
token
}
"
},
)
if
r
.
status_code
!=
requests
.
codes
.
ok
:
...
...
@@ -104,7 +104,7 @@ def make_recipe(recipe: Recipe):
r
=
requests
.
get
(
recipe
.
image_url
,
headers
=
{
"Authorization"
:
f
"
Token
{
token
}
"
},
headers
=
{
"Authorization"
:
f
"
Bearer
{
token
}
"
},
)
if
r
.
status_code
!=
requests
.
codes
.
ok
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment