Add box office top10 to IMDB automation. closes #2427
This commit is contained in:
@@ -56,6 +56,13 @@ config = [{
|
|||||||
'description': 'IMDB <a href="http://www.imdb.com/chart/top/">TOP 250</a> chart',
|
'description': 'IMDB <a href="http://www.imdb.com/chart/top/">TOP 250</a> chart',
|
||||||
'default': True,
|
'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 = {
|
chart_urls = {
|
||||||
'theater': 'http://www.imdb.com/movies-in-theaters/',
|
'theater': 'http://www.imdb.com/movies-in-theaters/',
|
||||||
'top250': 'http://www.imdb.com/chart/top',
|
'top250': 'http://www.imdb.com/chart/top',
|
||||||
|
'boxoffice': 'http://www.imdb.com/chart/',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
first_table = ['boxoffice']
|
||||||
|
|
||||||
def getIMDBids(self):
|
def getIMDBids(self):
|
||||||
|
|
||||||
movies = []
|
movies = []
|
||||||
@@ -84,6 +87,14 @@ class IMDBAutomation(IMDBBase):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
result_div = html.find('div', attrs = {'id': 'main'})
|
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)
|
imdb_ids = getImdb(str(result_div), multiple = True)
|
||||||
|
|
||||||
for imdb_id in imdb_ids:
|
for imdb_id in imdb_ids:
|
||||||
|
|||||||
Reference in New Issue
Block a user