]> jfr.im git - yt-dlp.git/commitdiff
[HotStarSeries] Fix cookies (#1187)
authorAshish Gupta <redacted>
Sat, 9 Oct 2021 18:27:08 +0000 (23:57 +0530)
committerGitHub <redacted>
Sat, 9 Oct 2021 18:27:08 +0000 (23:57 +0530)
Authored by: Ashish0804

yt_dlp/extractor/hotstar.py

index 8f0c6730348eac7e9903d979ecab0677ae5458df..f66d3e433c61d29fb41b7b595f5a8004372751e5 100644 (file)
@@ -290,7 +290,7 @@ def _real_extract(self, url):
 
 class HotStarSeriesIE(HotStarBaseIE):
     IE_NAME = 'hotstar:series'
 
 class HotStarSeriesIE(HotStarBaseIE):
     IE_NAME = 'hotstar:series'
-    _VALID_URL = r'(?:https?://)(?:www\.)?hotstar\.com(?:/in)?/tv/[^/]+/(?P<id>\d+)'
+    _VALID_URL = r'(?P<url>(?:https?://)(?:www\.)?hotstar\.com(?:/in)?/tv/[^/]+/(?P<id>\d+))'
     _TESTS = [{
         'url': 'https://www.hotstar.com/in/tv/radhakrishn/1260000646',
         'info_dict': {
     _TESTS = [{
         'url': 'https://www.hotstar.com/in/tv/radhakrishn/1260000646',
         'info_dict': {
@@ -312,7 +312,7 @@ class HotStarSeriesIE(HotStarBaseIE):
     }]
 
     def _real_extract(self, url):
     }]
 
     def _real_extract(self, url):
-        series_id = self._match_id(url)
+        url, series_id = self._match_valid_url(url).groups()
         headers = {
             'x-country-code': 'IN',
             'x-platform-code': 'PCTV',
         headers = {
             'x-country-code': 'IN',
             'x-platform-code': 'PCTV',
@@ -324,7 +324,7 @@ def _real_extract(self, url):
                                         video_id=series_id, headers=headers)
         entries = [
             self.url_result(
                                         video_id=series_id, headers=headers)
         entries = [
             self.url_result(
-                'hotstar:episode:%d' % video['contentId'],
+                '%s/ignoreme/%d' % (url, video['contentId']),
                 ie=HotStarIE.ie_key(), video_id=video['contentId'])
             for video in item_json['body']['results']['items']
             if video.get('contentId')]
                 ie=HotStarIE.ie_key(), video_id=video['contentId'])
             for video in item_json['body']['results']['items']
             if video.get('contentId')]