summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRemita Amine <[email protected]>2021-02-19 11:55:14 +0100
committerRemita Amine <[email protected]>2021-02-19 11:55:40 +0100
commit40edffae3d9f86ca696dda6c8a4c9c0497cb6d76 (patch)
treee2ce04d2e356602c3c8dddd9bc99f8ed59857180
parent9fc5eafb8e384453a49f7cfe73147be491f0b19d (diff)
downloadyoutube-dl-40edffae3d9f86ca696dda6c8a4c9c0497cb6d76.tar.gz
youtube-dl-40edffae3d9f86ca696dda6c8a4c9c0497cb6d76.zip
[ninegag] unscape title(#28201)
-rw-r--r--youtube_dl/extractor/ninegag.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/youtube_dl/extractor/ninegag.py b/youtube_dl/extractor/ninegag.py
index 440f865bc..14390823b 100644
--- a/youtube_dl/extractor/ninegag.py
+++ b/youtube_dl/extractor/ninegag.py
@@ -2,10 +2,11 @@ from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
- determine_ext,
ExtractorError,
+ determine_ext,
int_or_none,
try_get,
+ unescapeHTML,
url_or_none,
)
@@ -14,7 +15,7 @@ class NineGagIE(InfoExtractor):
IE_NAME = '9gag'
_VALID_URL = r'https?://(?:www\.)?9gag\.com/gag/(?P<id>[^/?&#]+)'
- _TEST = {
+ _TESTS = [{
'url': 'https://9gag.com/gag/ae5Ag7B',
'info_dict': {
'id': 'ae5Ag7B',
@@ -29,7 +30,11 @@ class NineGagIE(InfoExtractor):
'dislike_count': int,
'comment_count': int,
}
- }
+ }, {
+ # HTML escaped title
+ 'url': 'https://9gag.com/gag/av5nvyb',
+ 'only_matching': True,
+ }]
def _real_extract(self, url):
post_id = self._match_id(url)
@@ -43,7 +48,7 @@ class NineGagIE(InfoExtractor):
'The given url does not contain a video',
expected=True)
- title = post['title']
+ title = unescapeHTML(post['title'])
duration = None
formats = []