summaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/twitcasting.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
commit7e21328585afda6d66f98ca476301680eeffac32 (patch)
tree266a4e7b20443f94572748781d71fc0375a15037 /yt_dlp/extractor/twitcasting.py
parentAdding upstream version 2024.05.27. (diff)
downloadyt-dlp-7e21328585afda6d66f98ca476301680eeffac32.tar.xz
yt-dlp-7e21328585afda6d66f98ca476301680eeffac32.zip
Adding upstream version 2024.07.01.upstream/2024.07.01
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'yt_dlp/extractor/twitcasting.py')
-rw-r--r--yt_dlp/extractor/twitcasting.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/yt_dlp/extractor/twitcasting.py b/yt_dlp/extractor/twitcasting.py
index 28ea16c..53b4084 100644
--- a/yt_dlp/extractor/twitcasting.py
+++ b/yt_dlp/extractor/twitcasting.py
@@ -139,7 +139,7 @@ class TwitCastingIE(InfoExtractor):
webpage, 'datetime', None))
stream_server_data = self._download_json(
- 'https://twitcasting.tv/streamserver.php?target=%s&mode=client' % uploader_id, video_id,
+ f'https://twitcasting.tv/streamserver.php?target={uploader_id}&mode=client', video_id,
'Downloading live info', fatal=False)
is_live = any(f'data-{x}' in webpage for x in ['is-onlive="true"', 'live-type="live"', 'status="online"'])
@@ -189,7 +189,7 @@ class TwitCastingIE(InfoExtractor):
for mode, ws_url in streams.items():
formats.append({
'url': ws_url,
- 'format_id': 'ws-%s' % mode,
+ 'format_id': f'ws-{mode}',
'ext': 'mp4',
'quality': qq(mode),
'source_preference': -10,
@@ -244,8 +244,8 @@ class TwitCastingLiveIE(InfoExtractor):
def _real_extract(self, url):
uploader_id = self._match_id(url)
self.to_screen(
- 'Downloading live video of user {0}. '
- 'Pass "https://twitcasting.tv/{0}/show" to download the history'.format(uploader_id))
+ f'Downloading live video of user {uploader_id}. '
+ f'Pass "https://twitcasting.tv/{uploader_id}/show" to download the history')
is_live = traverse_obj(self._download_json(
f'https://frontendapi.twitcasting.tv/watch/user/{uploader_id}',
@@ -284,10 +284,10 @@ class TwitCastingUserIE(InfoExtractor):
}]
def _entries(self, uploader_id):
- base_url = next_url = 'https://twitcasting.tv/%s/show' % uploader_id
+ base_url = next_url = f'https://twitcasting.tv/{uploader_id}/show'
for page_num in itertools.count(1):
webpage = self._download_webpage(
- next_url, uploader_id, query={'filter': 'watchable'}, note='Downloading page %d' % page_num)
+ next_url, uploader_id, query={'filter': 'watchable'}, note=f'Downloading page {page_num}')
matches = re.finditer(
r'(?s)<a\s+class="tw-movie-thumbnail2"\s+href="(?P<url>/[^/"]+/movie/\d+)"', webpage)
for mobj in matches:
@@ -303,4 +303,4 @@ class TwitCastingUserIE(InfoExtractor):
def _real_extract(self, url):
uploader_id = self._match_id(url)
return self.playlist_result(
- self._entries(uploader_id), uploader_id, '%s - Live History' % uploader_id)
+ self._entries(uploader_id), uploader_id, f'{uploader_id} - Live History')