Skip to content

Commit

Permalink
urplay: improve --all-episodes
Browse files Browse the repository at this point in the history
  • Loading branch information
spaam committed Jul 28, 2024
1 parent b49d5f2 commit 905b6d8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/svtplay_dl/service/urplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,19 @@ def find_all_episodes(self, config):
logging.error("Can't find video info.")
return episodes

data = unescape(match.group(1))
jsondata = json.loads(data)
jsondata = json.loads(match.group(1))
seasons = jsondata["props"]["pageProps"]["superSeriesSeasons"]
build = jsondata["buildId"]

parse = urlparse(self.url)
url = f"https://{parse.netloc}{parse.path}"
episodes.append(url)
if seasons:
for season in seasons:
res = self.http.get(f'https://urplay.se/api/v1/series?id={season["id"]}')
for episode in res.json()["programs"]:
res = self.http.get(
f'https://urplay.se/_next/data/{build}{season["link"]}.json?productType={jsondata["query"]["productType"]}&id={jsondata["props"]["pageProps"]["program"]["seriesId"]}',
)
for episode in res.json()["pageProps"]["program"]["series"]["programs"]:
url = urljoin("https://urplay.se", episode["link"])
if url not in episodes:
episodes.append(url)
Expand Down

0 comments on commit 905b6d8

Please sign in to comment.