Userscript installation and updater
This commit is contained in:
@@ -17,8 +17,7 @@ class UserscriptBase(Plugin):
|
||||
def __init__(self):
|
||||
addEvent('userscript.get_includes', self.getInclude)
|
||||
addEvent('userscript.get_excludes', self.getExclude)
|
||||
addEvent('userscript.get_version', self.getVersion)
|
||||
|
||||
addEvent('userscript.get_provider_version', self.getVersion)
|
||||
addEvent('userscript.get_movie_via_url', self.belongsTo)
|
||||
|
||||
def search(self, name, year = None):
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from beautifulsoup import BeautifulSoup
|
||||
from couchpotato.core.event import fireEvent
|
||||
from couchpotato.core.helpers.variable import getImdb
|
||||
from couchpotato.core.providers.userscript.base import UserscriptBase
|
||||
import re
|
||||
|
||||
|
||||
class IMDB(UserscriptBase):
|
||||
@@ -9,16 +8,4 @@ class IMDB(UserscriptBase):
|
||||
includes = ['http*://*.imdb.com/title/tt*', 'http*://imdb.com/title/tt*']
|
||||
|
||||
def getMovie(self, url):
|
||||
|
||||
data = self.urlopen(url)
|
||||
|
||||
html = BeautifulSoup(data)
|
||||
headers = html.findAll('h5')
|
||||
|
||||
# Don't add TV show
|
||||
for head in headers:
|
||||
if 'seasons' in head.lower():
|
||||
return 'IMDB url is a TV Show'
|
||||
|
||||
identifier = re.search('(?P<id>tt[0-9{7}]+)', url).group('id')
|
||||
return fireEvent('movie.info', identifier = identifier, merge = True)
|
||||
return fireEvent('movie.info', identifier = getImdb(url), merge = True)
|
||||
|
||||
Reference in New Issue
Block a user