]> jfr.im git - yt-dlp.git/commitdiff
[cleanup] Minor cleanup
authorpukkandan <redacted>
Wed, 3 Nov 2021 22:10:35 +0000 (03:40 +0530)
committerpukkandan <redacted>
Wed, 3 Nov 2021 22:23:15 +0000 (03:53 +0530)
.github/ISSUE_TEMPLATE_tmpl/1_broken_site.yml
.github/ISSUE_TEMPLATE_tmpl/2_site_support_request.yml
.github/ISSUE_TEMPLATE_tmpl/4_bug_report.yml
README.md
yt_dlp/YoutubeDL.py
yt_dlp/downloader/common.py
yt_dlp/extractor/picarto.py
yt_dlp/extractor/youtube.py
yt_dlp/options.py

index fdca0e53a8ce102c9c142a4df340e920ce1944ea..e23bc4195c6f5e1395c00f1579c19fc39038f131 100644 (file)
@@ -43,7 +43,7 @@ body:
     attributes:
       label: Verbose log
       description: |
-        Provide the complete verbose output of yt-dlp that clearly demonstrates the problem.
+        Provide the complete verbose output of yt-dlp **that clearly demonstrates the problem**.
         Add the `-Uv` flag to your command line you run yt-dlp with (`yt-dlp -Uv <your command line>`), copy the WHOLE output and insert it below.
         It should look similar to this:
       placeholder: |
index f7a48edc79ec1a6835fed7f0bcab3d9fe1a7ec21..f353848214109ca5d73eab7380128080362f5fb9 100644 (file)
@@ -54,7 +54,7 @@ body:
     attributes:
       label: Verbose log
       description: |
-        Provide the complete verbose output using one of the example URLs provided above.
+        Provide the complete verbose output **using one of the example URLs provided above**.
         Add the `-Uv` flag to your command line you run yt-dlp with (`yt-dlp -Uv <your command line>`), copy the WHOLE output and insert it below.
         It should look similar to this:
       placeholder: |
index e4d669bb7b54ce8ac133f1f2d50902ec939dafe9..8219ebfd437cbd41ec4262244200b777b472e6e9 100644 (file)
@@ -37,8 +37,8 @@ body:
     attributes:
       label: Verbose log
       description: |
-        Provide the complete verbose output of yt-dlp that clearly demonstrates the problem.
-        Add the `-Uv` flag to your command line you run yt-dlp with (`yt-dlp -Uv <your command line>`), copy the WHOLE output and insert it below.
+        Provide the complete verbose output of yt-dlp **that clearly demonstrates the problem**.
+        Add the `-Uv` flag to **your** command line you run yt-dlp with (`yt-dlp -Uv <your command line>`), copy the WHOLE output and insert it below.
         It should look similar to this:
       placeholder: |
         [debug] Command-line config: ['-Uv', 'http://www.youtube.com/watch?v=BaW_jenozKc']
index 31bfca6a8cbce5662d14477593a373266031cc02..ccd221bb4428015bfa52d07e872e27fef52a7453 100644 (file)
--- a/README.md
+++ b/README.md
@@ -79,7 +79,7 @@ # NEW FEATURES
     * Search (`ytsearch:`, `ytsearchdate:`), search URLs and in-channel search works
     * Mixes supports downloading multiple pages of content
     * Most (but not all) age-gated content can be downloaded without cookies
-    * Partial workaround for throttling issue
+    * Fix for [n-sig based throttling](https://github.com/ytdl-org/youtube-dl/issues/29326)
     * Redirect channel's home URL automatically to `/video` to preserve the old behaviour
     * `255kbps` audio is extracted (if available) from youtube music when premium cookies are given
     * Youtube music Albums, channels etc can be downloaded ([except self-uploaded music](https://github.com/yt-dlp/yt-dlp/issues/723))
@@ -154,7 +154,7 @@ # INSTALLATION
 
 You can install yt-dlp using one of the following methods:
 
-#### Using the release binary
+### Using the release binary
 
 You can simply download the [correct binary file](#release-files) for your OS: **[[Windows](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe)] [[UNIX-like](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp)]**
 
@@ -177,7 +177,7 @@ #### Using the release binary
 
 PS: The manpages, shell completion files etc. are available in [yt-dlp.tar.gz](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz)
 
-#### With [PIP](https://pypi.org/project/pip)
+### With [PIP](https://pypi.org/project/pip)
 
 You can install the [PyPI package](https://pypi.org/project/yt-dlp) with:
 ```
@@ -196,7 +196,7 @@ #### With [PIP](https://pypi.org/project/pip)
 
 Note that on some systems, you may need to use `py` or `python` instead of `python3`
 
-#### With [Homebrew](https://brew.sh)
+### With [Homebrew](https://brew.sh)
 
 macOS or Linux users that are using Homebrew can also install it by:
 
@@ -204,14 +204,14 @@ #### With [Homebrew](https://brew.sh)
 brew install yt-dlp/taps/yt-dlp
 ```
 
-### UPDATE
+## UPDATE
 You can use `yt-dlp -U` to update if you are [using the provided release](#using-the-release-binary)
 
 If you [installed with pip](#with-pip), simply re-run the same command that was used to install the program
 
 If you [installed using Homebrew](#with-homebrew), run `brew upgrade yt-dlp/taps/yt-dlp`
 
-### RELEASE FILES
+## RELEASE FILES
 
 #### Recommended
 
@@ -238,7 +238,7 @@ #### Misc
 [SHA2-512SUMS](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-512SUMS)|GNU-style SHA512 sums
 [SHA2-256SUMS](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-256SUMS)|GNU-style SHA256 sums
 
-### DEPENDENCIES
+## DEPENDENCIES
 Python versions 3.6+ (CPython and PyPy) are supported. Other versions and implementations may or may not work correctly.
 
 <!-- Python 3.5+ uses VC++14 and it is already embedded in the binary created
@@ -266,7 +266,7 @@ ### DEPENDENCIES
 **Note**: There are some regressions in newer ffmpeg versions that causes various issues when used alongside yt-dlp. Since ffmpeg is such an important dependancy, we provide [custom builds](https://github.com/yt-dlp/FFmpeg-Builds/wiki/Latest#latest-autobuilds) with patches for these issues at [yt-dlp/FFmpeg-Builds](https://github.com/yt-dlp/FFmpeg-Builds). See [the readme](https://github.com/yt-dlp/FFmpeg-Builds#patches-applied) for details on the specifc issues solved by these builds
 
 
-### COMPILE
+## COMPILE
 
 **For Windows**:
 To build the Windows executable, you must have pyinstaller (and optionally mutagen, pycryptodomex, websockets). Once you have all the necessary dependencies installed, (optionally) build lazy extractors using `devscripts/make_lazy_extractors.py`, and then just run `pyinst.py`. The executable will be built for the same architecture (32/64 bit) as the python used to build it.
@@ -754,7 +754,7 @@ ## Subtitle Options:
                                      "ass/srt/best"
     --sub-langs LANGS                Languages of the subtitles to download (can
                                      be regex) or "all" separated by commas.
-                                     (Eg: --sub-langs en.*,ja) You can prefix
+                                     (Eg: --sub-langs "en.*,ja") You can prefix
                                      the language code with a "-" to exempt it
                                      from the requested languages. (Eg: --sub-
                                      langs all,-live_chat) Use --list-subs for a
@@ -989,7 +989,7 @@ # CONFIGURATION
     * `~/yt-dlp.conf`
     * `~/yt-dlp.conf.txt`
 
-    `%XDG_CONFIG_HOME%` defaults to `~/.config` if undefined. On windows, `~` points to %HOME% if present, `%USERPROFILE%` (generally `C:\Users\<user name>`) or `%HOMEDRIVE%%HOMEPATH%`.
+    `%XDG_CONFIG_HOME%` defaults to `~/.config` if undefined. On windows, `%APPDATA%` generally points to (`C:\Users\<user name>\AppData\Roaming`) and `~` points to `%HOME%` if present, `%USERPROFILE%` (generally `C:\Users\<user name>`), or `%HOMEDRIVE%%HOMEPATH%`
 1. **System Configuration**: `/etc/yt-dlp.conf`
 
 For example, with the following configuration file yt-dlp will always extract the audio, not copy the mtime, use a proxy and save all videos under `YouTube` directory in your home directory:
@@ -1011,7 +1011,7 @@ # Save all videos under YouTube directory in your home directory
 
 Note that options in configuration file are just the same options aka switches used in regular command line calls; thus there **must be no whitespace** after `-` or `--`, e.g. `-o` or `--proxy` but not `- o` or `-- proxy`.
 
-You can use `--ignore-config` if you want to disable all configuration files for a particular yt-dlp run. If `--ignore-config` is found inside any configuration file, no further configuration will be loaded. For example, having the option in the portable configuration file prevents loading of user and system configurations. Additionally, (for backward compatibility) if `--ignore-config` is found inside the system configuration file, the user configuration is not loaded.
+You can use `--ignore-config` if you want to disable all configuration files for a particular yt-dlp run. If `--ignore-config` is found inside any configuration file, no further configuration will be loaded. For example, having the option in the portable configuration file prevents loading of home, user, and system configurations. Additionally, (for backward compatibility) if `--ignore-config` is found inside the system configuration file, the user configuration is not loaded.
 
 ### Authentication with `.netrc` file
 
@@ -1478,7 +1478,7 @@ # preferring better codec and then larger total bitrate for the same resolution
 
 # MODIFYING METADATA
 
-The metadata obtained the the extractors can be modified by using `--parse-metadata` and `--replace-in-metadata`
+The metadata obtained by the extractors can be modified by using `--parse-metadata` and `--replace-in-metadata`
 
 `--replace-in-metadata FIELDS REGEX REPLACE` is used to replace text in any metadata field using [python regular expression](https://docs.python.org/3/library/re.html#regular-expression-syntax). [Backreferences](https://docs.python.org/3/library/re.html?highlight=backreferences#re.sub) can be used in the replace string for advanced use.
 
index a866178b034304d2bc311b72555d0ead3f671816..872bd5e11c87bbb2b638ed46473384e8a9dfa881 100644 (file)
@@ -3209,7 +3209,7 @@ def list_formats(self, info_dict):
                     self._format_screen(format_field(f, 'format_id'), self.Styles.ID),
                     format_field(f, 'ext'),
                     self.format_resolution(f),
-                    format_field(f, 'fps', '%d'),
+                    format_field(f, 'fps', '%3d'),
                     format_field(f, 'dynamic_range', '%s', ignore=(None, 'SDR')).replace('HDR', ''),
                     delim,
                     format_field(f, 'filesize', ' %s', func=format_bytes) + format_field(f, 'filesize_approx', '~%s', func=format_bytes),
@@ -3353,7 +3353,7 @@ def python_implementation():
         exe_versions, ffmpeg_features = FFmpegPostProcessor.get_versions_and_features(self)
         ffmpeg_features = {key for key, val in ffmpeg_features.items() if val}
         if ffmpeg_features:
-            exe_versions['ffmpeg'] += f' (%s)' % ','.join(ffmpeg_features)
+            exe_versions['ffmpeg'] += ' (%s)' % ','.join(ffmpeg_features)
 
         exe_versions['rtmpdump'] = rtmpdump_version()
         exe_versions['phantomjs'] = PhantomJSwrapper._version()
index bcf8ac9554397d19cc9a12735b7297dbf9216579..4528f3be5c9590debc3df3a4c66645c61c7b790f 100644 (file)
@@ -319,7 +319,9 @@ def report_progress(self, s):
                     msg_template = '%(_downloaded_bytes_str)s at %(_speed_str)s'
             else:
                 msg_template = '%(_percent_str)s % at %(_speed_str)s ETA %(_eta_str)s'
-        if s.get('fragment_index'):
+        if s.get('fragment_index') and s.get('fragment_count'):
+            msg_template += ' (frag %(fragment_index)s/%(fragment_count)s)'
+        elif s.get('fragment_index'):
             msg_template += ' (frag %(fragment_index)s)'
         s['_default_template'] = msg_template % s
         self._report_progress_status(s)
index e6c51e16b5c65e7ea2ba4271e93be9cb16d5cb7a..17d08d69ee6528e0712e54a9f7bbe22e8029e23b 100644 (file)
@@ -111,7 +111,7 @@ def _real_extract(self, url):
         vod_info = self._parse_json(
             self._search_regex(
                 r'(?s)#vod-player["\']\s*,\s*(\{.+?\})\s*\)', webpage,
-                video_id),
+                'vod player'),
             video_id, transform_source=js_to_json)
 
         formats = self._extract_m3u8_formats(
index 4284143839ab955d162d7bad15902e84a62edb35..71428ad3a279a9ff53a11b4603085a003721a67d 100644 (file)
@@ -2513,7 +2513,7 @@ def _extract_formats(self, streaming_data, video_id, player_url, is_live):
                     fmt.get('qualityLabel') or quality.replace('audio_quality_', ''),
                     throttled and 'THROTTLED'))),
                 'source_preference': -10 if not throttled else -1,
-                'fps': int_or_none(fmt.get('fps')),
+                'fps': int_or_none(fmt.get('fps')) or None,
                 'height': height,
                 'quality': q(quality),
                 'tbr': tbr,
index bd9fdd37bde8bf468b3a1ec641505a5492d9fccd..89a1a8637e9e8b29a42982b6f32acb0d9b05d5f6 100644 (file)
@@ -634,7 +634,7 @@ def _dict_from_options_callback(
         action='callback', dest='subtitleslangs', metavar='LANGS', type='str',
         default=[], callback=_list_from_options_callback,
         help=(
-            'Languages of the subtitles to download (can be regex) or "all" separated by commas. (Eg: --sub-langs en.*,ja) '
+            'Languages of the subtitles to download (can be regex) or "all" separated by commas. (Eg: --sub-langs "en.*,ja") '
             'You can prefix the language code with a "-" to exempt it from the requested languages. (Eg: --sub-langs all,-live_chat) '
             'Use --list-subs for a list of available language tags'))