Commit 664e4cc0 authored by Laurent Bachelier's avatar Laurent Bachelier 🐧

Python 2.5 compatibility

parent bfb36894
......@@ -22,6 +22,11 @@ import re
import urlparse
from logging import warning, debug
try:
from urlparse import parse_qs
except ImportError:
from cgi import parse_qs
from weboob.tools.misc import html2text, get_bytes_size
from weboob.capabilities.torrent import Torrent
from weboob.capabilities.base import NotLoaded
......@@ -84,7 +89,7 @@ class TorrentsPage(BasePage):
else:
title = tds[i].find('a').text
url = urlparse.urlparse(tds[i].find('a').attrib['href'])
params = urlparse.parse_qs(url.query)
params = parse_qs(url.query)
if 'torrentid' in params:
id = '%s.%s' % (params['id'][0], params['torrentid'][0])
else:
......
......@@ -31,6 +31,11 @@ try:
except ImportError:
import simplejson as json
try:
from urlparse import parse_qs
except ImportError:
from cgi import parse_qs
__all__ = ['RadioFranceBrowser', 'RadioFranceVideo']
......@@ -57,7 +62,7 @@ class PlayerPage(BasePage):
def get_url(self):
radio_id = self.groups[0]
player = self.parser.select(self.document.getroot(), '#rfPlayer embed', 1)
urlparams = urlparse.parse_qs(player.attrib['src'])
urlparams = parse_qs(player.attrib['src'])
return 'http://www.%s.fr/%s' % (radio_id, urlparams['urlAOD'][0])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment