aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/globo.py
diff options
context:
space:
mode:
Diffstat (limited to 'hypervideo_dl/extractor/globo.py')
-rw-r--r--hypervideo_dl/extractor/globo.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/hypervideo_dl/extractor/globo.py b/hypervideo_dl/extractor/globo.py
index f6aaae1..a7be2cb 100644
--- a/hypervideo_dl/extractor/globo.py
+++ b/hypervideo_dl/extractor/globo.py
@@ -1,6 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
import base64
import hashlib
import json
@@ -142,7 +139,6 @@ class GloboIE(InfoExtractor):
fmts, subtitles = self._extract_m3u8_formats_and_subtitles(
signed_url, video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls', fatal=False)
formats.extend(fmts)
- self._sort_formats(formats)
for resource in video['resources']:
if resource.get('type') == 'subtitle':
@@ -181,12 +177,12 @@ class GloboArticleIE(InfoExtractor):
_VALID_URL = r'https?://.+?\.globo\.com/(?:[^/]+/)*(?P<id>[^/.]+)(?:\.html)?'
_VIDEOID_REGEXES = [
- r'\bdata-video-id=["\'](\d{7,})',
- r'\bdata-player-videosids=["\'](\d{7,})',
+ r'\bdata-video-id=["\'](\d{7,})["\']',
+ r'\bdata-player-videosids=["\'](\d{7,})["\']',
r'\bvideosIDs\s*:\s*["\']?(\d{7,})',
- r'\bdata-id=["\'](\d{7,})',
- r'<div[^>]+\bid=["\'](\d{7,})',
- r'<bs-player[^>]+\bvideoid=["\'](\d{8,})',
+ r'\bdata-id=["\'](\d{7,})["\']',
+ r'<div[^>]+\bid=["\'](\d{7,})["\']',
+ r'<bs-player[^>]+\bvideoid=["\'](\d{8,})["\']',
]
_TESTS = [{
@@ -222,6 +218,14 @@ class GloboArticleIE(InfoExtractor):
'description': 'md5:2d089d036c4c9675117d3a56f8c61739',
},
'playlist_count': 1,
+ }, {
+ 'url': 'https://redeglobo.globo.com/rpc/meuparana/noticia/a-producao-de-chocolates-no-parana.ghtml',
+ 'info_dict': {
+ 'id': 'a-producao-de-chocolates-no-parana',
+ 'title': 'A produção de chocolates no Paraná',
+ 'description': 'md5:f2e3daf00ffd1dc0e9a8a6c7cfb0a89e',
+ },
+ 'playlist_count': 2,
}]
@classmethod
@@ -237,6 +241,6 @@ class GloboArticleIE(InfoExtractor):
entries = [
self.url_result('globo:%s' % video_id, GloboIE.ie_key())
for video_id in orderedSet(video_ids)]
- title = self._og_search_title(webpage)
+ title = self._og_search_title(webpage).strip()
description = self._html_search_meta('description', webpage)
return self.playlist_result(entries, display_id, title, description)