Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 64.82 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2.  
  3. '''
  4. Genesis Add-on
  5. Copyright (C) 2015 lambda
  6.  
  7. This program is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation, either version 3 of the License, or
  10. (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. '''
  20.  
  21. import urllib,urllib2,urlparse,re,os,sys,xbmc,xbmcgui,xbmcaddon,xbmcvfs
  22.  
  23. try:
  24. import CommonFunctions as common
  25. except:
  26. import commonfunctionsdummy as common
  27. try:
  28. import json
  29. except:
  30. import simplejson as json
  31.  
  32.  
  33. class get(object):
  34. def __init__(self, url):
  35. self.result = self.worker(url)
  36.  
  37. def worker(self, url):
  38. try:
  39. pz = premiumize().resolve(url)
  40. if not pz == None: return pz
  41. rd = realdebrid().resolve(url)
  42. if not rd == None: return rd
  43.  
  44. if url.startswith('rtmp'):
  45. if len(re.compile('\s*timeout=(\d*)').findall(url)) == 0: url += ' timeout=10'
  46. return url
  47.  
  48. u = urlparse.urlparse(url).netloc
  49. u = u.replace('www.', '').replace('embed.', '')
  50. u = u.lower()
  51.  
  52. import sys, inspect
  53. r = inspect.getmembers(sys.modules[__name__], inspect.isclass)
  54. r = [i for i in r if hasattr(i[1], 'info') and u in eval(i[0])().info()['netloc']][0][0]
  55. r = eval(r)().resolve(url)
  56.  
  57. if r == None: return r
  58. elif type(r) == list: return r
  59. elif not r.startswith('http'): return r
  60.  
  61. try: h = dict(urlparse.parse_qsl(r.rsplit('|', 1)[1]))
  62. except: h = dict('')
  63. h.update({'Referer': url, 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:34.0) Gecko/20100101 Firefox/34.0'})
  64.  
  65. r = '%s|%s' % (r.split('|')[0], urllib.urlencode(h))
  66. return r
  67. except:
  68. return url
  69.  
  70.  
  71. class getUrl(object):
  72. def __init__(self, url, close=True, proxy=None, post=None, headers=None, mobile=False, referer=None, cookie=None, output='', timeout='10'):
  73. handlers = []
  74. if not proxy == None:
  75. handlers += [urllib2.ProxyHandler({'http':'%s' % (proxy)}), urllib2.HTTPHandler]
  76. opener = urllib2.build_opener(*handlers)
  77. opener = urllib2.install_opener(opener)
  78. if output == 'cookie' or not close == True:
  79. import cookielib
  80. cookies = cookielib.LWPCookieJar()
  81. handlers += [urllib2.HTTPHandler(), urllib2.HTTPSHandler(), urllib2.HTTPCookieProcessor(cookies)]
  82. opener = urllib2.build_opener(*handlers)
  83. opener = urllib2.install_opener(opener)
  84. try:
  85. if sys.version_info < (2, 7, 9): raise Exception()
  86. import ssl; ssl_context = ssl.create_default_context()
  87. ssl_context.check_hostname = False
  88. ssl_context.verify_mode = ssl.CERT_NONE
  89. handlers += [urllib2.HTTPSHandler(context=ssl_context)]
  90. opener = urllib2.build_opener(*handlers)
  91. opener = urllib2.install_opener(opener)
  92. except:
  93. pass
  94. try: headers.update(headers)
  95. except: headers = {}
  96. if 'User-Agent' in headers:
  97. pass
  98. elif not mobile == True:
  99. headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 6.1; rv:34.0) Gecko/20100101 Firefox/34.0'
  100. else:
  101. headers['User-Agent'] = 'Apple-iPhone/701.341'
  102. if 'referer' in headers:
  103. pass
  104. elif referer == None:
  105. headers['referer'] = url
  106. else:
  107. headers['referer'] = referer
  108. if not 'Accept-Language' in headers:
  109. headers['Accept-Language'] = 'en-US'
  110. if 'cookie' in headers:
  111. pass
  112. elif not cookie == None:
  113. headers['cookie'] = cookie
  114. request = urllib2.Request(url, data=post, headers=headers)
  115. response = urllib2.urlopen(request, timeout=int(timeout))
  116. if output == 'cookie':
  117. result = []
  118. for c in cookies: result.append('%s=%s' % (c.name, c.value))
  119. result = "; ".join(result)
  120. elif output == 'geturl':
  121. result = response.geturl()
  122. else:
  123. result = response.read()
  124. if close == True:
  125. response.close()
  126. self.result = result
  127.  
  128. class captcha:
  129. def worker(self, data):
  130. self.captcha = {}
  131.  
  132. self.solvemedia(data)
  133. if not self.type == None: return self.captcha
  134.  
  135. self.recaptcha(data)
  136. if not self.type == None: return self.captcha
  137.  
  138. self.capimage(data)
  139. if not self.type == None: return self.captcha
  140.  
  141. self.numeric(data)
  142. if not self.type == None: return self.captcha
  143.  
  144. def solvemedia(self, data):
  145. try:
  146. url = common.parseDOM(data, "iframe", ret="src")
  147. url = [i for i in url if 'api.solvemedia.com' in i]
  148.  
  149. if len(url) > 0: self.type = 'solvemedia'
  150. else: self.type = None ; return
  151.  
  152. result = getUrl(url[0], referer='').result
  153.  
  154. response = common.parseDOM(result, "iframe", ret="src")
  155. response += common.parseDOM(result, "img", ret="src")
  156. response = [i for i in response if '/papi/media' in i][0]
  157. response = 'http://api.solvemedia.com' + response
  158. response = self.keyboard(response)
  159.  
  160. post = {}
  161. f = common.parseDOM(result, "form", attrs = { "action": "verify.noscript" })[0]
  162. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  163. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  164. post.update({'adcopy_response': response})
  165.  
  166. getUrl('http://api.solvemedia.com/papi/verify.noscript', post=urllib.urlencode(post)).result
  167.  
  168. self.captcha.update({'adcopy_challenge': post['adcopy_challenge'], 'adcopy_response': 'manual_challenge'})
  169. except:
  170. pass
  171.  
  172. def recaptcha(self, data):
  173. try:
  174. url = []
  175. if data.startswith('http://www.google.com'): url += [data]
  176. url += common.parseDOM(data, "script", ret="src", attrs = { "type": "text/javascript" })
  177. url = [i for i in url if 'http://www.google.com' in i]
  178.  
  179. if len(url) > 0: self.type = 'recaptcha'
  180. else: self.type = None ; return
  181.  
  182. result = getUrl(url[0]).result
  183. challenge = re.compile("challenge\s+:\s+'(.+?)'").findall(result)[0]
  184. response = 'http://www.google.com/recaptcha/api/image?c=' + challenge
  185. response = self.keyboard(response)
  186.  
  187. self.captcha.update({'recaptcha_challenge_field': challenge, 'recaptcha_challenge': challenge, 'recaptcha_response_field': response, 'recaptcha_response': response})
  188. except:
  189. pass
  190.  
  191. def capimage(self, data):
  192. try:
  193. url = common.parseDOM(data, "img", ret="src")
  194. url = [i for i in url if 'captcha' in i]
  195.  
  196. if len(url) > 0: self.type = 'capimage'
  197. else: self.type = None ; return
  198.  
  199. response = self.keyboard(url[0])
  200. self.captcha.update({'code': response})
  201. except:
  202. pass
  203.  
  204. def numeric(self, data):
  205. try:
  206. url = re.compile("left:(\d+)px;padding-top:\d+px;'>&#(.+?);<").findall(data)
  207.  
  208. if len(url) > 0: self.type = 'numeric'
  209. else: self.type = None ; return
  210.  
  211. result = sorted(url[0], key=lambda ltr: int(ltr[0]))
  212. response = ''.join(str(int(num[1])-48) for num in result)
  213.  
  214. self.captcha.update({'code': response})
  215. except:
  216. pass
  217.  
  218. def keyboard(self, response):
  219. try:
  220. dataPath = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo("profile"))
  221. i = os.path.join(dataPath.decode("utf-8"),'img')
  222. f = xbmcvfs.File(i, 'w')
  223. f.write(getUrl(response).result)
  224. f.close()
  225. f = xbmcgui.ControlImage(450,5,375,115, i)
  226. d = xbmcgui.WindowDialog()
  227. d.addControl(f)
  228. xbmcvfs.delete(i)
  229. d.show()
  230. xbmc.sleep(3000)
  231. t = 'Type the letters in the image'
  232. c = common.getUserInput(t, '')
  233. d.close()
  234. return c
  235. except:
  236. return
  237.  
  238. class regex:
  239. def worker(self, data):
  240. try:
  241. data = str(data).replace('\r','').replace('\n','').replace('\t','')
  242.  
  243. url = re.compile('(.+?)<regex>').findall(data)[0]
  244. regex = re.compile('<regex>(.+?)</regex>').findall(data)
  245. except:
  246. return
  247.  
  248. for x in regex:
  249. try:
  250. name = re.compile('<name>(.+?)</name>').findall(x)[0]
  251.  
  252. expres = re.compile('<expres>(.+?)</expres>').findall(x)[0]
  253.  
  254. referer = re.compile('<referer>(.+?)</referer>').findall(x)[0]
  255. referer = urllib.unquote_plus(referer)
  256. referer = common.replaceHTMLCodes(referer)
  257. referer = referer.encode('utf-8')
  258.  
  259. page = re.compile('<page>(.+?)</page>').findall(x)[0]
  260. page = urllib.unquote_plus(page)
  261. page = common.replaceHTMLCodes(page)
  262. page = page.encode('utf-8')
  263.  
  264. result = getUrl(page, referer=referer).result
  265. result = str(result).replace('\r','').replace('\n','').replace('\t','')
  266. result = str(result).replace('\/','/')
  267.  
  268. r = re.compile(expres).findall(result)[0]
  269. url = url.replace('$doregex[%s]' % name, r)
  270. except:
  271. pass
  272.  
  273. url = common.replaceHTMLCodes(url)
  274. url = url.encode('utf-8')
  275. return url
  276.  
  277. class unwise:
  278. def worker(self, str_eval):
  279. page_value=""
  280. try:
  281. ss="w,i,s,e=("+str_eval+')'
  282. exec (ss)
  283. page_value=self.__unwise(w,i,s,e)
  284. except: return
  285. return page_value
  286.  
  287. def __unwise(self, w, i, s, e):
  288. lIll = 0;
  289. ll1I = 0;
  290. Il1l = 0;
  291. ll1l = [];
  292. l1lI = [];
  293. while True:
  294. if (lIll < 5):
  295. l1lI.append(w[lIll])
  296. elif (lIll < len(w)):
  297. ll1l.append(w[lIll]);
  298. lIll+=1;
  299. if (ll1I < 5):
  300. l1lI.append(i[ll1I])
  301. elif (ll1I < len(i)):
  302. ll1l.append(i[ll1I])
  303. ll1I+=1;
  304. if (Il1l < 5):
  305. l1lI.append(s[Il1l])
  306. elif (Il1l < len(s)):
  307. ll1l.append(s[Il1l]);
  308. Il1l+=1;
  309. if (len(w) + len(i) + len(s) + len(e) == len(ll1l) + len(l1lI) + len(e)):
  310. break;
  311.  
  312. lI1l = ''.join(ll1l)
  313. I1lI = ''.join(l1lI)
  314. ll1I = 0;
  315. l1ll = [];
  316. for lIll in range(0,len(ll1l),2):
  317. ll11 = -1;
  318. if ( ord(I1lI[ll1I]) % 2):
  319. ll11 = 1;
  320. l1ll.append(chr( int(lI1l[lIll: lIll+2], 36) - ll11));
  321. ll1I+=1;
  322. if (ll1I >= len(l1lI)):
  323. ll1I = 0;
  324. ret=''.join(l1ll)
  325. if 'eval(function(w,i,s,e)' in ret:
  326. ret=re.compile('eval\(function\(w,i,s,e\).*}\((.*?)\)').findall(ret)[0]
  327. return self.worker(ret)
  328. else:
  329. return ret
  330.  
  331. class js:
  332. def worker(self, script):
  333. aSplit = script.split(";',")
  334. p = str(aSplit[0])
  335. aSplit = aSplit[1].split(",")
  336. a = int(aSplit[0])
  337. c = int(aSplit[1])
  338. k = aSplit[2].split(".")[0].replace("'", '').split('|')
  339. e = ''
  340. d = ''
  341.  
  342. sUnpacked = str(self.__unpack(p, a, c, k, e, d))
  343. sUnpacked = sUnpacked.replace('\\', '')
  344.  
  345. url = self.__parse(sUnpacked)
  346. return url
  347.  
  348. def __unpack(self, p, a, c, k, e, d):
  349. while (c > 1):
  350. c = c -1
  351. if (k[c]):
  352. p = re.sub('\\b' + str(self.__itoa(c, a)) +'\\b', k[c], p)
  353. return p
  354.  
  355. def __itoa(self, num, radix):
  356. result = ""
  357. while num > 0:
  358. result = "0123456789abcdefghijklmnopqrstuvwxyz"[num % radix] + result
  359. num /= radix
  360. return result
  361.  
  362. def __parse(self, sUnpacked):
  363. url = re.compile("'file' *, *'(.+?)'").findall(sUnpacked)
  364. url += re.compile("file *: *[\'|\"](.+?)[\'|\"]").findall(sUnpacked)
  365. url += re.compile("playlist=(.+?)&").findall(sUnpacked)
  366. url += common.parseDOM(sUnpacked, "embed", ret="src")
  367.  
  368. url = [i for i in url if not i.endswith('.srt')]
  369.  
  370. url = 'http://' + url[-1].split('://', 1)[-1]
  371. return url
  372.  
  373.  
  374. class premiumize:
  375. def __init__(self):
  376. self.user = xbmcaddon.Addon().getSetting("premiumize_user")
  377. self.password = xbmcaddon.Addon().getSetting("premiumize_password")
  378.  
  379. def info(self):
  380. return {
  381. 'netloc': ['bitshare.com', 'filefactory.com', 'k2s.cc', 'oboom.com', 'rapidgator.net', 'uploaded.net'],
  382. 'host': ['Bitshare', 'Filefactory', 'K2S', 'Oboom', 'Rapidgator', 'Uploaded'],
  383. 'quality': 'High',
  384. 'captcha': False,
  385. 'a/c': True
  386. }
  387.  
  388. def status(self):
  389. if (self.user == '' or self.password == ''): return False
  390. else: return True
  391.  
  392. def hosts(self):
  393. try:
  394. if self.status() == False: raise Exception()
  395.  
  396. url = 'http://api.premiumize.me/pm-api/v1.php?method=hosterlist&params[login]=%s&params[pass]=%s' % (self.user, self.password)
  397.  
  398. result = getUrl(url).result
  399.  
  400. pz = json.loads(result)['result']['hosterlist']
  401. pz = [i.rsplit('.' ,1)[0].lower() for i in pz]
  402. return pz
  403. except:
  404. return
  405.  
  406. def resolve(self, url):
  407. try:
  408. if self.status() == False: raise Exception()
  409.  
  410. url = 'http://api.premiumize.me/pm-api/v1.php?method=directdownloadlink&params[login]=%s&params[pass]=%s&params[link]=%s' % (self.user, self.password, urllib.quote_plus(url))
  411.  
  412. result = getUrl(url, close=False).result
  413.  
  414. url = json.loads(result)['result']['location']
  415. return url
  416. except:
  417. return
  418.  
  419. class realdebrid:
  420. def __init__(self):
  421. self.user = xbmcaddon.Addon().getSetting("realdedrid_user")
  422. self.password = xbmcaddon.Addon().getSetting("realdedrid_password")
  423.  
  424. def info(self):
  425. return {
  426. 'netloc': ['bitshare.com', 'filefactory.com', 'k2s.cc', 'oboom.com', 'rapidgator.net', 'uploaded.net'],
  427. 'host': ['Bitshare', 'Filefactory', 'K2S', 'Oboom', 'Rapidgator', 'Uploaded'],
  428. 'quality': 'High',
  429. 'captcha': False,
  430. 'a/c': True
  431. }
  432.  
  433. def status(self):
  434. if (self.user == '' or self.password == ''): return False
  435. else: return True
  436.  
  437. def hosts(self):
  438. try:
  439. if self.status() == False: raise Exception()
  440.  
  441. url = 'http://real-debrid.com/api/hosters.php'
  442.  
  443. result = getUrl(url).result
  444.  
  445. rd = json.loads('[%s]' % result)
  446. rd = [i.rsplit('.' ,1)[0].lower() for i in rd]
  447. return rd
  448. except:
  449. return
  450.  
  451. def resolve(self, url):
  452. try:
  453. if self.status() == False: raise Exception()
  454.  
  455. login_data = urllib.urlencode({'user' : self.user, 'pass' : self.password})
  456. login_link = 'http://real-debrid.com/ajax/login.php?%s' % login_data
  457. result = getUrl(login_link, close=False).result
  458. result = json.loads(result)
  459. error = result['error']
  460. if not error == 0: raise Exception()
  461.  
  462. url = 'http://real-debrid.com/ajax/unrestrict.php?link=%s' % url
  463. url = url.replace('filefactory.com/stream/', 'filefactory.com/file/')
  464. result = getUrl(url).result
  465. result = json.loads(result)
  466. url = result['generated_links'][0][-1]
  467. return url
  468. except:
  469. return
  470.  
  471.  
  472. class _180upload:
  473. def info(self):
  474. return {
  475. 'netloc': ['180upload.com'],
  476. 'host': ['180upload'],
  477. 'quality': 'High',
  478. 'captcha': False,
  479. 'a/c': False
  480. }
  481.  
  482. def resolve(self, url):
  483. try:
  484. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  485. url = 'http://180upload.com/embed-%s.html' % url
  486.  
  487. result = getUrl(url).result
  488.  
  489. post = {}
  490. f = common.parseDOM(result, "form", attrs = { "id": "captchaForm" })[0]
  491. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  492. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  493. post = urllib.urlencode(post)
  494.  
  495. result = getUrl(url, post=post).result
  496.  
  497. result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
  498. url = js().worker(result)
  499. return url
  500. except:
  501. return
  502.  
  503. class allmyvideos:
  504. def info(self):
  505. return {
  506. 'netloc': ['allmyvideos.net'],
  507. 'host': ['Allmyvideos'],
  508. 'quality': 'Medium',
  509. 'captcha': False,
  510. 'a/c': False
  511. }
  512.  
  513. def resolve(self, url):
  514. try:
  515. url = url.replace('/embed-', '/')
  516. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  517. url = 'http://allmyvideos.net/embed-%s.html' % url
  518.  
  519. result = getUrl(url, mobile=True).result
  520. url = re.compile('"file" *: *"(http.+?)"').findall(result)[-1]
  521. return url
  522. except:
  523. return
  524.  
  525. class bestreams:
  526. def info(self):
  527. return {
  528. 'netloc': ['bestreams.net'],
  529. 'host': ['Bestreams'],
  530. 'quality': 'Low',
  531. 'captcha': False,
  532. 'a/c': False
  533. }
  534.  
  535. def resolve(self, url):
  536. try:
  537. url = url.replace('/embed-', '/')
  538. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  539. url = 'http://bestreams.net/embed-%s.html' % url
  540.  
  541. result = getUrl(url, mobile=True).result
  542. url = re.compile('file *: *"(http.+?)"').findall(result)[-1]
  543. return url
  544. except:
  545. return
  546.  
  547. class clicknupload:
  548. def info(self):
  549. return {
  550. 'netloc': ['clicknupload.com'],
  551. 'host': ['Clicknupload'],
  552. 'quality': 'High',
  553. 'captcha': True,
  554. 'a/c': False
  555. }
  556.  
  557. def resolve(self, url):
  558. try:
  559. result = getUrl(url).result
  560.  
  561. post = {}
  562. f = common.parseDOM(result, "Form", attrs = { "action": "" })
  563. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  564. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  565. post.update({'method_free': 'Free Download'})
  566. post = urllib.urlencode(post)
  567.  
  568. result = getUrl(url, post=post).result
  569.  
  570. post = {}
  571. f = common.parseDOM(result, "Form", attrs = { "action": "" })
  572. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  573. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  574. post.update({'method_free': 'Free Download'})
  575. post.update(captcha().worker(result))
  576. post = urllib.urlencode(post)
  577.  
  578. result = getUrl(url, post=post).result
  579.  
  580. url = common.parseDOM(result, "a", ret="onClick")
  581. url = [i for i in url if i.startswith('window.open')][0]
  582. url = re.compile('[\'|\"](.+?)[\'|\"]').findall(url)[0]
  583. return url
  584. except:
  585. return
  586.  
  587. class cloudzilla:
  588. def info(self):
  589. return {
  590. 'netloc': ['cloudzilla.to'],
  591. 'host': ['Cloudzilla'],
  592. 'quality': 'Medium',
  593. 'captcha': False,
  594. 'a/c': False
  595. }
  596.  
  597. def resolve(self, url):
  598. try:
  599. url = url.replace('/share/file/', '/embed/')
  600. result = getUrl(url).result
  601. url = re.compile('var\s+vurl *= *"(http.+?)"').findall(result)[0]
  602. return url
  603. except:
  604. return
  605.  
  606. class coolcdn:
  607. def info(self):
  608. return {
  609. 'netloc': ['movshare.net', 'novamov.com', 'nowvideo.sx', 'videoweed.es'],
  610. 'host': ['Movshare', 'Novamov', 'Nowvideo', 'Videoweed'],
  611. 'quality': 'Low',
  612. 'captcha': False,
  613. 'a/c': False
  614. }
  615.  
  616. def resolve(self, url):
  617. try:
  618. netloc = urlparse.urlparse(url).netloc
  619. netloc = netloc.replace('www.', '').replace('embed.', '')
  620. netloc = netloc.lower()
  621.  
  622. id = re.compile('//.+?/.+?/([\w]+)').findall(url)
  623. id += re.compile('//.+?/.+?v=([\w]+)').findall(url)
  624. id = id[0]
  625.  
  626. url = 'http://embed.%s/embed.php?v=%s' % (netloc, id)
  627.  
  628. result = getUrl(url).result
  629.  
  630. key = re.compile('flashvars.filekey=(.+?);').findall(result)[-1]
  631. try: key = re.compile('\s+%s="(.+?)"' % key).findall(result)[-1]
  632. except: pass
  633.  
  634. url = 'http://www.%s/api/player.api.php?key=%s&file=%s' % (netloc, key, id)
  635. result = getUrl(url).result
  636.  
  637. url = re.compile('url=(.+?)&').findall(result)[0]
  638. return url
  639. except:
  640. return
  641.  
  642. class daclips:
  643. def info(self):
  644. return {
  645. 'netloc': ['daclips.in'],
  646. 'host': ['Daclips'],
  647. 'quality': 'Low',
  648. 'captcha': False,
  649. 'a/c': False
  650. }
  651.  
  652. def resolve(self, url):
  653. try:
  654. result = getUrl(url, mobile=True).result
  655. url = re.compile('file *: *"(http.+?)"').findall(result)[-1]
  656. return url
  657. except:
  658. return
  659.  
  660. class datemule:
  661. def info(self):
  662. return {
  663. 'netloc': ['datemule.com']
  664. }
  665.  
  666. def resolve(self, url):
  667. try:
  668. result = getUrl(url, mobile=True).result
  669. url = re.compile('file *: *"(http.+?)"').findall(result)[0]
  670. return url
  671. except:
  672. return
  673.  
  674. class fastvideo:
  675. def info(self):
  676. return {
  677. 'netloc': ['fastvideo.in', 'faststream.in'],
  678. 'host': ['Fastvideo', 'Faststream'],
  679. 'quality': 'Low',
  680. 'captcha': False,
  681. 'a/c': False
  682. }
  683.  
  684. def resolve(self, url):
  685. try:
  686. url = url.replace('/embed-', '/')
  687. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  688. url = 'http://fastvideo.in/embed-%s.html' % url
  689.  
  690. result = getUrl(url, mobile=True).result
  691. url = re.compile('file *: *"(http.+?)"').findall(result)[-1]
  692. return url
  693. except:
  694. return
  695.  
  696. class filehoot:
  697. def info(self):
  698. return {
  699. 'netloc': ['filehoot.com'],
  700. 'host': ['Filehoot'],
  701. 'quality': 'Low',
  702. 'captcha': False,
  703. 'a/c': False
  704. }
  705.  
  706. def resolve(self, url):
  707. try:
  708. url = url.replace('/embed-', '/')
  709. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  710. url = 'http://filehoot.com/embed-%s.html' % url
  711.  
  712. result = getUrl(url, mobile=True).result
  713. url = re.compile('file *: *"(http.+?)"').findall(result)[0]
  714. return url
  715. except:
  716. return
  717.  
  718. class filenuke:
  719. def info(self):
  720. return {
  721. 'netloc': ['filenuke.com', 'sharesix.com'],
  722. 'host': ['Filenuke', 'Sharesix'],
  723. 'quality': 'Low',
  724. 'captcha': False,
  725. 'a/c': False
  726. }
  727.  
  728. def resolve(self, url):
  729. try:
  730. result = getUrl(url).result
  731. post = {}
  732. try: f = common.parseDOM(result, "form", attrs = { "method": "POST" })[0]
  733. except: f = ''
  734. k = common.parseDOM(f, "input", ret="name")
  735. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  736. post = urllib.urlencode(post)
  737.  
  738. result = getUrl(url, post=post).result
  739.  
  740. url = re.compile("var\s+lnk\d* *= *'(http.+?)'").findall(result)[0]
  741. return url
  742. except:
  743. return
  744.  
  745. class googledocs:
  746. def info(self):
  747. return {
  748. 'netloc': ['docs.google.com', 'drive.google.com']
  749. }
  750.  
  751. def resolve(self, url):
  752. try:
  753. url = url.split('/preview', 1)[0]
  754. url = url.replace('drive.google.com', 'docs.google.com')
  755.  
  756. result = getUrl(url).result
  757. result = re.compile('"fmt_stream_map",(".+?")').findall(result)[0]
  758.  
  759. u = json.loads(result)
  760. u = [i.split('|')[-1] for i in u.split(',')]
  761. u = sum([self.tag(i) for i in u], [])
  762.  
  763. url = []
  764. try: url += [[i for i in u if i['quality'] == '1080p'][0]]
  765. except: pass
  766. try: url += [[i for i in u if i['quality'] == 'HD'][0]]
  767. except: pass
  768. try: url += [[i for i in u if i['quality'] == 'SD'][0]]
  769. except: pass
  770.  
  771. if url == []: return
  772. return url
  773. except:
  774. return
  775.  
  776. def tag(self, url):
  777. quality = re.compile('itag=(\d*)').findall(url)
  778. quality += re.compile('=m(\d*)$').findall(url)
  779. try: quality = quality[0]
  780. except: return []
  781.  
  782. if quality in ['37', '137', '299', '96', '248', '303', '46']:
  783. return [{'quality': '1080p', 'url': url}]
  784. elif quality in ['22', '84', '136', '298', '120', '95', '247', '302', '45', '102']:
  785. return [{'quality': 'HD', 'url': url}]
  786. elif quality in ['35', '44', '135', '244', '94']:
  787. return [{'quality': 'SD', 'url': url}]
  788. elif quality in ['18', '34', '43', '82', '100', '101', '134', '243', '93']:
  789. return [{'quality': 'SD', 'url': url}]
  790. elif quality in ['5', '6', '36', '83', '133', '242', '92', '132']:
  791. return [{'quality': 'SD', 'url': url}]
  792. else:
  793. return []
  794.  
  795. class googleplus:
  796. def info(self):
  797. return {
  798. 'netloc': ['plus.google.com', 'picasaweb.google.com']
  799. }
  800.  
  801. def resolve(self, url):
  802. try:
  803. if 'picasaweb' in url.lower():
  804. result = getUrl(url).result
  805. aid = re.compile('aid=(\d*)').findall(result)[0]
  806.  
  807. pid = urlparse.urlparse(url).fragment
  808. oid = re.compile('/(\d*)/').findall(urlparse.urlparse(url).path)[0]
  809. key = urlparse.parse_qs(urlparse.urlparse(url).query)['authkey'][0]
  810.  
  811. url = 'http://plus.google.com/photos/%s/albums/%s/%s?authkey=%s' % (oid, aid, pid, key)
  812.  
  813. result = getUrl(url, mobile=True).result
  814.  
  815. u = re.compile('"(http[s]*://.+?videoplayback[?].+?)"').findall(result)[::-1]
  816. u = [i.replace('\\u003d','=').replace('\\u0026','&') for i in u]
  817. u = sum([self.tag(i) for i in u], [])
  818.  
  819. url = []
  820. try: url += [[i for i in u if i['quality'] == '1080p'][0]]
  821. except: pass
  822. try: url += [[i for i in u if i['quality'] == 'HD'][0]]
  823. except: pass
  824. try: url += [[i for i in u if i['quality'] == 'SD'][0]]
  825. except: pass
  826.  
  827. if url == []: return
  828. return url
  829. except:
  830. return
  831.  
  832. def tag(self, url):
  833. quality = re.compile('itag=(\d*)').findall(url)
  834. quality += re.compile('=m(\d*)$').findall(url)
  835. try: quality = quality[0]
  836. except: return []
  837.  
  838. if quality in ['37', '137', '299', '96', '248', '303', '46']:
  839. return [{'quality': '1080p', 'url': url}]
  840. elif quality in ['22', '84', '136', '298', '120', '95', '247', '302', '45', '102']:
  841. return [{'quality': 'HD', 'url': url}]
  842. elif quality in ['35', '44', '135', '244', '94']:
  843. return [{'quality': 'SD', 'url': url}]
  844. elif quality in ['18', '34', '43', '82', '100', '101', '134', '243', '93']:
  845. return [{'quality': 'SD', 'url': url}]
  846. elif quality in ['5', '6', '36', '83', '133', '242', '92', '132']:
  847. return [{'quality': 'SD', 'url': url}]
  848. else:
  849. return []
  850.  
  851. class gorillavid:
  852. def info(self):
  853. return {
  854. 'netloc': ['gorillavid.com', 'gorillavid.in'],
  855. 'host': ['Gorillavid'],
  856. 'quality': 'Low',
  857. 'captcha': False,
  858. 'a/c': False
  859. }
  860.  
  861. def resolve(self, url):
  862. try:
  863. url = url.replace('/embed-', '/')
  864. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  865. url = 'http://gorillavid.in/embed-%s.html' % url
  866.  
  867. result = getUrl(url, mobile=True).result
  868. url = re.compile('file *: *"(http.+?)"').findall(result)[-1]
  869.  
  870. request = urllib2.Request(url)
  871. response = urllib2.urlopen(request, timeout=30)
  872. response.close()
  873.  
  874. type = str(response.info()["Content-Type"])
  875. if type == 'text/html': raise Exception()
  876.  
  877. return url
  878. except:
  879. return
  880.  
  881. class grifthost:
  882. def info(self):
  883. return {
  884. 'netloc': ['grifthost.com'],
  885. 'host': ['Grifthost'],
  886. 'quality': 'High',
  887. 'captcha': False,
  888. 'a/c': False
  889. }
  890.  
  891. def resolve(self, url):
  892. try:
  893. url = url.replace('/embed-', '/')
  894. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  895. url = 'http://grifthost.com/embed-%s.html' % url
  896.  
  897. result = getUrl(url).result
  898.  
  899. try:
  900. post = {}
  901. f = common.parseDOM(result, "Form", attrs = { "method": "POST" })[0]
  902. f = f.replace('"submit"', '"hidden"')
  903. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  904. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  905. post = urllib.urlencode(post)
  906. result = getUrl(url, post=post).result
  907. except:
  908. pass
  909.  
  910. result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
  911. url = js().worker(result)
  912. return url
  913. except:
  914. return
  915.  
  916. class hugefiles:
  917. def info(self):
  918. return {
  919. 'netloc': ['hugefiles.net'],
  920. 'host': ['Hugefiles'],
  921. 'quality': 'High',
  922. 'captcha': True,
  923. 'a/c': False
  924. }
  925.  
  926. def resolve(self, url):
  927. try:
  928. result = getUrl(url).result
  929.  
  930. post = {}
  931. f = common.parseDOM(result, "Form", attrs = { "action": "" })
  932. f += common.parseDOM(result, "form", attrs = { "action": "" })
  933. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  934. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  935. post.update({'method_free': 'Free Download'})
  936. post.update(captcha().worker(result))
  937. post = urllib.urlencode(post)
  938.  
  939. result = getUrl(url, post=post).result
  940.  
  941. url = re.compile('fileUrl\s*=\s*[\'|\"](.+?)[\'|\"]').findall(result)[0]
  942. return url
  943. except:
  944. return
  945.  
  946. class ipithos:
  947. def info(self):
  948. return {
  949. 'netloc': ['ipithos.to'],
  950. 'host': ['Ipithos'],
  951. 'quality': 'High',
  952. 'captcha': False,
  953. 'a/c': False
  954. }
  955.  
  956. def resolve(self, url):
  957. try:
  958. url = url.replace('/embed-', '/')
  959. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  960. url = 'http://ipithos.to/embed-%s.html' % url
  961.  
  962. result = getUrl(url, mobile=True).result
  963.  
  964. result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
  965. url = js().worker(result)
  966. return url
  967. except:
  968. return
  969.  
  970. class ishared:
  971. def info(self):
  972. return {
  973. 'netloc': ['ishared.eu'],
  974. 'host': ['iShared'],
  975. 'quality': 'High',
  976. 'captcha': False,
  977. 'a/c': False
  978. }
  979.  
  980. def resolve(self, url):
  981. try:
  982. result = getUrl(url).result
  983. url = re.compile('path *: *"(http.+?)"').findall(result)[-1]
  984. return url
  985. except:
  986. return
  987.  
  988. class kingfiles:
  989. def info(self):
  990. return {
  991. 'netloc': ['kingfiles.net'],
  992. 'host': ['Kingfiles'],
  993. 'quality': 'High',
  994. 'captcha': True,
  995. 'a/c': False
  996. }
  997.  
  998. def resolve(self, url):
  999. try:
  1000. result = getUrl(url).result
  1001.  
  1002. post = {}
  1003. f = common.parseDOM(result, "Form", attrs = { "action": "" })[0]
  1004. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  1005. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  1006. post.update({'method_free': ' '})
  1007. post = urllib.urlencode(post)
  1008.  
  1009. result = getUrl(url, post=post).result
  1010.  
  1011. post = {}
  1012. f = common.parseDOM(result, "Form", attrs = { "action": "" })[0]
  1013. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  1014. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  1015. post.update({'method_free': ' '})
  1016. post.update(captcha().worker(result))
  1017. post = urllib.urlencode(post)
  1018.  
  1019. result = getUrl(url, post=post).result
  1020.  
  1021. url = re.compile("var\s+download_url *= *'(.+?)'").findall(result)[0]
  1022. return url
  1023. except:
  1024. return
  1025.  
  1026. class mailru:
  1027. def info(self):
  1028. return {
  1029. 'netloc': ['mail.ru', 'my.mail.ru', 'videoapi.my.mail.ru']
  1030. }
  1031.  
  1032. def resolve(self, url):
  1033. try:
  1034. usr = re.compile('/mail/(.+?)/').findall(url)[0]
  1035. vid = re.compile('(\d*)[.]html').findall(url)[0]
  1036. url = 'http://videoapi.my.mail.ru/videos/mail/%s/_myvideo/%s.json?ver=0.2.60' % (usr, vid)
  1037.  
  1038. import requests
  1039. result = requests.get(url).content
  1040. cookie = requests.get(url).headers['Set-Cookie']
  1041.  
  1042. u = json.loads(result)['videos']
  1043. h = "|Cookie=%s" % urllib.quote(cookie)
  1044.  
  1045. url = []
  1046. try: url += [[{'quality': '1080p', 'url': i['url'] + h} for i in u if i['key'] == '1080p'][0]]
  1047. except: pass
  1048. try: url += [[{'quality': 'HD', 'url': i['url'] + h} for i in u if i['key'] == '720p'][0]]
  1049. except: pass
  1050. try: url += [[{'quality': 'SD', 'url': i['url'] + h} for i in u if not (i['key'] == '1080p' or i ['key'] == '720p')][0]]
  1051. except: pass
  1052.  
  1053. if url == []: return
  1054. return url
  1055. except:
  1056. return
  1057.  
  1058. class mightyupload:
  1059. def info(self):
  1060. return {
  1061. 'netloc': ['mightyupload.com'],
  1062. 'host': ['Mightyupload'],
  1063. 'quality': 'High',
  1064. 'captcha': False,
  1065. 'a/c': False
  1066. }
  1067.  
  1068. def resolve(self, url):
  1069. try:
  1070. url = url.replace('/embed-', '/')
  1071. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1072. url = 'http://www.mightyupload.com/embed-%s.html' % url
  1073.  
  1074. result = getUrl(url, mobile=True).result
  1075.  
  1076. url = re.compile("file *: *'(.+?)'").findall(result)
  1077. if len(url) > 0: return url[0]
  1078.  
  1079. result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
  1080. url = js().worker(result)
  1081. return url
  1082. except:
  1083. return
  1084.  
  1085. class mooshare:
  1086. def info(self):
  1087. return {
  1088. 'netloc': ['mooshare.biz'],
  1089. 'host': ['Mooshare'],
  1090. 'quality': 'Low',
  1091. 'captcha': False,
  1092. 'a/c': False
  1093. }
  1094.  
  1095. def resolve(self, url):
  1096. try:
  1097. url = url.replace('/embed-', '/')
  1098. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1099. url = 'http://mooshare.biz/embed-%s.html?play=1&confirm=Close+Ad+and+Watch+as+Free+User' % url
  1100.  
  1101. result = getUrl(url).result
  1102. url = re.compile('file *: *"(http.+?)"').findall(result)[-1]
  1103. return url
  1104. except:
  1105. return
  1106.  
  1107. class movdivx:
  1108. def info(self):
  1109. return {
  1110. 'netloc': ['movdivx.com'],
  1111. 'host': ['Movdivx'],
  1112. 'quality': 'Low',
  1113. 'captcha': False,
  1114. 'a/c': False
  1115. }
  1116.  
  1117. def resolve(self, url):
  1118. try:
  1119. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1120. url = 'http://www.movdivx.com/%s' % url
  1121.  
  1122. result = getUrl(url).result
  1123.  
  1124. post = {}
  1125. f = common.parseDOM(result, "Form", attrs = { "action": "" })[0]
  1126. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  1127. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  1128. post.update({'method_free': 'Free Download'})
  1129. post = urllib.urlencode(post)
  1130.  
  1131. result = getUrl(url, post=post).result
  1132.  
  1133. result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
  1134. url = js().worker(result)
  1135. return url
  1136. except:
  1137. return
  1138.  
  1139. class movpod:
  1140. def info(self):
  1141. return {
  1142. 'netloc': ['movpod.net', 'movpod.in'],
  1143. 'host': ['Movpod'],
  1144. 'quality': 'Low',
  1145. 'captcha': False,
  1146. 'a/c': False
  1147. }
  1148.  
  1149. def resolve(self, url):
  1150. try:
  1151. url = url.replace('/embed-', '/')
  1152. url = url.replace('/vid/', '/')
  1153.  
  1154. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1155. url = 'http://movpod.in/embed-%s.html' % url
  1156.  
  1157. result = getUrl(url).result
  1158. url = re.compile('file *: *"(http.+?)"').findall(result)[-1]
  1159.  
  1160. request = urllib2.Request(url)
  1161. response = urllib2.urlopen(request, timeout=30)
  1162. response.close()
  1163.  
  1164. type = str(response.info()["Content-Type"])
  1165.  
  1166. if type == 'text/html': raise Exception()
  1167. return url
  1168. except:
  1169. return
  1170.  
  1171. class movreel:
  1172. def info(self):
  1173. return {
  1174. 'netloc': ['movreel.com'],
  1175. 'host': ['Movreel'],
  1176. 'quality': 'High',
  1177. 'captcha': False,
  1178. 'a/c': False
  1179. }
  1180.  
  1181. def resolve(self, url):
  1182. try:
  1183. user = xbmcaddon.Addon().getSetting("movreel_user")
  1184. password = xbmcaddon.Addon().getSetting("movreel_password")
  1185.  
  1186. login = 'http://movreel.com/login.html'
  1187. post = {'op': 'login', 'login': user, 'password': password, 'redirect': url}
  1188. post = urllib.urlencode(post)
  1189. result = getUrl(url, close=False).result
  1190. result += getUrl(login, post=post, close=False).result
  1191.  
  1192. post = {}
  1193. f = common.parseDOM(result, "Form", attrs = { "name": "F1" })[-1]
  1194. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  1195. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  1196. post.update({'method_free': '', 'method_premium': ''})
  1197. post = urllib.urlencode(post)
  1198.  
  1199. import time
  1200. request = urllib2.Request(url, post)
  1201.  
  1202. for i in range(0, 3):
  1203. try:
  1204. response = urllib2.urlopen(request, timeout=10)
  1205. result = response.read()
  1206. response.close()
  1207. url = re.compile('(<a .+?</a>)').findall(result)
  1208. url = [i for i in url if 'Download Link' in i][-1]
  1209. url = common.parseDOM(url, "a", ret="href")[0]
  1210. return url
  1211. except:
  1212. time.sleep(1)
  1213. except:
  1214. return
  1215.  
  1216. class mrfile:
  1217. def info(self):
  1218. return {
  1219. 'netloc': ['mrfile.me'],
  1220. 'host': ['Mrfile'],
  1221. 'quality': 'High',
  1222. 'captcha': False,
  1223. 'a/c': False
  1224. }
  1225.  
  1226. def resolve(self, url):
  1227. try:
  1228. result = getUrl(url).result
  1229.  
  1230. post = {}
  1231. f = common.parseDOM(result, "Form", attrs = { "name": "F1" })[-1]
  1232. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  1233. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  1234. post.update({'method_free': '', 'method_premium': ''})
  1235. post = urllib.urlencode(post)
  1236.  
  1237. result = getUrl(url, post=post).result
  1238.  
  1239. url = re.compile('(<a\s+href=.+?>Download\s+.+?</a>)').findall(result)[-1]
  1240. url = common.parseDOM(url, "a", ret="href")[0]
  1241. return url
  1242. except:
  1243. return
  1244.  
  1245. class mybeststream:
  1246. def info(self):
  1247. return {
  1248. 'netloc': ['mybeststream.xyz']
  1249. }
  1250.  
  1251. def resolve(self, url):
  1252. try:
  1253. referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0]
  1254. page = url.replace(referer, '').replace('&referer=', '').replace('referer=', '')
  1255.  
  1256. result = getUrl(url, referer=referer).result
  1257. result = re.compile("}[(]('.+?' *, *'.+?' *, *'.+?' *, *'.+?')[)]").findall(result)[-1]
  1258. result = unwise().worker(result)
  1259.  
  1260. strm = re.compile("file *: *[\'|\"](.+?)[\'|\"]").findall(result)
  1261. strm = [i for i in strm if i.startswith('rtmp')][0]
  1262. url = '%s pageUrl=%s live=1 timeout=10' % (strm, page)
  1263. return url
  1264. except:
  1265. return
  1266.  
  1267. class nosvideo:
  1268. def info(self):
  1269. return {
  1270. 'netloc': ['nosvideo.com'],
  1271. 'host': ['Nosvideo'],
  1272. 'quality': 'Low',
  1273. 'captcha': False,
  1274. 'a/c': False
  1275. }
  1276.  
  1277. def resolve(self, url):
  1278. try:
  1279. result = getUrl(url).result
  1280.  
  1281. post = {}
  1282. f = common.parseDOM(result, "Form", attrs = { "method": "POST" })[0]
  1283. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  1284. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  1285. post.update({'method_free': 'Free Download'})
  1286. post = urllib.urlencode(post)
  1287.  
  1288. result = getUrl(url, post=post).result
  1289.  
  1290. result = re.compile('(eval.*?\)\)\))').findall(result)[0]
  1291. url = js().worker(result)
  1292.  
  1293. result = getUrl(url).result
  1294. url = common.parseDOM(result, "file")[0]
  1295. return url
  1296. except:
  1297. return
  1298.  
  1299. class openload:
  1300. def info(self):
  1301. return {
  1302. 'netloc': ['openload.io'],
  1303. 'host': ['Openload'],
  1304. 'quality': 'High',
  1305. 'captcha': False,
  1306. 'a/c': False
  1307. }
  1308.  
  1309. def resolve(self, url):
  1310. try:
  1311. result = getUrl(url).result
  1312.  
  1313. url = common.parseDOM(result, "span", attrs = { "id": "realdownload" })[0]
  1314. url = common.parseDOM(url, "a", ret="href")[0]
  1315. return url
  1316. except:
  1317. return
  1318.  
  1319. class played:
  1320. def info(self):
  1321. return {
  1322. 'netloc': ['played.to'],
  1323. 'host': ['Played'],
  1324. 'quality': 'Low',
  1325. 'captcha': False,
  1326. 'a/c': False
  1327. }
  1328.  
  1329. def resolve(self, url):
  1330. try:
  1331. url = url.replace('/embed-', '/')
  1332. url = url.replace('//', '/')
  1333. url = re.compile('/.+?/([\w]+)').findall(url)[0]
  1334. url = 'http://played.to/embed-%s.html' % url
  1335.  
  1336. result = getUrl(url, mobile=True).result
  1337. url = re.compile('file *: *"(http.+?)"').findall(result)[-1]
  1338. return url
  1339. except:
  1340. return
  1341.  
  1342. class primeshare:
  1343. def info(self):
  1344. return {
  1345. 'netloc': ['primeshare.tv'],
  1346. 'host': ['Primeshare'],
  1347. 'quality': 'High',
  1348. 'captcha': False,
  1349. 'a/c': False
  1350. }
  1351.  
  1352. def resolve(self, url):
  1353. try:
  1354. result = getUrl(url, mobile=True).result
  1355.  
  1356. url = common.parseDOM(result, "video")[0]
  1357. url = common.parseDOM(url, "source", ret="src", attrs = { "type": ".+?" })[0]
  1358. return url
  1359. except:
  1360. return
  1361.  
  1362. class sharerepo:
  1363. def info(self):
  1364. return {
  1365. 'netloc': ['sharerepo.com'],
  1366. 'host': ['Sharerepo'],
  1367. 'quality': 'Low',
  1368. 'captcha': False,
  1369. 'a/c': False
  1370. }
  1371.  
  1372. def resolve(self, url):
  1373. try:
  1374. result = getUrl(url).result
  1375. url = re.compile("file *: *'(http.+?)'").findall(result)[-1]
  1376. return url
  1377. except:
  1378. return
  1379.  
  1380. class stagevu:
  1381. def info(self):
  1382. return {
  1383. 'netloc': ['stagevu.com'],
  1384. 'host': ['StageVu'],
  1385. 'quality': 'Low',
  1386. 'captcha': False,
  1387. 'a/c': False
  1388. }
  1389.  
  1390. def resolve(self, url):
  1391. try:
  1392. result = getUrl(url).result
  1393.  
  1394. url = common.parseDOM(result, "embed", ret="src", attrs = { "type": "video.+?" })[0]
  1395. return url
  1396. except:
  1397. return
  1398.  
  1399. class streamcloud:
  1400. def info(self):
  1401. return {
  1402. 'netloc': ['streamcloud.eu'],
  1403. 'host': ['Streamcloud'],
  1404. 'quality': 'Medium',
  1405. 'captcha': False,
  1406. 'a/c': False
  1407. }
  1408.  
  1409. def resolve(self, url):
  1410. try:
  1411. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1412. url = 'http://streamcloud.eu/%s' % url
  1413.  
  1414. result = getUrl(url).result
  1415.  
  1416. post = {}
  1417. f = common.parseDOM(result, "form", attrs = { "class": "proform" })[0]
  1418. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  1419. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  1420. post = urllib.urlencode(post)
  1421. post = post.replace('op=download1', 'op=download2')
  1422.  
  1423. result = getUrl(url, post=post).result
  1424.  
  1425. url = re.compile('file *: *"(http.+?)"').findall(result)[-1]
  1426. return url
  1427. except:
  1428. return
  1429.  
  1430. class streamin:
  1431. def info(self):
  1432. return {
  1433. 'netloc': ['streamin.to'],
  1434. 'host': ['Streamin'],
  1435. 'quality': 'Medium',
  1436. 'captcha': False,
  1437. 'a/c': False
  1438. }
  1439.  
  1440. def resolve(self, url):
  1441. try:
  1442. url = url.replace('/embed-', '/')
  1443. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1444. url = 'http://streamin.to/embed-%s.html' % url
  1445.  
  1446. result = getUrl(url, mobile=True).result
  1447. url = re.compile("file *: *[\'|\"](http.+?)[\'|\"]").findall(result)[-1]
  1448. return url
  1449. except:
  1450. return
  1451.  
  1452. class thefile:
  1453. def info(self):
  1454. return {
  1455. 'netloc': ['thefile.me'],
  1456. 'host': ['Thefile'],
  1457. 'quality': 'Low',
  1458. 'captcha': False,
  1459. 'a/c': False
  1460. }
  1461.  
  1462. def resolve(self, url):
  1463. try:
  1464. url = url.replace('/embed-', '/')
  1465. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1466. url = 'http://thefile.me/embed-%s.html' % url
  1467.  
  1468. result = getUrl(url, mobile=True).result
  1469.  
  1470. result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
  1471. url = js().worker(result)
  1472. return url
  1473. except:
  1474. return
  1475.  
  1476. class thevideo:
  1477. def info(self):
  1478. return {
  1479. 'netloc': ['thevideo.me'],
  1480. 'host': ['Thevideo'],
  1481. 'quality': 'Low',
  1482. 'captcha': False,
  1483. 'a/c': False
  1484. }
  1485.  
  1486. def resolve(self, url):
  1487. try:
  1488. url = url.replace('/embed-', '/')
  1489. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1490. url = 'http://thevideo.me/embed-%s.html' % url
  1491.  
  1492. result = getUrl(url).result
  1493. result = result.replace('\n','')
  1494.  
  1495. import ast
  1496. url = re.compile("'sources' *: *(\[.+?\])").findall(result)[-1]
  1497. url = ast.literal_eval(url)
  1498. url = url[-1]['file']
  1499. return url
  1500. except:
  1501. return
  1502.  
  1503. class tusfiles:
  1504. def info(self):
  1505. return {
  1506. 'netloc': ['tusfiles.net'],
  1507. 'host': ['Tusfiles'],
  1508. 'quality': 'High',
  1509. 'captcha': False,
  1510. 'a/c': False
  1511. }
  1512.  
  1513. def resolve(self, url):
  1514. try:
  1515. result = getUrl(url).result
  1516.  
  1517. result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
  1518. url = js().worker(result)
  1519. return url
  1520. except:
  1521. return
  1522.  
  1523. class uploadc:
  1524. def info(self):
  1525. return {
  1526. 'netloc': ['uploadc.com', 'zalaa.com'],
  1527. 'host': ['Uploadc', 'Zalaa'],
  1528. 'quality': 'High',
  1529. 'captcha': False,
  1530. 'a/c': False
  1531. }
  1532.  
  1533. def resolve(self, url):
  1534. try:
  1535. url = url.replace('/embed-', '/')
  1536. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1537. url = 'http://uploadc.com/embed-%s.html' % url
  1538.  
  1539. result = getUrl(url, mobile=True).result
  1540.  
  1541. url = re.compile("'file' *, *'(.+?)'").findall(result)
  1542. if len(url) > 0: return url[0]
  1543.  
  1544. result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
  1545. url = js().worker(result)
  1546. return url
  1547. except:
  1548. return
  1549.  
  1550. class uploadrocket:
  1551. def info(self):
  1552. return {
  1553. 'netloc': ['uploadrocket.net'],
  1554. 'host': ['Uploadrocket'],
  1555. 'quality': 'High',
  1556. 'captcha': True,
  1557. 'a/c': False
  1558. }
  1559.  
  1560. def resolve(self, url):
  1561. try:
  1562. result = getUrl(url).result
  1563. result = result.decode('iso-8859-1').encode('utf-8')
  1564.  
  1565. post = {}
  1566. f = common.parseDOM(result, "Form", attrs = { "name": "freeorpremium" })[0]
  1567. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  1568. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  1569. post.update({'method_isfree': 'Click for Free Download'})
  1570. post = urllib.urlencode(post)
  1571.  
  1572. result = getUrl(url, post=post).result
  1573. result = result.decode('iso-8859-1').encode('utf-8')
  1574.  
  1575. post = {}
  1576. f = common.parseDOM(result, "Form", attrs = { "name": "F1" })[0]
  1577. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  1578. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  1579. post.update(captcha().worker(result))
  1580. post = urllib.urlencode(post)
  1581.  
  1582. result = getUrl(url, post=post).result
  1583. result = result.decode('iso-8859-1').encode('utf-8')
  1584.  
  1585. url = common.parseDOM(result, "a", ret="href", attrs = { "onclick": "DL.+?" })[0]
  1586. return url
  1587. except:
  1588. return
  1589.  
  1590. class uptobox:
  1591. def info(self):
  1592. return {
  1593. 'netloc': ['uptobox.com'],
  1594. 'host': ['Uptobox'],
  1595. 'quality': 'High',
  1596. 'captcha': False,
  1597. 'a/c': False
  1598. }
  1599.  
  1600. def resolve(self, url):
  1601. try:
  1602. result = getUrl(url).result
  1603.  
  1604. post = {}
  1605. f = common.parseDOM(result, "form", attrs = { "name": "F1" })[0]
  1606. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  1607. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  1608. post = urllib.urlencode(post)
  1609.  
  1610. result = getUrl(url, post=post).result
  1611.  
  1612. url = common.parseDOM(result, "div", attrs = { "align": ".+?" })
  1613. url = [i for i in url if 'button_upload' in i][0]
  1614. url = common.parseDOM(url, "a", ret="href")[0]
  1615. url = ['http' + i for i in url.split('http') if 'uptobox.com' in i][0]
  1616. return url
  1617. except:
  1618. return
  1619.  
  1620. class v_vids:
  1621. def info(self):
  1622. return {
  1623. 'netloc': ['v-vids.com'],
  1624. 'host': ['V-vids'],
  1625. 'quality': 'High',
  1626. 'captcha': False,
  1627. 'a/c': False
  1628. }
  1629.  
  1630. def resolve(self, url):
  1631. try:
  1632. result = getUrl(url).result
  1633.  
  1634. post = {}
  1635. f = common.parseDOM(result, "Form", attrs = { "name": "F1" })[0]
  1636. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  1637. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  1638. post.update({'method_free': '', 'method_premium': ''})
  1639. post = urllib.urlencode(post)
  1640.  
  1641. result = getUrl(url, post=post).result
  1642.  
  1643. url = common.parseDOM(result, "a", ret="href", attrs = { "id": "downloadbutton" })[0]
  1644. return url
  1645. except:
  1646. return
  1647.  
  1648. class veehd:
  1649. def info(self):
  1650. return {
  1651. 'netloc': ['veehd.com'],
  1652. }
  1653.  
  1654. def resolve(self, url):
  1655. try:
  1656. result = getUrl(url, close=False).result
  1657. result = result.replace('\n','')
  1658.  
  1659. url = re.compile('function\s*load_download.+?src\s*:\s*"(.+?)"').findall(result)[0]
  1660. url = urlparse.urljoin('http://veehd.com', url)
  1661.  
  1662. result = getUrl(url, close=False).result
  1663.  
  1664. i = common.parseDOM(result, "iframe", ret="src")
  1665. if len(i) > 0:
  1666. i = urlparse.urljoin('http://veehd.com', i[0])
  1667. getUrl(i, close=False).result
  1668. result = getUrl(url).result
  1669.  
  1670. url = re.compile('href *= *"([^"]+(?:mkv|mp4|avi))"').findall(result)
  1671. url += re.compile('src *= *"([^"]+(?:divx|avi))"').findall(result)
  1672. url += re.compile('"url" *: *"(.+?)"').findall(result)
  1673. url = urllib.unquote(url[0])
  1674. return url
  1675. except:
  1676. return
  1677.  
  1678. class vidbull:
  1679. def info(self):
  1680. return {
  1681. 'netloc': ['vidbull.com'],
  1682. 'host': ['Vidbull'],
  1683. 'quality': 'Low',
  1684. 'captcha': False,
  1685. 'a/c': False
  1686. }
  1687.  
  1688. def resolve(self, url):
  1689. try:
  1690. result = getUrl(url, mobile=True).result
  1691. url = common.parseDOM(result, "source", ret="src", attrs = { "type": "video.+?" })[0]
  1692. return url
  1693. except:
  1694. return
  1695.  
  1696. class videomega:
  1697. def info(self):
  1698. return {
  1699. 'netloc': ['videomega.tv']
  1700. }
  1701.  
  1702. def resolve(self, url):
  1703. try:
  1704. url = urlparse.urlparse(url).query
  1705. url = urlparse.parse_qsl(url)[0][1]
  1706. url = 'http://videomega.tv/cdn.php?ref=%s' % url
  1707.  
  1708. result = getUrl(url, mobile=True).result
  1709.  
  1710. url = common.parseDOM(result, "source", ret="src", attrs = { "type": "video.+?" })[0]
  1711. return url
  1712. except:
  1713. return
  1714.  
  1715. class vidplay:
  1716. def info(self):
  1717. return {
  1718. 'netloc': ['vidplay.net'],
  1719. 'host': ['Vidplay'],
  1720. 'quality': 'High',
  1721. 'captcha': False,
  1722. 'a/c': False
  1723. }
  1724.  
  1725. def resolve(self, url):
  1726. try:
  1727. url = url.replace('/embed-', '/')
  1728. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1729. u = 'http://vidplay.net/vidembed-%s' % url
  1730.  
  1731. url = getUrl(u, output='geturl').result
  1732. if u == url: raise Exception()
  1733. return url
  1734. except:
  1735. return
  1736.  
  1737. class vidspot:
  1738. def info(self):
  1739. return {
  1740. 'netloc': ['vidspot.net'],
  1741. 'host': ['Vidspot'],
  1742. 'quality': 'Medium',
  1743. 'captcha': False,
  1744. 'a/c': False
  1745. }
  1746.  
  1747. def resolve(self, url):
  1748. try:
  1749. url = url.replace('/embed-', '/')
  1750. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1751. url = 'http://vidspot.net/embed-%s.html' % url
  1752.  
  1753. result = getUrl(url, mobile=True).result
  1754. url = re.compile('"file" *: *"(http.+?)"').findall(result)[-1]
  1755.  
  1756. query = urlparse.urlparse(url).query
  1757. url = url[:url.find('?')]
  1758. url = '%s?%s&direct=false' % (url, query)
  1759. return url
  1760. except:
  1761. return
  1762.  
  1763. class vidto:
  1764. def info(self):
  1765. return {
  1766. 'netloc': ['vidto.me'],
  1767. 'host': ['Vidto'],
  1768. 'quality': 'Medium',
  1769. 'captcha': False,
  1770. 'a/c': False
  1771. }
  1772.  
  1773. def resolve(self, url):
  1774. try:
  1775. url = url.replace('/embed-', '/')
  1776. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1777. url = 'http://vidto.me/embed-%s.html' % url
  1778.  
  1779. result = getUrl(url).result
  1780.  
  1781. result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
  1782. result = re.sub(r'(\',\d*,\d*,)', r';\1', result)
  1783. url = js().worker(result)
  1784. return url
  1785. except:
  1786. return
  1787.  
  1788. class vidzi:
  1789. def info(self):
  1790. return {
  1791. 'netloc': ['vidzi.tv'],
  1792. 'host': ['Vidzi'],
  1793. 'quality': 'Low',
  1794. 'captcha': False,
  1795. 'a/c': False
  1796. }
  1797.  
  1798. def resolve(self, url):
  1799. try:
  1800. result = getUrl(url, mobile=True).result
  1801. result = result.replace('\n','')
  1802. result = re.compile('sources *: *\[.+?\]').findall(result)[-1]
  1803. result = re.compile('file *: *"(http.+?)"').findall(result)
  1804.  
  1805. url = [i for i in result if '.m3u8' in i]
  1806. if len(url) > 0: return url[0]
  1807. url = [i for i in result if not '.m3u8' in i]
  1808. if len(url) > 0: return url[0]
  1809. except:
  1810. return
  1811.  
  1812. class vimeo:
  1813. def info(self):
  1814. return {
  1815. 'netloc': ['vimeo.com']
  1816. }
  1817.  
  1818. def resolve(self, url):
  1819. try:
  1820. url = [i for i in url.split('/') if i.isdigit()][-1]
  1821. url = 'http://player.vimeo.com/video/%s/config' % url
  1822.  
  1823. result = getUrl(url).result
  1824. result = json.loads(result)
  1825. u = result['request']['files']['h264']
  1826.  
  1827. url = None
  1828. try: url = u['hd']['url']
  1829. except: pass
  1830. try: url = u['sd']['url']
  1831. except: pass
  1832.  
  1833. return url
  1834. except:
  1835. return
  1836.  
  1837. class vk:
  1838. def info(self):
  1839. return {
  1840. 'netloc': ['vk.com']
  1841. }
  1842.  
  1843. def resolve(self, url):
  1844. try:
  1845. url = url.replace('https://', 'http://')
  1846. result = getUrl(url).result
  1847.  
  1848. u = re.compile('url(720|540|480|360|240)=(.+?)&').findall(result)
  1849.  
  1850. url = []
  1851. try: url += [[{'quality': 'HD', 'url': i[1]} for i in u if i[0] == '720'][0]]
  1852. except: pass
  1853. try: url += [[{'quality': 'SD', 'url': i[1]} for i in u if i[0] == '540'][0]]
  1854. except: pass
  1855. try: url += [[{'quality': 'SD', 'url': i[1]} for i in u if i[0] == '480'][0]]
  1856. except: pass
  1857. if not url == []: return url
  1858. try: url += [[{'quality': 'SD', 'url': i[1]} for i in u if i[0] == '360'][0]]
  1859. except: pass
  1860. if not url == []: return url
  1861. try: url += [[{'quality': 'SD', 'url': i[1]} for i in u if i[0] == '240'][0]]
  1862. except: pass
  1863.  
  1864. if url == []: return
  1865. return url
  1866. except:
  1867. return
  1868.  
  1869. class vodlocker:
  1870. def info(self):
  1871. return {
  1872. 'netloc': ['vodlocker.com'],
  1873. 'host': ['Vodlocker'],
  1874. 'quality': 'Low',
  1875. 'captcha': False,
  1876. 'a/c': False
  1877. }
  1878.  
  1879. def resolve(self, url):
  1880. try:
  1881. url = url.replace('/embed-', '/')
  1882. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1883. url = 'http://vodlocker.com/embed-%s.html' % url
  1884.  
  1885. result = getUrl(url, mobile=True).result
  1886. url = re.compile('file *: *"(http.+?)"').findall(result)[-1]
  1887. return url
  1888. except:
  1889. return
  1890.  
  1891. class xfileload:
  1892. def info(self):
  1893. return {
  1894. 'netloc': ['xfileload.com'],
  1895. 'host': ['Xfileload'],
  1896. 'quality': 'High',
  1897. 'captcha': True,
  1898. 'a/c': False
  1899. }
  1900.  
  1901. def resolve(self, url):
  1902. try:
  1903. result = getUrl(url, close=False).result
  1904.  
  1905. post = {}
  1906. f = common.parseDOM(result, "Form", attrs = { "action": "" })
  1907. k = common.parseDOM(f, "input", ret="name", attrs = { "type": "hidden" })
  1908. for i in k: post.update({i: common.parseDOM(f, "input", ret="value", attrs = { "name": i })[0]})
  1909. post.update(captcha().worker(result))
  1910. post = urllib.urlencode(post)
  1911.  
  1912. import time
  1913. request = urllib2.Request(url, post)
  1914.  
  1915. for i in range(0, 5):
  1916. try:
  1917. response = urllib2.urlopen(request, timeout=10)
  1918. result = response.read()
  1919. response.close()
  1920. if 'download2' in result: raise Exception()
  1921. url = common.parseDOM(result, "a", ret="href", attrs = { "target": "" })[0]
  1922. return url
  1923. except:
  1924. time.sleep(1)
  1925. except:
  1926. return
  1927.  
  1928. class xvidstage:
  1929. def info(self):
  1930. return {
  1931. 'netloc': ['xvidstage.com'],
  1932. 'host': ['Xvidstage'],
  1933. 'quality': 'Medium',
  1934. 'captcha': False,
  1935. 'a/c': False
  1936. }
  1937.  
  1938. def resolve(self, url):
  1939. try:
  1940. url = url.replace('/embed-', '/')
  1941. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1942. url = 'http://xvidstage.com/embed-%s.html' % url
  1943.  
  1944. result = getUrl(url, mobile=True).result
  1945.  
  1946. result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
  1947. url = js().worker(result)
  1948. return url
  1949. except:
  1950. return
  1951.  
  1952. class youtube:
  1953. def info(self):
  1954. return {
  1955. 'netloc': ['youtube.com'],
  1956. 'host': ['Youtube'],
  1957. 'quality': 'Medium',
  1958. 'captcha': False,
  1959. 'a/c': False
  1960. }
  1961.  
  1962. def resolve(self, url):
  1963. try:
  1964. id = url.split("?v=")[-1].split("/")[-1].split("?")[0].split("&")[0]
  1965. result = getUrl('http://www.youtube.com/watch?v=%s' % id).result
  1966.  
  1967. message = common.parseDOM(result, "div", attrs = { "id": "unavailable-submessage" })
  1968. message = ''.join(message)
  1969.  
  1970. alert = common.parseDOM(result, "div", attrs = { "id": "watch7-notification-area" })
  1971.  
  1972. if len(alert) > 0: raise Exception()
  1973. if re.search('[a-zA-Z]', message): raise Exception()
  1974.  
  1975. url = 'plugin://plugin.video.youtube/?action=play_video&videoid=%s' % id
  1976. return url
  1977. except:
  1978. return
  1979.  
  1980. class zettahost:
  1981. def info(self):
  1982. return {
  1983. 'netloc': ['zettahost.tv'],
  1984. 'host': ['Zettahost'],
  1985. 'quality': 'High',
  1986. 'captcha': False,
  1987. 'a/c': False
  1988. }
  1989.  
  1990. def resolve(self, url):
  1991. try:
  1992. url = url.replace('/embed-', '/')
  1993. url = re.compile('//.+?/([\w]+)').findall(url)[0]
  1994. url = 'http://zettahost.tv/embed-%s.html' % url
  1995.  
  1996. result = getUrl(url, mobile=True).result
  1997.  
  1998. result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
  1999. url = js().worker(result)
  2000. return url
  2001. except:
  2002. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement