1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 12:15:40 +01:00

urplay: support for -A on urskola.se

fixes #677
This commit is contained in:
Johan Andersson 2017-09-16 17:36:37 +02:00
parent 5057322c85
commit 0ddbc9752e

View File

@ -66,12 +66,25 @@ class Urplay(Service, OpenGraphThumbMixin):
def find_all_episodes(self, options): def find_all_episodes(self, options):
parse = urlparse(self.url) parse = urlparse(self.url)
episodes = []
if parse.netloc == "urskola.se":
data = self.get_urldata()
match = re.search('data-limit="[^"]+" href="([^"]+)"', data)
if match:
res = self.http.get(urljoin("http://urskola.se", match.group(1)))
data = res.text
tags = re.findall('<a class="puff tv video" title="[^"]+" href="([^"]+)"', data)
for i in tags:
url = urljoin("http://urskola.se/", i)
if url not in episodes:
episodes.append(url)
else:
match = re.search("/program/\d+-(\w+)-", parse.path) match = re.search("/program/\d+-(\w+)-", parse.path)
if not match: if not match:
log.error("Can't find any videos") log.error("Can't find any videos")
return None return None
keyword = match.group(1) keyword = match.group(1)
episodes = []
all_links = re.findall('card-link" href="([^"]+)"', self.get_urldata()) all_links = re.findall('card-link" href="([^"]+)"', self.get_urldata())
for i in all_links: for i in all_links:
match = re.search("/program/\d+-(\w+)-", i) match = re.search("/program/\d+-(\w+)-", i)