openurl param must be encoded
This commit is contained in:
parent
db810365c2
commit
f55cdbc38b
3 changed files with 6 additions and 4 deletions
|
|
@ -29,7 +29,8 @@ class CanalTP(BaseBrowser):
|
|||
BaseBrowser.__init__(self, '')
|
||||
|
||||
def iter_station_search(self, pattern):
|
||||
result = self.openurl(u"http://widget.canaltp.fr/Prochains_departs_15122009/dev/gare.php?txtrech=%s" % unicode(pattern)).read()
|
||||
url = u'http://widget.canaltp.fr/Prochains_departs_15122009/dev/gare.php?txtrech=%s' % unicode(pattern)
|
||||
result = self.openurl(url.encode('utf-8')).read()
|
||||
for station in result.split('&'):
|
||||
try:
|
||||
_id, name = station.split('=')
|
||||
|
|
@ -39,7 +40,8 @@ class CanalTP(BaseBrowser):
|
|||
yield _id, to_unicode(name)
|
||||
|
||||
def iter_station_departures(self, station_id, arrival_id=None):
|
||||
result = self.openurl(u"http://widget.canaltp.fr/Prochains_departs_15122009/dev/index.php?gare=%s" % unicode(station_id)).read()
|
||||
url = u'http://widget.canaltp.fr/Prochains_departs_15122009/dev/index.php?gare=%s' % unicode(station_id)
|
||||
result = self.openurl(url.encode('utf-8')).read()
|
||||
result = result
|
||||
departure = ''
|
||||
for line in result.split('&'):
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class GazelleBackend(BaseBackend, ICapTorrent):
|
|||
if not torrent:
|
||||
return None
|
||||
|
||||
return self.browser.openurl(torrent.url).read()
|
||||
return self.browser.openurl(torrent.url.encode('utf-8')).read()
|
||||
|
||||
def iter_torrents(self, pattern):
|
||||
return self.browser.iter_torrents(pattern)
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class YoujizzBrowser(BaseBrowser):
|
|||
if video is None:
|
||||
video = YoujizzVideo()
|
||||
try:
|
||||
data = self.openurl(url).read()
|
||||
data = self.openurl(url.encode('utf-8')).read()
|
||||
except BrowserUnavailable:
|
||||
return None
|
||||
def _get_url():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue