# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- from __future__ import absolute_import import re import copy import xml.etree.ElementTree as ET from svtplay_dl.service import Service, OpenGraphThumbMixin from svtplay_dl.utils import get_http_data, is_py2_old from svtplay_dl.utils.urllib import unquote_plus from svtplay_dl.log import log from svtplay_dl.fetcher.rtmp import RTMP class Qbrick(Service, OpenGraphThumbMixin): supported_domains = ['di.se', 'sydsvenskan.se'] def get(self, options): error, data = self.get_urldata() if error: log.error("Can't get the page") return if self.exclude(options): return if re.findall(r"sydsvenskan.se", self.url): match = re.search(r"data-qbrick-mcid=\"([0-9A-F]+)\"", data) if not match: log.error("Can't find video file for: %s", self.url) return mcid = match.group(1) host = "http://vms.api.qbrick.com/rest/v3/getsingleplayer/%s" % mcid elif re.findall(r"di.se", self.url): match = re.search("src=\"(http://qstream.*)\">