1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 12:15:40 +01:00
svtplay-dl/lib/svtplay_dl/service/efn.py
Johan Andersson f3f748dde2 efn: adding support
fixed #242
2015-07-05 21:08:11 +02:00

26 lines
763 B
Python

from __future__ import absolute_import
import re
import copy
from svtplay_dl.service import Service, OpenGraphThumbMixin
from svtplay_dl.fetcher.hls import HLS, hlsparse
from svtplay_dl.log import log
class Efn(Service, OpenGraphThumbMixin):
supported_domains_re = ["www.efn.se"]
def get(self, options):
error, data = self.get_urldata()
if error:
log.error("Cant download page")
return
match = re.search('data-hls="([^"]+)"', self.get_urldata()[1])
if not match:
log.error("Cant find video info")
return
streams = hlsparse(match.group(1))
if streams:
for n in list(streams.keys()):
yield HLS(copy.copy(options), streams[n], n)