summaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/nhl.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:06:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:06:10 +0000
commit137f07c27a88b07df57df5b2cdebebe3c7722bac (patch)
tree4ebdcbea6b540f69c40ba0be6ac766008030d149 /yt_dlp/extractor/nhl.py
parentAdding debian version 2024.05.27-1. (diff)
downloadyt-dlp-137f07c27a88b07df57df5b2cdebebe3c7722bac.tar.xz
yt-dlp-137f07c27a88b07df57df5b2cdebebe3c7722bac.zip
Merging upstream version 2024.07.01.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'yt_dlp/extractor/nhl.py')
-rw-r--r--yt_dlp/extractor/nhl.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/yt_dlp/extractor/nhl.py b/yt_dlp/extractor/nhl.py
index 64cddb4..ca47a81 100644
--- a/yt_dlp/extractor/nhl.py
+++ b/yt_dlp/extractor/nhl.py
@@ -1,8 +1,8 @@
from .common import InfoExtractor
-from ..compat import compat_str
from ..utils import (
determine_ext,
int_or_none,
+ join_nonempty,
parse_duration,
parse_iso8601,
)
@@ -12,8 +12,8 @@ class NHLBaseIE(InfoExtractor):
def _real_extract(self, url):
site, tmp_id = self._match_valid_url(url).groups()
video_data = self._download_json(
- 'https://%s/%s/%sid/v1/%s/details/web-v1.json'
- % (self._CONTENT_DOMAIN, site[:3], 'item/' if site == 'mlb' else '', tmp_id), tmp_id)
+ 'https://{}/{}/{}id/v1/{}/details/web-v1.json'.format(
+ self._CONTENT_DOMAIN, site[:3], 'item/' if site == 'mlb' else '', tmp_id), tmp_id)
if video_data.get('type') != 'video':
video_data = video_data['media']
video = video_data.get('video')
@@ -24,7 +24,7 @@ class NHLBaseIE(InfoExtractor):
if videos:
video_data = videos[0]
- video_id = compat_str(video_data['id'])
+ video_id = str(video_data['id'])
title = video_data['title']
formats = []
@@ -42,7 +42,7 @@ class NHLBaseIE(InfoExtractor):
else:
height = int_or_none(playback.get('height'))
formats.append({
- 'format_id': playback.get('name', 'http' + ('-%dp' % height if height else '')),
+ 'format_id': playback.get('name') or join_nonempty('http', height and f'{height}p'),
'url': playback_url,
'width': int_or_none(playback.get('width')),
'height': height,