]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/libsyn.py
[ie/youtube] Suppress "Unavailable videos are hidden" warning (#10159)
[yt-dlp.git] / yt_dlp / extractor / libsyn.py
index d1fcda4ef8bdc38c7133a42ad893a1b70e21d279..4ca521a106e8169aad0adb34929ee8b76887f53a 100644 (file)
@@ -1,7 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
-
 from .common import InfoExtractor
 from ..utils import (
     clean_html,
@@ -14,6 +10,7 @@
 
 class LibsynIE(InfoExtractor):
     _VALID_URL = r'(?P<mainurl>https?://html5-player\.libsyn\.com/embed/episode/id/(?P<id>[0-9]+))'
+    _EMBED_REGEX = [r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//html5-player\.libsyn\.com/embed/.+?)\1']
 
     _TESTS = [{
         'url': 'http://html5-player.libsyn.com/embed/episode/id/6385796/',
@@ -21,7 +18,7 @@ class LibsynIE(InfoExtractor):
         'info_dict': {
             'id': '6385796',
             'ext': 'mp3',
-            'title': "Champion Minded - Developing a Growth Mindset",
+            'title': 'Champion Minded - Developing a Growth Mindset',
             # description fetched using another request:
             # http://html5-player.libsyn.com/embed/getitemdetails?item_id=6385796
             # 'description': 'In this episode, Allistair talks about the importance of developing a growth mindset, not only in sports, but in life too.',
@@ -37,7 +34,7 @@ class LibsynIE(InfoExtractor):
             'title': 'Clients From Hell Podcast - How a Sex Toy Company Kickstarted my Freelance Career',
             'upload_date': '20150818',
             'thumbnail': 're:^https?://.*',
-        }
+        },
     }]
 
     def _real_extract(self, url):
@@ -59,7 +56,7 @@ def _real_extract(self, url):
             r'<h3>([^<]+)</h3>', webpage, 'podcast title',
             default=None) or get_element_by_class('podcast-title', webpage)))
 
-        title = '%s - %s' % (podcast_title, episode_title) if podcast_title else episode_title
+        title = f'{podcast_title} - {episode_title}' if podcast_title else episode_title
 
         formats = []
         for k, format_id in (('media_url_libsyn', 'libsyn'), ('media_url', 'main'), ('download_link', 'download')):