Userscript provider parsers

This commit is contained in:
Ruud
2011-10-12 13:47:00 +02:00
parent f719a5fd65
commit 3103a24a55
7 changed files with 13 additions and 162 deletions
@@ -1,31 +1,13 @@
from couchpotato.core.event import fireEvent
from couchpotato.core.providers.userscript.base import UserscriptBase
import re
class TMDB(UserscriptBase):
includes = ['http://www.themoviedb.org/movie/*']
#CouchPotato['themoviedb.org'] = (function(){
#
# var obj = this;
#
# function getId() {
#
# name = document.title.substr(0, document.title.indexOf("TMDb")-3).replace(/ /g, "+");
# lib.search(name, getYear())
#
# }
#
# function getYear(){
# var year = document.getElementById("year").innerHTML;
# year = year.substr(1, year.length-2);
# return year;
# }
#
# function constructor(){
# getId();
# }
#
# return constructor;
#
#})();
def getMovie(self, url):
match = re.search('(?P<id>\d+)', url)
movie = fireEvent('movie.info_by_tmdb', id = match.group('id'), merge = True)
return self.getInfo(movie['imdb'])