Explorar o código

[hotstar] Extract more formats (closes #22323)

Sergey M․ %!s(int64=6) %!d(string=hai) anos
pai
achega
1cb812d3c2
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      youtube_dl/extractor/hotstar.py

+ 3 - 0
youtube_dl/extractor/hotstar.py

@@ -3,6 +3,7 @@ from __future__ import unicode_literals
 
 
 import hashlib
 import hashlib
 import hmac
 import hmac
+import re
 import time
 import time
 import uuid
 import uuid
 
 
@@ -126,6 +127,8 @@ class HotStarIE(HotStarBaseIE):
             format_url = url_or_none(playback_set.get('playbackUrl'))
             format_url = url_or_none(playback_set.get('playbackUrl'))
             if not format_url:
             if not format_url:
                 continue
                 continue
+            format_url = re.sub(
+                r'(?<=//staragvod)(\d)', r'web\1', format_url)
             tags = str_or_none(playback_set.get('tagsCombination')) or ''
             tags = str_or_none(playback_set.get('tagsCombination')) or ''
             if tags and 'encryption:plain' not in tags:
             if tags and 'encryption:plain' not in tags:
                 continue
                 continue