Closed moridius closed 2 years ago
I'm trying to use the API but I always get error 400, Bad Request.
I read this gist and tried to do the same in Python:
#!/usr/bin/env python3 import urllib.request query = { "queries": [ { "fields": ["title", "topic"], "query": "sturm der liebe" } ], "sortBy": "timestamp", "sortOrder": "desc", "future": False, "offset": 0, "size": 10, "duration_min": 20, "duration_max": 100 } data = urllib.parse.urlencode(query).encode("utf-8") with urllib.request.urlopen("https://mediathekviewweb.de/api/query", data) as f: print(f.read().decode("utf-8"))
Did the API change or am I missing something here?
You're probably missing Content-Type: text/plain. Yes, it's wrong and stupid, but it is what it is right now.
Content-Type: text/plain
That was actually part of the problem (and also my JSON was wrong...). Thanks!
I'm trying to use the API but I always get error 400, Bad Request.
I read this gist and tried to do the same in Python:
Did the API change or am I missing something here?