Unable to find a way to escape quotes in json in YouTube API

I am using the YouTube API and I am using Python urllib2.urlopen () to send a GET request. Then I pass the result to Javascript. (I am using Django)

So something like this:

result = urllib2.urlopen('https://gdata.youtube.com/feeds/api/videos?'+query+'&max-results=1&alt=json')

I use jQuery to parse a formatted JSON response, however some YouTube videos / descriptions have double quotes and this violates the parseJSON () function.

Any help would be greatly appreciated.

+5
source share
1 answer

(). , , Django HTML - , HTML- quot; json.

( , - django - ), HTML {{var | safe}}..

+2

All Articles