From 0be6bddf8c92c461af57e7c61c2378c817fb0143 Mon Sep 17 00:00:00 2001 From: Jellyfrog Date: Wed, 30 Sep 2015 00:47:49 +0200 Subject: [PATCH] Make oppetarkiv work with --all-episodes again seems they changed some css-classes --- lib/svtplay_dl/service/oppetarkiv.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/svtplay_dl/service/oppetarkiv.py b/lib/svtplay_dl/service/oppetarkiv.py index b82fd3b..2cbac83 100644 --- a/lib/svtplay_dl/service/oppetarkiv.py +++ b/lib/svtplay_dl/service/oppetarkiv.py @@ -19,7 +19,6 @@ class OppetArkiv(Svtplay): log.error("Couldn't find title") return program = match.group(1) - more = True episodes = [] n = 0 @@ -28,12 +27,13 @@ class OppetArkiv(Svtplay): else: sort = "tid_stigande" - while more: + while True: url = "http://www.oppetarkiv.se/etikett/titel/%s/?sida=%s&sort=%s&embed=true" % (program, page, sort) - data = self.http.request("get", url).text - visa = re.search(r'svtXColorDarkLightGrey', data) - if not visa: - more = False + data = self.http.request("get", url) + if data.status_code == 404: + break + + data = data.text regex = re.compile(r'href="(/video/[^"]+)"') for match in regex.finditer(data): if n == options.all_last: