[Hotstar] Add referer for subs (#1062)

Authored by: Ashish0804
This commit is contained in:
Ashish Gupta 2021-09-23 14:30:49 +05:30 committed by GitHub
parent 50eff38c1c
commit 388bc4a640
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -2594,7 +2594,9 @@ class YoutubeDL(object):
return return
else: else:
try: try:
self.dl(sub_filename, sub_info.copy(), subtitle=True) sub_copy = sub_info.copy()
sub_copy.setdefault('http_headers', info_dict.get('http_headers'))
self.dl(sub_filename, sub_copy, subtitle=True)
sub_info['filepath'] = sub_filename sub_info['filepath'] = sub_filename
files_to_move[sub_filename] = sub_filename_final files_to_move[sub_filename] = sub_filename_final
except (ExtractorError, IOError, OSError, ValueError) + network_exceptions as err: except (ExtractorError, IOError, OSError, ValueError) + network_exceptions as err:

View File

@ -254,6 +254,9 @@ class HotStarIE(HotStarBaseIE):
'season_id': video_data.get('seasonId'), 'season_id': video_data.get('seasonId'),
'episode': title, 'episode': title,
'episode_number': int_or_none(video_data.get('episodeNo')), 'episode_number': int_or_none(video_data.get('episodeNo')),
'http_headers': {
'Referer': 'https://www.hotstar.com/in',
}
} }