1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 20:25:41 +01:00
svtplay-dl/lib/svtplay_dl/service/efn.py
2015-10-04 14:37:16 +02:00

23 lines
699 B
Python

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