use the default parser of StandardBrowser
This commit is contained in:
parent
ba8d2c63a5
commit
c7195b48a2
2 changed files with 2 additions and 12 deletions
2
AUTHORS
2
AUTHORS
|
|
@ -52,7 +52,7 @@ Benjamin Carton <carton_ben@yahoo.fr>
|
||||||
* handjoob application.
|
* handjoob application.
|
||||||
|
|
||||||
Pierre Mazière <pierre.maziere@gmx.com>
|
Pierre Mazière <pierre.maziere@gmx.com>
|
||||||
* LCL module maintainer;
|
* LCL and RockRadio modules maintainer;
|
||||||
* BNPorc fixes.
|
* BNPorc fixes.
|
||||||
|
|
||||||
Xavier Guerrin <xavier@tuxfamily.org>
|
Xavier Guerrin <xavier@tuxfamily.org>
|
||||||
|
|
|
||||||
|
|
@ -20,22 +20,15 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
import lxml.html
|
|
||||||
from weboob.capabilities.radio import ICapRadio, Radio, Stream, Emission
|
from weboob.capabilities.radio import ICapRadio, Radio, Stream, Emission
|
||||||
from weboob.capabilities.collection import ICapCollection
|
from weboob.capabilities.collection import ICapCollection
|
||||||
from weboob.tools.backend import BaseBackend
|
from weboob.tools.backend import BaseBackend
|
||||||
from weboob.tools.browser import StandardBrowser
|
from weboob.tools.browser import StandardBrowser
|
||||||
from weboob.tools.parsers.iparser import IParser
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['RockRadioBackend']
|
__all__ = ['RockRadioBackend']
|
||||||
|
|
||||||
|
|
||||||
class LxmlParser(IParser):
|
|
||||||
def parse(self, data, encoding=None):
|
|
||||||
return lxml.html.fromstring(data.read())
|
|
||||||
|
|
||||||
|
|
||||||
class RockRadioBackend(BaseBackend, ICapRadio, ICapCollection):
|
class RockRadioBackend(BaseBackend, ICapRadio, ICapCollection):
|
||||||
NAME = 'rockradio'
|
NAME = 'rockradio'
|
||||||
MAINTAINER = u'Pierre Mazière'
|
MAINTAINER = u'Pierre Mazière'
|
||||||
|
|
@ -50,9 +43,6 @@ class RockRadioBackend(BaseBackend, ICapRadio, ICapCollection):
|
||||||
#
|
#
|
||||||
# MPlayer does not like the pls file sent from this site.
|
# MPlayer does not like the pls file sent from this site.
|
||||||
|
|
||||||
def create_default_browser(self):
|
|
||||||
return self.create_browser(parser=LxmlParser())
|
|
||||||
|
|
||||||
def _parse_current(self, data):
|
def _parse_current(self, data):
|
||||||
current = data.split(' - ')
|
current = data.split(' - ')
|
||||||
if len(current) == 2:
|
if len(current) == 2:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue