@@ -0,0 +1,6 @@
|
||||
from .main import Filmweb
|
||||
|
||||
def start():
|
||||
return Filmweb()
|
||||
|
||||
config = []
|
||||
28
couchpotato/core/providers/userscript/filmweb/main.py
Normal file
28
couchpotato/core/providers/userscript/filmweb/main.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from couchpotato.core.providers.userscript.base import UserscriptBase
|
||||
import re
|
||||
|
||||
|
||||
class Filmweb(UserscriptBase):
|
||||
|
||||
includes = ['http://www.filmweb.pl/*']
|
||||
|
||||
def getMovie(self, url):
|
||||
|
||||
cookie = {'Cookie': 'welcomeScreen=welcome_screen'}
|
||||
|
||||
try:
|
||||
data = self.urlopen(url, headers = cookie)
|
||||
except:
|
||||
return
|
||||
|
||||
name = re.search("<h2.*?class=\"text-large caption\">(?P<name>[^<]+)</h2>", data)
|
||||
|
||||
if name is None:
|
||||
name = re.search("<a.*?property=\"v:name\".*?>(?P<name>[^<]+)</a>", data)
|
||||
|
||||
name = name.group('name').decode('string_escape')
|
||||
|
||||
year = re.search("<span.*?id=filmYear.*?>\((?P<year>[^\)]+)\).*?</span>", data)
|
||||
year = year.group('year')
|
||||
|
||||
return self.search(name, year)
|
||||
Reference in New Issue
Block a user