Use helper

This commit is contained in:
Ruud committed 2014-01-24 16:33:10 +01:00
1 parent 3101926e9b
commit cbd8981ee2
1 file changed
+2 -3
@@ -1,9 +1,8 @@
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from couchpotato.core.helpers.variable import tryInt, splitString from couchpotato.core.helpers.variable import tryInt, splitString, removeEmpty
from couchpotato.core.logger import CPLog from couchpotato.core.logger import CPLog
from couchpotato.core.providers.automation.base import Automation from couchpotato.core.providers.automation.base import Automation
import re import re
from six.moves import filter
log = CPLog(__name__) log = CPLog(__name__)
@@ -46,7 +45,7 @@ class Letterboxd(Automation):
soup = BeautifulSoup(self.getHTMLData(self.url % username)) soup = BeautifulSoup(self.getHTMLData(self.url % username))
for movie in soup.find_all('a', attrs = {'class': 'frame'}): for movie in soup.find_all('a', attrs = {'class': 'frame'}):
match = filter(None, self.pattern.split(movie['title'])) match = removeEmpty(self.pattern.split(movie['title']))
movies.append({'title': match[0], 'year': match[1] }) movies.append({'title': match[0], 'year': match[1] })
return movies return movies