aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-08-29 11:35:15 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-08-29 11:35:15 +0200
commit0d75ae2ce313c5738b2bdd9602ab3cc15e78810d (patch)
tree1f3f2014f8bbd9961e689b62c91e6792aed4b5f2 /youtube_dl/extractor
parent2891932bf0a01acc025246438f890dca57f91c6b (diff)
Fix detection of the webpage charset if it's declared using ' instead of "
Like in "<meta charset='utf-8'/>"
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/common.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index a2986cebe..77726ee24 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -150,7 +150,7 @@ class InfoExtractor(object):
if m:
encoding = m.group(1)
else:
- m = re.search(br'<meta[^>]+charset="?([^"]+)[ /">]',
+ m = re.search(br'<meta[^>]+charset=[\'"]?([^\'")]+)[ /\'">]',
webpage_bytes[:1024])
if m:
encoding = m.group(1).decode('ascii')