update
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import httpx
|
||||
|
||||
from .config import (
|
||||
GENRE_HORROR,
|
||||
LANGUAGE,
|
||||
PROVIDER_NETFLIX,
|
||||
REGION,
|
||||
@@ -12,16 +11,15 @@ from .config import (
|
||||
HEADERS = {"Authorization": f"Bearer {TMDB_TOKEN}", "accept": "application/json"}
|
||||
|
||||
DISCOVER_PARAMS = {
|
||||
"with_watch_providers": PROVIDER_NETFLIX,
|
||||
"watch_region": REGION,
|
||||
"with_genres": GENRE_HORROR,
|
||||
"with_watch_monetization_types": "flatrate",
|
||||
"language": LANGUAGE,
|
||||
"include_adult": "false",
|
||||
# JustWatch hängt unbekannte Titel gelegentlich an die Netflix-ID eines
|
||||
# gleichnamigen bekannten Films. Betroffen waren ausschließlich Einträge
|
||||
# mit ein oder zwei Stimmen — "LIENZO" bekam die ID von "Die Leinwand".
|
||||
"vote_count.gte": 3,
|
||||
# Der volle Katalog hat 5648 Titel, das meiste davon nie gesehen.
|
||||
# Die Grenze hält auch die Fehlzuordnungen draußen: JustWatch hängt
|
||||
# unbekannte Titel gelegentlich an die Netflix-ID eines gleichnamigen
|
||||
# bekannten Films — "LIENZO" bekam die ID von "Die Leinwand".
|
||||
"vote_count.gte": 50,
|
||||
}
|
||||
|
||||
DETAIL_PARAMS = {
|
||||
@@ -37,19 +35,26 @@ def client():
|
||||
|
||||
|
||||
async def discover_page(http, page):
|
||||
resp = await http.get("/discover/movie", params={**DISCOVER_PARAMS, "page": page})
|
||||
resp = await http.get(
|
||||
"/discover/movie",
|
||||
params={
|
||||
**DISCOVER_PARAMS,
|
||||
"with_watch_providers": PROVIDER_NETFLIX,
|
||||
"page": page,
|
||||
},
|
||||
)
|
||||
resp.raise_for_status()
|
||||
return resp.json()
|
||||
|
||||
|
||||
async def discover_all(http):
|
||||
"""Alle Netflix-DE-Horrorfilme durchpaginieren."""
|
||||
"""Alle Film-IDs im Netflix-DE-Abo."""
|
||||
first = await discover_page(http, 1)
|
||||
movies = list(first["results"])
|
||||
ids = {m["id"] for m in first["results"]}
|
||||
for page in range(2, first["total_pages"] + 1):
|
||||
data = await discover_page(http, page)
|
||||
movies.extend(data["results"])
|
||||
return movies
|
||||
ids |= {m["id"] for m in data["results"]}
|
||||
return ids
|
||||
|
||||
|
||||
async def detail(http, movie_id):
|
||||
|
||||
Reference in New Issue
Block a user