from .common import InfoExtractor
from ..utils import (
- determine_ext,
ExtractorError,
+ determine_ext,
int_or_none,
try_get,
+ unescapeHTML,
url_or_none,
)
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',
'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)
'The given url does not contain a video',
expected=True)
- title = post['title']
+ title = unescapeHTML(post['title'])
duration = None
formats = []