You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
567 B
22 lines
567 B
from couchpotato.core.providers.userscript.base import UserscriptBase
|
|
import re
|
|
|
|
|
|
class AppleTrailers(UserscriptBase):
|
|
|
|
includes = ['http://trailers.apple.com/trailers/*']
|
|
|
|
def getMovie(self, url):
|
|
|
|
try:
|
|
data = self.urlopen(url)
|
|
except:
|
|
return
|
|
|
|
name = re.search("trailerTitle.*=.*\'(?P<name>.*)\';", data)
|
|
name = name.group('name').decode('string_escape')
|
|
|
|
date = re.search("releaseDate.*=.*\'(?P<date>.*)\';", data)
|
|
year = date.group('date')[:4]
|
|
|
|
return self.search(name, year)
|
|
|