From acac9d4308f710d2f57ed6f304811ea64b585d2c Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 12 Aug 2015 15:26:44 +0200 Subject: [PATCH] Add warning if LXML isn't installed if running from source --- README.md | 3 +++ couchpotato/core/_base/_core.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 1ccf689..fca0793 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ OS X: * If you're on Leopard (10.5) install Python 2.6+: [Python 2.6.5](http://www.python.org/download/releases/2.6.5/) * Install [GIT](http://git-scm.com/) +* Install [LXML](http://lxml.de/installation.html) for better/faster website scraping * Open up `Terminal` * Go to your App folder `cd /Applications` * Run `git clone https://github.com/RuudBurger/CouchPotatoServer.git` @@ -33,6 +34,7 @@ Linux: * (Ubuntu / Debian) Install [GIT](http://git-scm.com/) with `apt-get install git-core` * (Fedora / CentOS) Install [GIT](http://git-scm.com/) with `yum install git` +* Install [LXML](http://lxml.de/installation.html) for better/faster website scraping * 'cd' to the folder of your choosing. * Run `git clone https://github.com/RuudBurger/CouchPotatoServer.git` * Then do `python CouchPotatoServer/CouchPotato.py` to start @@ -59,6 +61,7 @@ FreeBSD : * Install port [ftp/curl](http://www.freshports.org/ftp/bcurl), deselect 'Asynchronous DNS resolution via c-ares' when prompted as part of config `cd /usr/ports/ftp/fpc-libcurl; sudo make install clean` * Install port [textproc/docbook-xml-450](http://www.freshports.org/textproc/docbook-xml-450) with `cd /usr/ports/textproc/docbook-xml-450; sudo make install clean` * Install port [GIT](http://git-scm.com/) with `cd /usr/ports/devel/git; sudo make install clean` +* Install [LXML](http://lxml.de/installation.html) for better/faster website scraping * 'cd' to the folder of your choosing. * Run `git clone https://github.com/RuudBurger/CouchPotatoServer.git` * Then run `sudo python CouchPotatoServer/CouchPotato.py` to start for the first time diff --git a/couchpotato/core/_base/_core.py b/couchpotato/core/_base/_core.py index 81f5fa5..14281ef 100644 --- a/couchpotato/core/_base/_core.py +++ b/couchpotato/core/_base/_core.py @@ -73,6 +73,13 @@ class Core(Plugin): except: log.debug('Failed setting default ssl context: %s', traceback.format_exc()) + + # Check if lxml is available + try: + from lxml import etree + except: + log.error('LXML not available, please install for better/faster scraping support. `http://lxml.de/installation.html`') + def md5Password(self, value): return md5(value) if value else ''