projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[puhutv] Remove no longer available HTTP formats (closes #25124)
[youtube-dl]
/
youtube_dl
/
extractor
/
viu.py
diff --git
a/youtube_dl/extractor/viu.py
b/youtube_dl/extractor/viu.py
index e268f94093e2c9a24d69cc652f943f5d2c01584a..3bd37525b6ffcc53d8cb35bed9ab8974847893cc 100644
(file)
--- a/
youtube_dl/extractor/viu.py
+++ b/
youtube_dl/extractor/viu.py
@@
-195,16
+195,29
@@
class ViuOTTIE(InfoExtractor):
'skip': 'Geo-restricted to Hong Kong',
}]
'skip': 'Geo-restricted to Hong Kong',
}]
+ _AREA_ID = {
+ 'HK': 1,
+ 'SG': 2,
+ 'TH': 4,
+ 'PH': 5,
+ }
+
def _real_extract(self, url):
country_code, video_id = re.match(self._VALID_URL, url).groups()
def _real_extract(self, url):
country_code, video_id = re.match(self._VALID_URL, url).groups()
+ query = {
+ 'r': 'vod/ajax-detail',
+ 'platform_flag_label': 'web',
+ 'product_id': video_id,
+ }
+
+ area_id = self._AREA_ID.get(country_code.upper())
+ if area_id:
+ query['area_id'] = area_id
+
product_data = self._download_json(
'http://www.viu.com/ott/%s/index.php' % country_code, video_id,
product_data = self._download_json(
'http://www.viu.com/ott/%s/index.php' % country_code, video_id,
- 'Downloading video info', query={
- 'r': 'vod/ajax-detail',
- 'platform_flag_label': 'web',
- 'product_id': video_id,
- })['data']
+ 'Downloading video info', query=query)['data']
video_data = product_data.get('current_product')
if not video_data:
video_data = product_data.get('current_product')
if not video_data: