Python 2.5 compatibility
This commit is contained in:
parent
bfb3689456
commit
664e4cc094
2 changed files with 12 additions and 2 deletions
|
|
@ -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])
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue