Browse Source

Add box office top10 to IMDB automation. closes #2427

pull/2436/head
Ruud 12 years ago
parent
commit
5c64ba3c9e
  1. 9
      couchpotato/core/providers/automation/imdb/__init__.py
  2. 11
      couchpotato/core/providers/automation/imdb/main.py

9
couchpotato/core/providers/automation/imdb/__init__.py

@ -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,
},
],
},
],

11
couchpotato/core/providers/automation/imdb/main.py

@ -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:

Loading…
Cancel
Save