Rottentomatoes userscript
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
from .main import RottenTomatoes
|
||||
|
||||
def start():
|
||||
return RottenTomatoes()
|
||||
|
||||
config = []
|
||||
@@ -0,0 +1,19 @@
|
||||
from BeautifulSoup import BeautifulSoup
|
||||
from couchpotato.core.event import fireEvent
|
||||
from couchpotato.core.providers.userscript.base import UserscriptBase
|
||||
|
||||
class RottenTomatoes(UserscriptBase):
|
||||
|
||||
includes = ['http*://www.rottentomatoes.com/m/*']
|
||||
|
||||
def getMovie(self, url):
|
||||
|
||||
try:
|
||||
data = self.urlopen(url)
|
||||
except:
|
||||
return
|
||||
|
||||
html = BeautifulSoup(data)
|
||||
title = html.find('span', {'itemprop':'name'}).text
|
||||
info = fireEvent('scanner.name_year', title, single = True)
|
||||
return self.search(info['name'], info['year'])
|
||||
Reference in New Issue
Block a user