summaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/wsj.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/wsj.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/wsj.py')
-rw-r--r--yt_dlp/extractor/wsj.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yt_dlp/extractor/wsj.py b/yt_dlp/extractor/wsj.py
index 35fe303..b6b656f 100644
--- a/yt_dlp/extractor/wsj.py
+++ b/yt_dlp/extractor/wsj.py
@@ -2,6 +2,7 @@ from .common import InfoExtractor
from ..utils import (
float_or_none,
int_or_none,
+ join_nonempty,
unified_strdate,
)
@@ -76,7 +77,7 @@ class WSJIE(InfoExtractor):
tbr = int_or_none(v.get('bitrate'))
formats.append({
'url': mp4_url,
- 'format_id': 'http' + ('-%d' % tbr if tbr else ''),
+ 'format_id': join_nonempty('http', tbr),
'tbr': tbr,
'width': int_or_none(v.get('width')),
'height': int_or_none(v.get('height')),
@@ -108,7 +109,7 @@ class WSJArticleIE(InfoExtractor):
'upload_date': '20170221',
'uploader_id': 'ralcaraz',
'title': 'Bao Bao the Panda Leaves for China',
- }
+ },
}
def _real_extract(self, url):
@@ -117,4 +118,4 @@ class WSJArticleIE(InfoExtractor):
video_id = self._search_regex(
r'(?:id=["\']video|video-|iframe\.html\?guid=|data-src=["\'])([a-fA-F0-9-]{36})',
webpage, 'video id')
- return self.url_result('wsj:%s' % video_id, WSJIE.ie_key(), video_id)
+ return self.url_result(f'wsj:{video_id}', WSJIE.ie_key(), video_id)