Browse Source

Merge adc0b4604a into f0d7eddcfb

pull/7202/merge
Hans van Luttikhuizen 8 years ago
committed by GitHub
parent
commit
4e911907dc
  1. 4
      README.md
  2. 26
      couchpotato/core/media/movie/providers/automation/letterboxd.py
  3. 2
      version.py

4
README.md

@ -2,8 +2,8 @@ CouchPotato
=====
[![Join the chat at https://gitter.im/CouchPotato/CouchPotatoServer](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/CouchPotato/CouchPotatoServer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/CouchPotato/CouchPotatoServer.svg?branch=develop)](https://travis-ci.org/CouchPotato/CouchPotatoServer)
[![Coverage Status](https://coveralls.io/repos/CouchPotato/CouchPotatoServer/badge.svg?branch=develop&service=github)](https://coveralls.io/github/CouchPotato/CouchPotatoServer?branch=develop)
[![Build Status](https://travis-ci.org/CouchPotato/CouchPotatoServer.svg?branch=master)](https://travis-ci.org/CouchPotato/CouchPotatoServer)
[![Coverage Status](https://coveralls.io/repos/CouchPotato/CouchPotatoServer/badge.svg?branch=master&service=github)](https://coveralls.io/github/CouchPotato/CouchPotatoServer?branch=master)
CouchPotato (CP) is an automatic NZB and torrent downloader. You can keep a "movies I want"-list and it will search for NZBs/torrents of these movies every X hours.
Once a movie is found, it will send it to SABnzbd or download the torrent to a specified directory.

26
couchpotato/core/media/movie/providers/automation/letterboxd.py

@ -13,7 +13,7 @@ autoload = 'Letterboxd'
class Letterboxd(Automation):
url = 'http://letterboxd.com/%s/watchlist/'
url = 'http://letterboxd.com/%s/watchlist/page/%d/'
pattern = re.compile(r'(.*)\((\d*)\)')
interval = 1800
@ -48,16 +48,28 @@ class Letterboxd(Automation):
soup = BeautifulSoup(self.getHTMLData(self.url % username))
for movie in soup.find_all('li', attrs = {'class': 'poster-container'}):
img = movie.find('img', movie)
title = img.get('alt')
pagination_items = soup.find_all('li', attrs={'class': 'paginate-page'})
pages = range(1, len(pagination_items) + 1) if pagination_items else [1]
movies.append({
'title': title
})
for page in pages:
soup = BeautifulSoup(self.getHTMLData(self.url % (username, page)))
# soup = BeautifulSoup(Plugin.urlopen(self, url=self.url % (username, page)))
movies += self.getMoviesFromHTML(soup)
return movies
def getMoviesFromHTML(self, html):
movies = []
for movie in html.find_all('li', attrs={'class': 'poster-container'}):
img = movie.find('img')
title = img.get('alt')
movies.append({
'title': title
})
return movies
config = [{
'name': 'letterboxd',

2
version.py

@ -1,2 +1,2 @@
VERSION = None
BRANCH = 'develop'
BRANCH = 'master'

Loading…
Cancel
Save