summaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/packtpub.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/extractor/packtpub.py')
-rw-r--r--yt_dlp/extractor/packtpub.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/yt_dlp/extractor/packtpub.py b/yt_dlp/extractor/packtpub.py
index 3e969c8..38ffd34 100644
--- a/yt_dlp/extractor/packtpub.py
+++ b/yt_dlp/extractor/packtpub.py
@@ -63,7 +63,7 @@ class PacktPubIE(PacktPubBaseIE):
headers['Authorization'] = 'Bearer ' + self._TOKEN
try:
video_url = self._download_json(
- 'https://services.packtpub.com/products-v1/products/%s/%s/%s' % (course_id, chapter_id, video_id), video_id,
+ f'https://services.packtpub.com/products-v1/products/{course_id}/{chapter_id}/{video_id}', video_id,
'Downloading JSON video', headers=headers)['data']
except ExtractorError as e:
if isinstance(e.cause, HTTPError) and e.cause.status == 400:
@@ -109,17 +109,16 @@ class PacktPubCourseIE(PacktPubBaseIE):
@classmethod
def suitable(cls, url):
- return False if PacktPubIE.suitable(url) else super(
- PacktPubCourseIE, cls).suitable(url)
+ return False if PacktPubIE.suitable(url) else super().suitable(url)
def _real_extract(self, url):
mobj = self._match_valid_url(url)
url, course_id = mobj.group('url', 'id')
course = self._download_json(
- self._STATIC_PRODUCTS_BASE + '%s/toc' % course_id, course_id)
+ self._STATIC_PRODUCTS_BASE + f'{course_id}/toc', course_id)
metadata = self._download_json(
- self._STATIC_PRODUCTS_BASE + '%s/summary' % course_id,
+ self._STATIC_PRODUCTS_BASE + f'{course_id}/summary',
course_id, fatal=False) or {}
entries = []