From b7b4b09f0f66fa2180b8f9bce3e1fdebbf7ad611 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 2 Aug 2017 16:48:01 +0200 Subject: [PATCH] py3 --- ox/web/youtube.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ox/web/youtube.py b/ox/web/youtube.py index 2e65c0f..6a0ac3f 100644 --- a/ox/web/youtube.py +++ b/ox/web/youtube.py @@ -46,14 +46,14 @@ def video_url(youtubeId, format='mp4', timeout=cache_timeout): def get_video_info(id): eurl = get_url(id) - data = read_url(eurl) + data = read_url(eurl).decode('utf-8') t = re.compile('\W[\'"]?t[\'"]?: ?[\'"](.+?)[\'"]').findall(data) if t: t = t[0] else: raise IOError url = "http://www.youtube.com/get_video_info?&video_id=%s&el=$el&ps=default&eurl=%s&hl=en_US&t=%s" % (id, quote(eurl), quote(t)) - data = read_url(url) + data = read_url(url).decode('utf-8') info = {} for part in data.split('&'): key, value = part.split('=')