def get(self, options): data = self.get_urldata() if self.exclude(options): yield ServiceError("Excluding video") return match = re.search(r'script async defer src="(//content.youplay.se[^"]+)"', data) if not match: yield ServiceError("Cant find video info for %s" % self.url) return data = self.http.request("get", "http:%s" % match.group(1)).content match = re.search(r'decodeURIComponent\("([^"]+)"\)\)', data) if not match: yield ServiceError("Can't decode video info") return data = unquote_plus(match.group(1)) match = re.search(r"videoData = ({[^;]+});", data) if not match: yield ServiceError("Cant find video info for %s" % self.url) return # fix broken json. regex = re.compile(r"\s(\w+):") data = regex.sub(r"'\1':", match.group(1)) data = data.replace("'", "\"") j = re.sub(r"{\s*(\w)", r'{"\1', data) j = j.replace("\n", "") j = re.sub(r'",\s*}', '"}', j) jsondata = json.loads(j) for i in jsondata["episode"]["sources"]: match = re.search(r"mp4_(\d+)", i) if match: yield HTTP(copy.copy(options), jsondata["episode"]["sources"][i], match.group(1))
def get(self): vid = None data = self.get_urldata() if self.exclude(self.options): yield ServiceError("Excluding video") return match = re.search(r'video url-([^"]+)', data) if not match: match = re.search(r'embed.jsp\?([^"]+)"', self.get_urldata()) if not match: yield ServiceError("Can't find video id") return vid = match.group(1) if not vid: path = unquote_plus(match.group(1)) data = self.http.request("get", "http://www.svd.se%s" % path).content match = re.search(r'embed.jsp\?([^"]+)', data) if not match: yield ServiceError("Can't find video id") return vid = match.group(1) url = "http://ljsp.lwcdn.com/web/public/item.json?type=video&%s" % decode_html_entities(vid) data = self.http.request("get", url).text jdata = json.loads(data) videos = jdata["videos"][0]["media"]["streams"] for i in videos: if i["name"] == "auto": hls = "%s%s" % (jdata["videos"][0]["media"]["base"], i["url"]) streams = hlsparse(self.options, self.http.request("get", hls), hls) if streams: for n in list(streams.keys()): yield streams[n]
def get(self, options): vid = None data = self.get_urldata() match = re.search(r'video url-([^"]+)', data) if not match: match = re.search(r'embed.jsp\?id=([^&]+)&', data) if not match: log.error("Cant find video id") sys.exit(2) vid = match.group(1) if not vid: path = unquote_plus(match.group(1)) data = get_http_data("http://www.svd.se%s" % path) match = re.search(r'embed.jsp\?id=([^&]+)&', data) if not match: log.error("Cant find video id2") sys.exit(2) vid = match.group(1) url = "http://amz.lwcdn.com/api/cache/VideoCache.jsp?id=%s" % vid data = get_http_data(url) xml = ET.XML(data) videofile = xml.find("{http://www.lemonwhale.com/xml11}VideoFile") mediafiles = videofile.find( "{http://www.lemonwhale.com/xml11}MediaFiles") high = mediafiles.find("{http://www.lemonwhale.com/xml11}VideoURLHigh") if high.text: yield HTTP(copy.copy(options), high.text, 720) videourl = mediafiles.find( "{http://www.lemonwhale.com/xml11}VideoURL").text yield HTTP(copy.copy(options), videourl, 480)
def get(self, options): match = re.search("xmlUrl=([^ ]+)\" ", self.get_urldata()) if match: xmlurl = unquote_plus(match.group(1)) else: match = re.search(r"moviesList: \[\{\"VideoId\":\"(\d+)\"", self.get_urldata()) if not match: log.error("Can't find video id") sys.exit(2) vid = match.group(1) xmlurl = "http://www.expressen.se/Handlers/WebTvHandler.ashx?id=%s" % vid data = get_http_data(xmlurl) xml = ET.XML(data) live = xml.find("live").text if live != "0": options.live = True ss = xml.find("vurls") if is_py2_old: sa = list(ss.getiterator("vurl")) else: sa = list(ss.iter("vurl")) for i in sa: options2 = copy.copy(options) match = re.search(r"rtmp://([-0-9a-z\.]+/[-a-z0-9]+/)(.*)", i.text) filename = "rtmp://%s" % match.group(1) options2.other = "-y %s" % match.group(2) yield RTMP(options2, filename, int(i.attrib["bitrate"])) ipadurl = xml.find("mobileurls").find("ipadurl").text streams = hlsparse(ipadurl) for n in list(streams.keys()): yield HLS(copy.copy(options), streams[n], n)
def get(self, options): match = re.search("xmlUrl=([^ ]+)\" ", self.get_urldata()) if match: xmlurl = unquote_plus(match.group(1)) else: match = re.search("moviesList: \[\{\"VideoId\":\"(\d+)\"", self.get_urldata()) if not match: log.error("Can't find video id") sys.exit(2) vid = match.group(1) xmlurl = "http://www.expressen.se/Handlers/WebTvHandler.ashx?id=%s" % vid data = get_http_data(xmlurl) xml = ET.XML(data) live = xml.find("live").text if live != "0": options.live = True ss = xml.find("vurls") if is_py2_old: sa = list(ss.getiterator("vurl")) else: sa = list(ss.iter("vurl")) for i in sa: options2 = copy.copy(options) match = re.search(r"rtmp://([-0-9a-z\.]+/[-a-z0-9]+/)(.*)", i.text) filename = "rtmp://%s" % match.group(1) options2.other = "-y %s" % match.group(2) yield RTMP(options2, filename, int(i.attrib["bitrate"])) ipadurl = xml.find("mobileurls").find("ipadurl").text streams = hlsparse(ipadurl) for n in list(streams.keys()): yield HLS(copy.copy(options), streams[n], n)
def get(self, options): vid = None data = self.get_urldata() match = re.search(r'video url-([^"]+)', data) if not match: match = re.search(r'embed.jsp\?id=([^&]+)&', data) if not match: log.error("Cant find video id") sys.exit(2) vid = match.group(1) if not vid: path = unquote_plus(match.group(1)) data = get_http_data("http://www.svd.se%s" % path) match = re.search(r'embed.jsp\?id=([^&]+)&', data) if not match: log.error("Cant find video id2") sys.exit(2) vid = match.group(1) url = "http://amz.lwcdn.com/api/cache/VideoCache.jsp?id=%s" % vid data = get_http_data(url) xml = ET.XML(data) videofile = xml.find("{http://www.lemonwhale.com/xml11}VideoFile") mediafiles = videofile.find("{http://www.lemonwhale.com/xml11}MediaFiles") high = mediafiles.find("{http://www.lemonwhale.com/xml11}VideoURLHigh") if high.text: yield HTTP(copy.copy(options), high.text, 720) file = mediafiles.find("{http://www.lemonwhale.com/xml11}VideoURL").text yield HTTP(copy.copy(options), file, 480)
def get(self, options): vid = None data = self.get_urldata() if self.exclude(options): yield ServiceError("Excluding video") return match = re.search(r'video url-([^"]+)', data) if not match: match = re.search(r'embed.jsp\?([^"]+)"', self.get_urldata()) if not match: yield ServiceError("Can't find video id") return vid = match.group(1) if not vid: path = unquote_plus(match.group(1)) data = self.http.request("get", "http://www.svd.se%s" % path).content match = re.search(r'embed.jsp\?([^"]+)', data) if not match: yield ServiceError("Can't find video id") return vid = match.group(1) url = "http://amz.lwcdn.com/api/cache/VideoCache.jsp?%s" % vid data = self.http.request("get", url).content xml = ET.XML(data) videofile = xml.find("{http://www.lemonwhale.com/xml11}VideoFile") mediafiles = videofile.find("{http://www.lemonwhale.com/xml11}MediaFiles") high = mediafiles.find("{http://www.lemonwhale.com/xml11}VideoURLHigh") if high.text: yield HTTP(copy.copy(options), high.text, 720) videourl = mediafiles.find( "{http://www.lemonwhale.com/xml11}VideoURL").text yield HTTP(copy.copy(options), videourl, 480)
def get(self): data = self.get_urldata() match = re.search('params","([^"]+)"', data) if not match: yield ServiceError( "Cant find params info. video need to be public.") return data2 = json.loads('["%s"]' % match.group(1)) data2 = json.loads(unquote_plus(data2[0])) if "sd_src_no_ratelimit" in data2["video_data"]["progressive"][0]: yield HTTP( copy.copy(self.options), data2["video_data"]["progressive"][0]["sd_src_no_ratelimit"], "240") else: yield HTTP(copy.copy(self.options), data2["video_data"]["progressive"][0]["sd_src"], "240") if "hd_src_no_ratelimit" in data2["video_data"]["progressive"][0]: yield HTTP( copy.copy(self.options), data2["video_data"]["progressive"][0]["hd_src_no_ratelimit"], "720") else: if data2["video_data"]["progressive"][0]["hd_src"]: yield HTTP(copy.copy(self.options), data2["video_data"]["progressive"][0]["hd_src"], "720")
def get(self, options): if re.findall(r"sydsvenskan.se", self.url): data = self.get_urldata() match = re.search(r"data-qbrick-mcid=\"([0-9A-F]+)\"", data) if not match: log.error("Can't find video file") sys.exit(2) mcid = match.group(1) host = "http://vms.api.qbrick.com/rest/v3/getsingleplayer/%s" % mcid elif re.findall(r"di.se", self.url): data = self.get_urldata() match = re.search("src=\"(http://qstream.*)\"></iframe", data) if not match: log.error("Can't find video info") sys.exit(2) data = get_http_data(match.group(1)) match = re.search(r"data-qbrick-ccid=\"([0-9A-Z]+)\"", data) if not match: log.error("Can't find video file") sys.exit(2) host = "http://vms.api.qbrick.com/rest/v3/getplayer/%s" % match.group(1) elif re.findall(r"svd.se", self.url): match = re.search(r'video url-([^"]*)\"', self.get_urldata()) if not match: log.error("Can't find video file") sys.exit(2) path = unquote_plus(match.group(1)) data = get_http_data("http://www.svd.se%s" % path) match = re.search(r"mcid=([A-F0-9]+)\&width=", data) if not match: log.error("Can't find video file") sys.exit(2) host = "http://vms.api.qbrick.com/rest/v3/getsingleplayer/%s" % match.group(1) else: log.error("Can't find site") sys.exit(2) data = get_http_data(host) xml = ET.XML(data) try: url = xml.find("media").find("item").find("playlist").find("stream").find("format").find("substream").text except AttributeError: log.error("Can't find video file") sys.exit(2) live = xml.find("media").find("item").find("playlist").find("stream").attrib["isLive"] if live == "true": options.live = True data = get_http_data(url) xml = ET.XML(data) server = xml.find("head").find("meta").attrib["base"] streams = xml.find("body").find("switch") if is_py2_old: sa = list(streams.getiterator("video")) else: sa = list(streams.iter("video")) for i in sa: options.other = "-y '%s'" % i.attrib["src"] yield RTMP(copy.copy(options), server, i.attrib["system-bitrate"])
def get(self): data = self.get_urldata() match = re.search('params","([^"]+)"', data) if not match: yield ServiceError("Cant find params info. video need to be public.") return data2 = json.loads('["{0}"]'.format(match.group(1))) data2 = json.loads(unquote_plus(data2[0])) if "sd_src_no_ratelimit" in data2["video_data"]["progressive"][0]: yield HTTP(copy.copy(self.options), data2["video_data"]["progressive"][0]["sd_src_no_ratelimit"], "240") else: yield HTTP(copy.copy(self.options), data2["video_data"]["progressive"][0]["sd_src"], "240") if "hd_src_no_ratelimit" in data2["video_data"]["progressive"][0]: yield HTTP(copy.copy(self.options), data2["video_data"]["progressive"][0]["hd_src_no_ratelimit"], "720") else: if data2["video_data"]["progressive"][0]["hd_src"]: yield HTTP(copy.copy(self.options), data2["video_data"]["progressive"][0]["hd_src"], "720")
def get(self, options): error, data = self.get_urldata() if error: log.error("Cant download page") return match = re.search('params","([^"]+)"', data) if not match: log.error("Cant find params info. video need to be public.") return data2 = json.loads('["%s"]' % match.group(1)) data2 = json.loads(unquote_plus(data2[0])) if "sd_src_no_ratelimit" in data2["video_data"][0]: yield HTTP(copy.copy(options), data2["video_data"][0]["sd_src_no_ratelimit"], "240") else: yield HTTP(copy.copy(options), data2["video_data"][0]["sd_src"], "240") if "hd_src_no_ratelimit" in data2["video_data"][0]: yield HTTP(copy.copy(options), data2["video_data"][0]["hd_src_no_ratelimit"], "720") else: if data2["video_data"][0]["hd_src"]: yield HTTP(copy.copy(options), data2["video_data"][0]["hd_src"], "720")
def get(self, options): vid = None error, data = self.get_urldata() if error: log.error("Can't get data from that page") return if self.exclude(options): return match = re.search(r'video url-([^"]+)', data) if not match: match = re.search(r'embed.jsp\?([^"]+)"', self.get_urldata()[1]) if not match: log.error("Can't find video id") return vid = match.group(1) if not vid: path = unquote_plus(match.group(1)) error, data = get_http_data("http://www.svd.se%s" % path) match = re.search(r'embed.jsp\?([^"]+)', data) if not match: log.error("Can't find video id") return vid = match.group(1) url = "http://amz.lwcdn.com/api/cache/VideoCache.jsp?%s" % vid error, data = get_http_data(url) if error: log.error("Cant download video info") return xml = ET.XML(data) videofile = xml.find("{http://www.lemonwhale.com/xml11}VideoFile") mediafiles = videofile.find("{http://www.lemonwhale.com/xml11}MediaFiles") high = mediafiles.find("{http://www.lemonwhale.com/xml11}VideoURLHigh") if high.text: yield HTTP(copy.copy(options), high.text, 720) videourl = mediafiles.find( "{http://www.lemonwhale.com/xml11}VideoURL").text yield HTTP(copy.copy(options), videourl, 480)
def get(self): data = self.get_urldata() if self.exclude(): yield ServiceError("Excluding video") return match = re.search( r'script async defer src="(//content.youplay.se[^"]+)"', data) if not match: yield ServiceError("Cant find video info for {0}".format(self.url)) return data = self.http.request("get", "http:{0}".format(match.group(1)).content) match = re.search(r'decodeURIComponent\("([^"]+)"\)\)', data) if not match: yield ServiceError("Can't decode video info") return data = unquote_plus(match.group(1)) match = re.search(r"videoData = ({[^;]+});", data) if not match: yield ServiceError("Cant find video info for {0}".format(self.url)) return # fix broken json. regex = re.compile(r"\s(\w+):") data = regex.sub(r"'\1':", match.group(1)) data = data.replace("'", "\"") j = re.sub(r"{\s*(\w)", r'{"\1', data) j = j.replace("\n", "") j = re.sub(r'",\s*}', '"}', j) jsondata = json.loads(j) for i in jsondata["episode"]["sources"]: match = re.search(r"mp4_(\d+)", i) if match: yield HTTP(copy.copy(self.options), jsondata["episode"]["sources"][i], match.group(1))
def get(self): vid = None data = self.get_urldata() if self.exclude(): yield ServiceError("Excluding video") return match = re.search(r'video url-([^"]+)', data) if not match: match = re.search(r'embed.jsp\?([^"]+)"', self.get_urldata()) if not match: yield ServiceError("Can't find video id") return vid = match.group(1) if not vid: path = unquote_plus(match.group(1)) data = self.http.request("get", "http://www.svd.se%s" % path).content match = re.search(r'embed.jsp\?([^"]+)', data) if not match: yield ServiceError("Can't find video id") return vid = match.group(1) url = "http://ljsp.lwcdn.com/web/public/item.json?type=video&%s" % decode_html_entities( vid) data = self.http.request("get", url).text jdata = json.loads(data) videos = jdata["videos"][0]["media"]["streams"] for i in videos: if i["name"] == "auto": hls = "%s%s" % (jdata["videos"][0]["media"]["base"], i["url"]) streams = hlsparse(self.options, self.http.request("get", hls), hls) if streams: for n in list(streams.keys()): yield streams[n]
def get(self, options): if re.findall(r"sydsvenskan.se", self.url): data = self.get_urldata() match = re.search(r"data-qbrick-mcid=\"([0-9A-F]+)\"", data) if not match: log.error("Can't find video file") sys.exit(2) mcid = match.group(1) host = "http://vms.api.qbrick.com/rest/v3/getsingleplayer/%s" % mcid elif re.findall(r"di.se", self.url): data = self.get_urldata() match = re.search("src=\"(http://qstream.*)\"></iframe", data) if not match: log.error("Can't find video info") sys.exit(2) data = get_http_data(match.group(1)) match = re.search(r"data-qbrick-ccid=\"([0-9A-Z]+)\"", data) if not match: log.error("Can't find video file") sys.exit(2) host = "http://vms.api.qbrick.com/rest/v3/getplayer/%s" % match.group( 1) elif re.findall(r"svd.se", self.url): match = re.search(r'video url-([^"]*)\"', self.get_urldata()) if not match: log.error("Can't find video file") sys.exit(2) path = unquote_plus(match.group(1)) data = get_http_data("http://www.svd.se%s" % path) match = re.search(r"mcid=([A-F0-9]+)\&width=", data) if not match: log.error("Can't find video file") sys.exit(2) host = "http://vms.api.qbrick.com/rest/v3/getsingleplayer/%s" % match.group( 1) else: log.error("Can't find site") sys.exit(2) data = get_http_data(host) xml = ET.XML(data) try: url = xml.find("media").find("item").find("playlist").find( "stream").find("format").find("substream").text except AttributeError: log.error("Can't find video file") sys.exit(2) live = xml.find("media").find("item").find("playlist").find( "stream").attrib["isLive"] if live == "true": options.live = True data = get_http_data(url) xml = ET.XML(data) server = xml.find("head").find("meta").attrib["base"] streams = xml.find("body").find("switch") if is_py2_old: sa = list(streams.getiterator("video")) else: sa = list(streams.iter("video")) for i in sa: options.other = "-y '%s'" % i.attrib["src"] yield RTMP(copy.copy(options), server, i.attrib["system-bitrate"])