]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/ndtv.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / ndtv.py
index fbb033169f7cd44748f5f883f00760ae5fe8b014..c328bd4d2394aedf2aaa5363cf772b7a8c359d4f 100644 (file)
@@ -1,16 +1,11 @@
+import urllib.parse
+
 from .common import InfoExtractor
-from ..compat import (
-    compat_urllib_parse_unquote_plus
-)
-from ..utils import (
-    parse_duration,
-    remove_end,
-    unified_strdate,
-    urljoin
-)
+from ..utils import parse_duration, remove_end, unified_strdate, urljoin
 
 
 class NDTVIE(InfoExtractor):
+    _WORKING = False
     _VALID_URL = r'https?://(?:[^/]+\.)?ndtv\.com/(?:[^/]+/)*videos?/?(?:[^/]+/)*[^/?^&]+-(?P<id>\d+)'
 
     _TESTS = [
@@ -20,12 +15,12 @@ class NDTVIE(InfoExtractor):
             'info_dict': {
                 'id': '468818',
                 'ext': 'mp4',
-                'title': "प्राइम टाइम: सिस्टम बीमार, स्कूल बदहाल",
+                'title': 'प्राइम टाइम: सिस्टम बीमार, स्कूल बदहाल',
                 'description': 'md5:f410512f1b49672e5695dea16ef2731d',
                 'upload_date': '20170928',
                 'duration': 2218,
                 'thumbnail': r're:https?://.*\.jpg',
-            }
+            },
         },
         {
             # __filename is url
@@ -34,45 +29,45 @@ class NDTVIE(InfoExtractor):
             'info_dict': {
                 'id': '470304',
                 'ext': 'mp4',
-                'title': "Cracker-Free Diwali Wishes From Karan Johar, Kriti Sanon & Other Stars",
+                'title': 'Cracker-Free Diwali Wishes From Karan Johar, Kriti Sanon & Other Stars',
                 'description': 'md5:f115bba1adf2f6433fa7c1ade5feb465',
                 'upload_date': '20171019',
                 'duration': 137,
                 'thumbnail': r're:https?://.*\.jpg',
-            }
+            },
         },
         {
             'url': 'https://www.ndtv.com/video/news/news/delhi-s-air-quality-status-report-after-diwali-is-very-poor-470372',
-            'only_matching': True
+            'only_matching': True,
         },
         {
             'url': 'https://auto.ndtv.com/videos/the-cnb-daily-october-13-2017-469935',
-            'only_matching': True
+            'only_matching': True,
         },
         {
             'url': 'https://sports.ndtv.com/cricket/videos/2nd-t20i-rock-thrown-at-australia-cricket-team-bus-after-win-over-india-469764',
-            'only_matching': True
+            'only_matching': True,
         },
         {
             'url': 'http://gadgets.ndtv.com/videos/uncharted-the-lost-legacy-review-465568',
-            'only_matching': True
+            'only_matching': True,
         },
         {
             'url': 'http://profit.ndtv.com/videos/news/video-indian-economy-on-very-solid-track-international-monetary-fund-chief-470040',
-            'only_matching': True
+            'only_matching': True,
         },
         {
             'url': 'http://food.ndtv.com/video-basil-seeds-coconut-porridge-419083',
-            'only_matching': True
+            'only_matching': True,
         },
         {
             'url': 'https://doctor.ndtv.com/videos/top-health-stories-of-the-week-467396',
-            'only_matching': True
+            'only_matching': True,
         },
         {
             'url': 'https://swirlster.ndtv.com/video/how-to-make-friends-at-work-469324',
-            'only_matching': True
-        }
+            'only_matching': True,
+        },
     ]
 
     def _real_extract(self, url):
@@ -80,7 +75,7 @@ def _real_extract(self, url):
         webpage = self._download_webpage(url, video_id)
 
         # '__title' does not contain extra words such as sub-site name, "Video" etc.
-        title = compat_urllib_parse_unquote_plus(
+        title = urllib.parse.unquote_plus(
             self._search_regex(r"__title\s*=\s*'([^']+)'", webpage, 'title', default=None)
             or self._og_search_title(webpage))