Skip to content

Commit dd4cb01

Browse files
Fix entry URL and poster URL
1 parent 3f7c0c0 commit dd4cb01

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/simplejustwatchpythonapi/parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from typing import NamedTuple
22

3+
_DETAILS_URL = "https://justwatch.com"
34
_IMAGES_URL = "https://images.justwatch.com"
45

56

@@ -50,13 +51,13 @@ def _parse_entry(json: any) -> MediaEntry:
5051
object_type = json.get("objectType")
5152
content = json["content"]
5253
title = content.get("title")
53-
url = _IMAGES_URL + content.get("fullPath")
54+
url = _DETAILS_URL + content.get("fullPath")
5455
year = content.get("originalReleaseYear")
5556
date = content.get("originalReleaseDate")
5657
genres = [node.get("shortName") for node in content.get("genres", []) if node]
5758
external_ids = content.get("externalIds")
5859
imdb_id = external_ids.get("imdbId") if external_ids else None
59-
poster = content.get("posterUrl")
60+
poster = _IMAGES_URL + content.get("posterUrl")
6061
backdrops = [_IMAGES_URL + bd.get("backdropUrl") for bd in content.get("backdrops", []) if bd]
6162
offers = [_parse_offer(offer) for offer in json.get("offers", []) if offer]
6263
return MediaEntry(

0 commit comments

Comments
 (0)