[discoverygo] Fix JSON data parsing
authorYen Chi Hsuan <yan12125@gmail.com>
Thu, 5 Jan 2017 10:45:26 +0000 (18:45 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Thu, 5 Jan 2017 10:50:34 +0000 (18:50 +0800)
HTMLParser, which is used by extract_attributes, already unescapes
attribute values with HTMLParser.unescape. They shouldn't be unescaped
again, to there may be parsing errors.

Ref: #11219, #11522

ChangeLog
youtube_dl/extractor/discoverygo.py

index a31b676e361993b843ee758c271fc887e12684e7..f3e9e1b5fb358913f0c433a952f8f117012a1258 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+version <unreleased>
+
+Extractors
+* [discoverygo] Fix JSON data parsing (#11219, #11522)
+
+
 version 2017.01.05
 
 Extractors
index c4e83b2c3790670ec7d6c1b7c9cca4e47b4d7779..2042493a8c7836ecae4efd23005101cf805116a7 100644 (file)
@@ -6,7 +6,6 @@ from ..utils import (
     extract_attributes,
     int_or_none,
     parse_age_limit,
-    unescapeHTML,
     ExtractorError,
 )
 
@@ -49,7 +48,7 @@ class DiscoveryGoIE(InfoExtractor):
                 webpage, 'video container'))
 
         video = self._parse_json(
-            unescapeHTML(container.get('data-video') or container.get('data-json')),
+            container.get('data-video') or container.get('data-json'),
             display_id)
 
         title = video['name']