Repository: yt-dlp/yt-dlp

Issue:
Add particular season support for tv show/series for hotstar.com
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I remove or skip any mandatory\* field

### Checklist

- [X] I'm requesting a site-specific feature
- [X] I've verified that I'm running yt-dlp version **2022.10.04** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

India

### Example URLs

https://www.hotstar.com/in/tv/ishqbaaz/9567/seasons/season-2/ss-4357

### Provide a description that is worded well enough to be understood

downloading whole series or show in one go is not possible in which has many episodes, so downloading it by season will help to checkout only that specify season content like many dance, music contest had happened every year so hotstar differentiate them between seasons. so downloading by season is very useful


as you can see below in verbose output whole show as 758 episode which yt-dlp detected successfully but season 2 have total 30 episodes which you can see on this page :- https://www.hotstar.com/in/tv/ishqbaaz/9567/seasons/season-2/ss-4357 

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['https://www.hotstar.com/in/tv/ishqbaaz/9567/seasons/season-2/ss-4357', '-vU', '-s']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.10.04 [4e0511f] (win32_exe)
[debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.19044-SP0
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 4.4.1-full_build-www.gyan.dev (setts), ffprobe n5.1-6-gffaf606130-20220809
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.09.24, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Loaded 1690 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.10.04, Current version: 2022.10.04
yt-dlp is up to date (2022.10.04)
[debug] [hotstar:series] Extracting URL: https://www.hotstar.com/in/tv/ishqbaaz/9567/seasons/season-2/ss-4357
[hotstar:series] 9567: Downloading JSON metadata
[hotstar:series] 9567: Downloading JSON metadata
[download] Downloading playlist: 9567
[hotstar:series] Playlist 9567: Downloading 758 videos of 758
[download] Downloading video 1 of 758
[debug] [hotstar] Extracting URL: https://www.hotstar.com/in/tv/ishqbaaz/9567/ignore_me/1000100150
[hotstar] 1000100150: Downloading JSON metadata
[hotstar] 1000100150: Downloading webpage
[hotstar] 1000100150: Downloading token
[hotstar] 1000100150: Downloading JSON metadata
[hotstar] 1000100150: Downloading m3u8 information
[hotstar] 1000100150: Downloading m3u8 information
[hotstar] 1000100150: Downloading MPD manifest
[hotstar] 1000100150: Downloading MPD manifest
[hotstar] 1000100150: Downloading m3u8 information
[hotstar] 1000100150: Downloading MPD manifest
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 1000100150: Downloading 1 format(s): sdr-dash-video_avc1_7+sdr-dash-audio_und_mp4a_3-2
[download] Downloading video 2 of 758
[debug] [hotstar] Extracting URL: https://www.hotstar.com/in/tv/ishqbaaz/9567/ignore_me/1000100272
[hotstar] 1000100272: Downloading JSON metadata
[hotstar] 1000100272: Downloading webpage
[hotstar] 1000100272: Downloading token
[hotstar] 1000100272: Downloading JSON metadata
[hotstar] 1000100272: Downloading m3u8 information
[hotstar] 1000100272: Downloading MPD manifest
[hotstar] 1000100272: Downloading m3u8 information
[hotstar] 1000100272: Downloading MPD manifest
[hotstar] 1000100272: Downloading m3u8 information
[hotstar] 1000100272: Downloading MPD manifest
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 1000100272: Downloading 1 format(s): sdr-dash-video_avc1_7+sdr-dash-audio_und_mp4a_3-2
```



Discussion:
@m4tu4g 

Resolving patch:
diff --git a/yt_dlp/extractor/_extractors.py b/yt_dlp/extractor/_extractors.py
--- a/yt_dlp/extractor/_extractors.py
+++ b/yt_dlp/extractor/_extractors.py
@@ -699,6 +699,7 @@
     HotStarIE,
     HotStarPrefixIE,
     HotStarPlaylistIE,
+    HotStarSeasonIE,
     HotStarSeriesIE,
 )
 from .howcast import HowcastIE
diff --git a/yt_dlp/extractor/hotstar.py b/yt_dlp/extractor/hotstar.py
--- a/yt_dlp/extractor/hotstar.py
+++ b/yt_dlp/extractor/hotstar.py
@@ -258,16 +258,16 @@ class HotStarPrefixIE(InfoExtractor):
         'url': 'hotstar:1000076273',
         'only_matching': True,
     }, {
-        'url': 'hotstar:movies:1000057157',
+        'url': 'hotstar:movies:1260009879',
         'info_dict': {
-            'id': '1000057157',
+            'id': '1260009879',
             'ext': 'mp4',
-            'title': 'Radha Gopalam',
-            'description': 'md5:be3bc342cc120bbc95b3b0960e2b0d22',
-            'timestamp': 1140805800,
-            'upload_date': '20060224',
-            'duration': 9182,
-            'episode': 'Radha Gopalam',
+            'title': 'Nuvvu Naaku Nachav',
+            'description': 'md5:d43701b1314e6f8233ce33523c043b7d',
+            'timestamp': 1567525674,
+            'upload_date': '20190903',
+            'duration': 10787,
+            'episode': 'Nuvvu Naaku Nachav',
         },
     }, {
         'url': 'hotstar:episode:1000234847',
@@ -289,7 +289,7 @@ def _real_extract(self, url):
 
 class HotStarPlaylistIE(HotStarBaseIE):
     IE_NAME = 'hotstar:playlist'
-    _VALID_URL = r'https?://(?:www\.)?hotstar\.com/tv/[^/]+/s-\w+/list/[^/]+/t-(?P<id>\w+)'
+    _VALID_URL = r'https?://(?:www\.)?hotstar\.com(?:/in)?/tv(?:/[^/]+){2}/list/[^/]+/t-(?P<id>\w+)'
     _TESTS = [{
         'url': 'https://www.hotstar.com/tv/savdhaan-india/s-26/list/popular-clips/t-3_2_26',
         'info_dict': {
@@ -299,6 +299,9 @@ class HotStarPlaylistIE(HotStarBaseIE):
     }, {
         'url': 'https://www.hotstar.com/tv/savdhaan-india/s-26/list/extras/t-2480',
         'only_matching': True,
+    }, {
+        'url': 'https://www.hotstar.com/in/tv/karthika-deepam/15457/list/popular-clips/t-3_2_1272',
+        'only_matching': True,
     }]
 
     def _real_extract(self, url):
@@ -312,9 +315,47 @@ def _real_extract(self, url):
         return self.playlist_result(entries, playlist_id)
 
 
+class HotStarSeasonIE(HotStarBaseIE):
+    IE_NAME = 'hotstar:season'
+    _VALID_URL = r'(?P<url>https?://(?:www\.)?hotstar\.com(?:/in)?/tv/[^/]+/\w+)/seasons/[^/]+/ss-(?P<id>\w+)'
+    _TESTS = [{
+        'url': 'https://www.hotstar.com/tv/radhakrishn/1260000646/seasons/season-2/ss-8028',
+        'info_dict': {
+            'id': '8028',
+        },
+        'playlist_mincount': 35,
+    }, {
+        'url': 'https://www.hotstar.com/in/tv/ishqbaaz/9567/seasons/season-2/ss-4357',
+        'info_dict': {
+            'id': '4357',
+        },
+        'playlist_mincount': 30,
+    }, {
+        'url': 'https://www.hotstar.com/in/tv/bigg-boss/14714/seasons/season-4/ss-8208/',
+        'info_dict': {
+            'id': '8208',
+        },
+        'playlist_mincount': 19,
+    }]
+
+    def _real_extract(self, url):
+        url, season_id = self._match_valid_url(url).groups()
+        headers = {
+            'x-country-code': 'IN',
+            'x-platform-code': 'PCTV',
+        }
+        item_json = self._download_json(
+            f'{self._API_URL}/o/v1/season/asset?tao=0&tas=0&size=10000&id={season_id}', season_id, headers=headers)['body']['results']
+        entries = [
+            self.url_result(HotStarIE._video_url(video['contentId'], root=url), HotStarIE, video['contentId'])
+            for video in item_json['items'] if video.get('contentId')]
+
+        return self.playlist_result(entries, season_id)
+
+
 class HotStarSeriesIE(HotStarBaseIE):
     IE_NAME = 'hotstar:series'
-    _VALID_URL = r'(?P<url>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': {
@@ -332,7 +373,7 @@ class HotStarSeriesIE(HotStarBaseIE):
         'info_dict': {
             'id': '435',
         },
-        'playlist_mincount': 269,
+        'playlist_mincount': 267,
     }]
 
     def _real_extract(self, url):


Test patch: