chore(deps): update dependency ruff to v0.16.0 (#7983)

This commit is contained in:
Michael Genson
2026-07-30 16:52:07 -05:00
committed by GitHub
parent 3c3dfc2bc9
commit e57f14f111
5 changed files with 51 additions and 59 deletions

View File

@@ -51,43 +51,37 @@ See <a href="https://github.com/Jleagle/mealie-importer" target="_blank">Jleagle
import requests
import re
def authentication(mail, password, mealie_url):
headers = {
'accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
}
data = {
'grant_type': '',
'username': mail,
'password': password,
'scope': '',
'client_id': '',
'client_secret': ''
}
auth = requests.post(mealie_url + "/api/auth/token", headers=headers, data=data)
token = re.sub(r'.*token":"(.*)",.*', r'\1', auth.text)
return token
headers = {
"accept": "application/json",
"Content-Type": "application/x-www-form-urlencoded",
}
data = {"grant_type": "", "username": mail, "password": password, "scope": "", "client_id": "", "client_secret": ""}
auth = requests.post(mealie_url + "/api/auth/token", headers=headers, data=data)
token = re.sub(r'.*token":"(.*)",.*', r"\1", auth.text)
return token
def import_from_file(input_file, token, mealie_url):
with open(input_file) as fp:
for l in fp:
line = re.sub(r'(.*)\n', r'\1', l)
print(line)
headers = {
'Authorization': "Bearer " + token,
'accept': 'application/json',
'Content-Type': 'application/json'
}
data = {
'url': line
}
response = requests.post(mealie_url + "/api/recipes/create/url", headers=headers, json=data)
print(response.text)
with open(input_file) as fp:
for l in fp:
line = re.sub(r"(.*)\n", r"\1", l)
print(line)
headers = {
"Authorization": "Bearer " + token,
"accept": "application/json",
"Content-Type": "application/json",
}
data = {"url": line}
response = requests.post(mealie_url + "/api/recipes/create/url", headers=headers, json=data)
print(response.text)
input_file="list"
mail="changeme@example.com"
password="MyPassword"
mealie_url="http://localhost:9000"
input_file = "list"
mail = "changeme@example.com"
password = "MyPassword"
mealie_url = "http://localhost:9000"
token = authentication(mail, password, mealie_url)