Add box office top10 to IMDB automation. closes #2427
This commit is contained in:
@@ -55,7 +55,14 @@ config = [{
|
||||
'label': 'TOP 250',
|
||||
'description': 'IMDB <a href="http://www.imdb.com/chart/top/">TOP 250</a> chart',
|
||||
'default': True,
|
||||
},
|
||||
},
|
||||
{
|
||||
'name': 'automation_charts_boxoffice',
|
||||
'type': 'bool',
|
||||
'label': 'Box offce TOP 10',
|
||||
'description': 'IMDB Box office <a href="http://www.imdb.com/chart/">TOP 10</a> chart',
|
||||
'default': True,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -70,8 +70,11 @@ class IMDBAutomation(IMDBBase):
|
||||
chart_urls = {
|
||||
'theater': 'http://www.imdb.com/movies-in-theaters/',
|
||||
'top250': 'http://www.imdb.com/chart/top',
|
||||
'boxoffice': 'http://www.imdb.com/chart/',
|
||||
}
|
||||
|
||||
first_table = ['boxoffice']
|
||||
|
||||
def getIMDBids(self):
|
||||
|
||||
movies = []
|
||||
@@ -84,6 +87,14 @@ class IMDBAutomation(IMDBBase):
|
||||
|
||||
try:
|
||||
result_div = html.find('div', attrs = {'id': 'main'})
|
||||
|
||||
try:
|
||||
if url in self.first_table:
|
||||
table = result_div.find('table')
|
||||
result_div = table if table else result_div
|
||||
except:
|
||||
pass
|
||||
|
||||
imdb_ids = getImdb(str(result_div), multiple = True)
|
||||
|
||||
for imdb_id in imdb_ids:
|
||||
|
||||
Reference in New Issue
Block a user