|
|
@ -21,6 +21,7 @@ class HDTrailers(TrailerProvider): |
|
|
|
'backup': 'http://www.hd-trailers.net/blog/', |
|
|
|
} |
|
|
|
providers = ['apple.ico', 'yahoo.ico', 'moviefone.ico', 'myspace.ico', 'favicon.ico'] |
|
|
|
only_tables_tags = SoupStrainer('table') |
|
|
|
|
|
|
|
def search(self, group): |
|
|
|
|
|
|
@ -67,8 +68,7 @@ class HDTrailers(TrailerProvider): |
|
|
|
return results |
|
|
|
|
|
|
|
try: |
|
|
|
tables = SoupStrainer('div') |
|
|
|
html = BeautifulSoup(data, parse_only = tables) |
|
|
|
html = BeautifulSoup(data, 'html.parser', parse_only = self.only_tables_tags) |
|
|
|
result_table = html.find_all('h2', text = re.compile(movie_name)) |
|
|
|
|
|
|
|
for h2 in result_table: |
|
|
@ -90,8 +90,7 @@ class HDTrailers(TrailerProvider): |
|
|
|
|
|
|
|
results = {'480p':[], '720p':[], '1080p':[]} |
|
|
|
try: |
|
|
|
tables = SoupStrainer('table') |
|
|
|
html = BeautifulSoup(data, parse_only = tables) |
|
|
|
html = BeautifulSoup(data, 'html.parser', parse_only = self.only_tables_tags) |
|
|
|
result_table = html.find('table', attrs = {'class':'bottomTable'}) |
|
|
|
|
|
|
|
for tr in result_table.find_all('tr'): |
|
|
|