summary refs log tree commit diff
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2018-04-19 15:48:03 +0100
committerRemita Amine <remitamine@gmail.com>2018-04-19 15:48:03 +0100
commitd86c5167ae5a1c33451e98d7e05d5b32b6fa3156 (patch)
tree3a37cd25fd9eba13bf35e037bfee2f995bcc83bc
parentb004d9bbf18ee2b6a9b916657c4d6734ff0d0adb (diff)
downloadyoutube-dl-d86c5167ae5a1c33451e98d7e05d5b32b6fa3156.tar.gz
youtube-dl-d86c5167ae5a1c33451e98d7e05d5b32b6fa3156.tar.xz
youtube-dl-d86c5167ae5a1c33451e98d7e05d5b32b6fa3156.zip
[nexx] extract new azure urls(closes #16223)
-rw-r--r--youtube_dl/extractor/nexx.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/youtube_dl/extractor/nexx.py b/youtube_dl/extractor/nexx.py
index c7029d29e..5e46a75c0 100644
--- a/youtube_dl/extractor/nexx.py
+++ b/youtube_dl/extractor/nexx.py
@@ -230,15 +230,18 @@ class NexxIE(InfoExtractor):
 
         azure_locator = stream_data['azureLocator']
 
-        AZURE_URL = 'http://nx%s%02d.akamaized.net/'
-
-        def get_cdn_shield_base(shield_type='', prefix='-p'):
+        def get_cdn_shield_base(shield_type='', static=False):
             for secure in ('', 's'):
                 cdn_shield = stream_data.get('cdnShield%sHTTP%s' % (shield_type, secure.upper()))
                 if cdn_shield:
                     return 'http%s://%s' % (secure, cdn_shield)
             else:
-                return AZURE_URL % (prefix, int(stream_data['azureAccount'].replace('nexxplayplus', '')))
+                if 'fb' in stream_data['azureAccount']:
+                    prefix = 'df' if static else 'f'
+                else:
+                    prefix = 'd' if static else 'p'
+                account = int(stream_data['azureAccount'].replace('nexxplayplus', '').replace('nexxplayfb', ''))
+                return 'http://nx-%s%02d.akamaized.net/' % (prefix, account)
 
         azure_stream_base = get_cdn_shield_base()
         is_ml = ',' in language
@@ -260,7 +263,7 @@ class NexxIE(InfoExtractor):
         formats.extend(self._extract_ism_formats(
             azure_manifest_url % '', video_id, ism_id='%s-mss' % cdn, fatal=False))
 
-        azure_progressive_base = get_cdn_shield_base('Prog', '-d')
+        azure_progressive_base = get_cdn_shield_base('Prog', True)
         azure_file_distribution = stream_data.get('azureFileDistribution')
         if azure_file_distribution:
             fds = azure_file_distribution.split(',')