Commits

George Notaras committed d1e0af2

Support for URL query arguments in the OEmbed endpoint API URL

Comments (0)

Files changed (1)

src/oembed_works/oembed.py

         if params.has_key('format') and self._implicitFormat:
             urlApi = self._urlApi.replace('{format}', params['format'])
             del params['format']
-                
-        return "%s?%s" % (urlApi, urllib.urlencode(params)) 
+        
+        # This checks whether urlApi already contains query arguments
+        delim = '?'
+        if '?' in urlApi:
+            delim = '&'
+            
+        return "%s%s%s" % (urlApi, delim, urllib.urlencode(params)) 
 
     def get(self, url, **opt):
         '''