Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions sphinxcontrib/youtube/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#Import urlparse in Python 2 or urllib.parse in Python 3

try:
import urlparse
import urllib.parse

except ImportError:
import urllib.parse as urlparse
Expand All @@ -28,7 +28,9 @@ def is_url(s):

def get_video_id(url):

return urlparse.parse_qs(urlparse.urlparse(url).query)['v'][0]
v = urllib.parse.parse_qs(urllib.parse.urlparse(url).query)
if (v == {}): return ""
return v['v'][0]


def visit(self, node):
Expand Down