# -*- coding: UTF-8 -*- # /* # * Copyright (C) 2016 ivars777 # * # * # * This Program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License as published by # * the Free Software Foundation; either version 2, or (at your option) # * any later version. # * # * This Program is distributed in the hope that it will be useful, # * but WITHOUT ANY WARRANTY; without even the implied warranty of # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # * GNU General Public License for more details. # * # * You should have received a copy of the GNU General Public License # * along with this program; see the file COPYING. If not, write to # * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # * http://www.gnu.org/copyleft/gpl.html # * # */ import re,os,sys import json try: import util except: pp = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0,os.sep.join(pp.split(os.sep)[:-1])) import util import urllib2 import requests try: from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) except: pass #from aadecode import AADecoder if __name__ <> "__main__": __name__ = 'hqq' def supports(url): m = re.search(r"https?://hdgo\.\w+/(.+?)$", url, re.DOTALL) if m: return True else: return False def resolve(url): HTTP_HEADER = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'Accept-Encoding': 'none', 'Accept-Language': 'en-US,en;q=0.8', 'Referer': url} # 'Connection': 'keep-alive' streams = [] m = re.search(r"https?://hdgo\.\w+/(.+?)$", url, re.DOTALL) vid=m.group(1) url2 = "http://couber.be/"+vid r = requests.get(url2,headers=HTTP_HEADER) if r.status_code <> 200: return streams m = re.search('