]> jfr.im git - yt-dlp.git/commitdiff
Fix some linter and typos
authorpukkandan <redacted>
Fri, 16 Apr 2021 00:00:46 +0000 (05:30 +0530)
committerpukkandan <redacted>
Fri, 16 Apr 2021 00:01:47 +0000 (05:31 +0530)
README.md
test/test_YoutubeDL.py
yt_dlp/extractor/crunchyroll.py
yt_dlp/extractor/viu.py

index 9b2267a86a7ab7f3480bec90f6d14c7dfb2cb757..9abf993b6157a65f3681cfe108421aed430f7562 100644 (file)
--- a/README.md
+++ b/README.md
@@ -9,11 +9,10 @@ # YT-DLP
 [![Release version](https://img.shields.io/github/v/release/yt-dlp/yt-dlp?color=brightgreen&label=Release&style=for-the-badge)](https://github.com/yt-dlp/yt-dlp/releases/latest)
 [![License: Unlicense](https://img.shields.io/badge/License-Unlicense-blue.svg?style=for-the-badge)](LICENSE)
 [![Doc Status](https://readthedocs.org/projects/yt-dlp/badge/?version=latest&style=for-the-badge)](https://yt-dlp.readthedocs.io)
-[![Discord](https://img.shields.io/discord/807245652072857610?color=blue&label=discord&logo=discord&style=for-the-badge)](https://discord.gg/H5MNcFW63r)  
-
+[![Discord](https://img.shields.io/discord/807245652072857610?color=blue&label=discord&logo=discord&style=for-the-badge)](https://discord.gg/H5MNcFW63r)
 [![Commits](https://img.shields.io/github/commit-activity/m/yt-dlp/yt-dlp?label=commits&style=for-the-badge)](https://github.com/yt-dlp/yt-dlp/commits)
 [![Last Commit](https://img.shields.io/github/last-commit/yt-dlp/yt-dlp/master?style=for-the-badge)](https://github.com/yt-dlp/yt-dlp/commits)
-[![Downloads](https://img.shields.io/github/downloads/yt-dlp/yt-dlp/total?style=for-the-badge)](https://github.com/yt-dlp/yt-dlp/releases/latest)
+[![Downloads](https://img.shields.io/github/downloads/yt-dlp/yt-dlp/total?style=for-the-badge&color=blue)](https://github.com/yt-dlp/yt-dlp/releases/latest)
 [![PyPi Downloads](https://img.shields.io/pypi/dm/yt-dlp?label=PyPi&style=for-the-badge)](https://pypi.org/project/yt-dlp)
 
 </div>
@@ -1063,7 +1062,7 @@ ## Sorting Formats
  - `lang`: Language preference as given by the extractor
  - `quality`: The quality of the format as given by the extractor
  - `source`: Preference of the source as given by the extractor
- - `proto`: Protocol used for download (`https`/`ftps` > `http`/`ftp` > `m3u8-native` > `m3u8` > `http-dash-segments` > other > `mms`/`rtsp` > unknown > `f4f`/`f4m`)
+ - `proto`: Protocol used for download (`https`/`ftps` > `http`/`ftp` > `m3u8_native` > `m3u8` > `http_dash_segments` > other > `mms`/`rtsp` > unknown > `f4f`/`f4m`)
  - `vcodec`: Video Codec (`av01` > `vp9.2` > `vp9` > `h265` > `h264` > `vp8` > `h263` > `theora` > other > unknown)
  - `acodec`: Audio Codec (`opus` > `vorbis` > `aac` > `mp4a` > `mp3` > `ac3` > `dts` > other > unknown)
  - `codec`: Equivalent to `vcodec,acodec`
index 6ae36638be9b27af1de36905078db826c9d9823f..b910a26a887af38d42d6c556995f8562744e045a 100644 (file)
@@ -311,8 +311,8 @@ def test_format_selection_string_ops(self):
         self.assertRaises(ExtractorError, ydl.process_ie_result, info_dict.copy())
 
     def test_youtube_format_selection(self):
+        # FIXME: Rewrite in accordance with the new format sorting options
         return
-        # disabled for now - this needs some changes
 
         order = [
             '38', '37', '46', '22', '45', '35', '44', '18', '34', '43', '6', '5', '17', '36', '13',
index d670c12c1e306fbb9e47b8c55ad5a45b406308f6..d6c3f4f93c2294458c8765aa1612dcc7d9dcc879 100644 (file)
@@ -428,7 +428,7 @@ def _real_extract(self, url):
             r'<div class="showmedia-trailer-notice">(.+?)</div>',
             webpage, 'trailer-notice', default='')
         if note_m:
-            raise ExtractorError(note_m)
+            raise ExtractorError(note_m, expected=True)
 
         mobj = re.search(r'Page\.messaging_box_controller\.addItems\(\[(?P<msg>{.+?})\]\)', webpage)
         if mobj:
index 92422f1978d3393e019fed8ad2fff15c778d91d8..3292d553e85101a650e12644d6a40ddff78489aa 100644 (file)
@@ -14,6 +14,7 @@
 from ..utils import (
     ExtractorError,
     int_or_none,
+    try_get,
     smuggle_url,
     unsmuggle_url,
 )
@@ -344,7 +345,7 @@ def _real_extract(self, url):
                         video_id, 'Downloading stream info', query=query, headers=headers)
                     try:
                         stream_data = self._detect_error(stream_data)['stream']
-                    except (ExtractorError, KeyError): # if still not working, give up
+                    except (ExtractorError, KeyError):  # if still not working, give up
                         self._raise_login_required()
 
         if not stream_data: