lambdascrapers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # -*- coding: UTF-8 -*-
  2. # -Cleaned and Checked on 11-13-2018 by JewBMX in Scrubs.
  3. # -Fixed by JewBMX thanks to Muad'Dib's youtube stream :) <3 that Kodi Guru.
  4. import re,traceback,urllib,urlparse,json,base64,xbmcgui
  5. from resources.lib.modules import cleantitle
  6. from resources.lib.modules import client
  7. from resources.lib.modules import directstream
  8. from resources.lib.modules import log_utils
  9. from resources.lib.modules import source_utils
  10. # Old 1080pmovie.com
  11. class source:
  12. def __init__(self):
  13. self.priority = 1
  14. self.language = ['en']
  15. self.domains = ['watchhdmovie.net']
  16. self.base_link = 'https://watchhdmovie.net'
  17. self.search_link = '/?s=%s'
  18. def movie(self, imdb, title, localtitle, aliases, year):
  19. try:
  20. url = {'imdb': imdb, 'title': title, 'year': year}
  21. url = urllib.urlencode(url)
  22. return url
  23. except:
  24. failure = traceback.format_exc()
  25. log_utils.log('1080PMovies - Exception: \n' + str(failure))
  26. return
  27. def sources(self, url, hostDict, hostprDict):
  28. sources = []
  29. try:
  30. if url == None: return
  31. urldata = urlparse.parse_qs(url)
  32. urldata = dict((i, urldata[i][0]) for i in urldata)
  33. title = urldata['title'].replace(':', ' ').lower()
  34. year = urldata['year']
  35. search_id = title.lower()
  36. start_url = urlparse.urljoin(self.base_link, self.search_link % (search_id.replace(' ','+') + '+' + year))
  37. headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'}
  38. html = client.request(start_url,headers=headers)
  39. Links = re.compile('a href="(.+?)" title="(.+?)"',re.DOTALL).findall(html)
  40. for link,name in Links:
  41. if title.lower() in name.lower():
  42. if year in name:
  43. holder = client.request(link,headers=headers)
  44. Alterjnates = re.compile('<button class="text-capitalize dropdown-item" value="(.+?)"',re.DOTALL).findall(holder)
  45. for alt_link in Alterjnates:
  46. alt_url = alt_link.split ("e=")[1]
  47. valid, host = source_utils.is_host_valid(alt_url, hostDict)
  48. sources.append({'source':host,'quality':'1080p','language': 'en','url':alt_url,'info':[],'direct':False,'debridonly':False})
  49. return sources
  50. except:
  51. failure = traceback.format_exc()
  52. log_utils.log('1080PMovies - Exception: \n' + str(failure))
  53. return sources
  54. def resolve(self, url):
  55. return directstream.googlepass(url)