Added Blu-ray.com backlog automation
I missed a few movies, so I added backlog functionality to Blu-ray.com If you want to add all Blu-rays that ever came out to the wanted list, you can use this. Be careful with what you wish for :D
This commit is contained in:
@@ -18,6 +18,13 @@ config = [{
|
|||||||
'default': False,
|
'default': False,
|
||||||
'type': 'enabler',
|
'type': 'enabler',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': 'backlog',
|
||||||
|
'advanced': True,
|
||||||
|
'description': 'Parses the history tables until the minimum movie year is reached. Note: only do this once!',
|
||||||
|
'default': False,
|
||||||
|
'type': 'bool',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from bs4 import BeautifulSoup
|
||||||
from couchpotato.core.helpers.rss import RSS
|
from couchpotato.core.helpers.rss import RSS
|
||||||
from couchpotato.core.helpers.variable import tryInt
|
from couchpotato.core.helpers.variable import tryInt
|
||||||
from couchpotato.core.logger import CPLog
|
from couchpotato.core.logger import CPLog
|
||||||
@@ -10,11 +11,47 @@ class Bluray(Automation, RSS):
|
|||||||
|
|
||||||
interval = 1800
|
interval = 1800
|
||||||
rss_url = 'http://www.blu-ray.com/rss/newreleasesfeed.xml'
|
rss_url = 'http://www.blu-ray.com/rss/newreleasesfeed.xml'
|
||||||
|
backlog_url = 'http://www.blu-ray.com/movies/movies.php?show=newreleases&page=%s'
|
||||||
|
|
||||||
def getIMDBids(self):
|
def getIMDBids(self):
|
||||||
|
|
||||||
movies = []
|
movies = []
|
||||||
|
|
||||||
|
if self.conf('backlog'):
|
||||||
|
|
||||||
|
page = 0
|
||||||
|
while True:
|
||||||
|
page = page + 1
|
||||||
|
|
||||||
|
url = self.backlog_url % page
|
||||||
|
data = self.getHTMLData(url)
|
||||||
|
soup = BeautifulSoup(data)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Stop if the release year is before the minimal year
|
||||||
|
page_year = soup.body.find_all('center')[3].table.tr.find_all('td', recursive=False)[3].h3.get_text().split(', ')[1]
|
||||||
|
if tryInt(page_year) < self.getMinimal('year'):
|
||||||
|
break
|
||||||
|
|
||||||
|
for table in soup.body.find_all('center')[3].table.tr.find_all('td', recursive=False)[3].find_all('table')[1:20]:
|
||||||
|
name = table.h3.get_text().lower().split('blu-ray')[0].strip()
|
||||||
|
year = table.small.get_text().split('|')[1].strip()
|
||||||
|
|
||||||
|
if not name.find('/') == -1: # make sure it is not a double movie release
|
||||||
|
continue
|
||||||
|
|
||||||
|
if tryInt(year) < self.getMinimal('year'):
|
||||||
|
continue
|
||||||
|
|
||||||
|
imdb = self.search(name, year)
|
||||||
|
|
||||||
|
if imdb:
|
||||||
|
if self.isMinimalMovie(imdb):
|
||||||
|
movies.append(imdb['imdb'])
|
||||||
|
except:
|
||||||
|
log.debug('Error loading page: %s', page)
|
||||||
|
break
|
||||||
|
|
||||||
rss_movies = self.getRSSData(self.rss_url)
|
rss_movies = self.getRSSData(self.rss_url)
|
||||||
|
|
||||||
for movie in rss_movies:
|
for movie in rss_movies:
|
||||||
|
|||||||
Reference in New Issue
Block a user