]> jfr.im git - yt-dlp.git/commitdiff
[cleanup,docs] Minor fixes
authorpukkandan <redacted>
Thu, 3 Feb 2022 15:02:10 +0000 (20:32 +0530)
committerpukkandan <redacted>
Thu, 3 Feb 2022 15:30:39 +0000 (21:00 +0530)
Closes #2541, #2484

14 files changed:
.github/ISSUE_TEMPLATE/1_broken_site.yml
.github/ISSUE_TEMPLATE/5_feature_request.yml
.github/ISSUE_TEMPLATE/6_question.yml
.github/ISSUE_TEMPLATE_tmpl/1_broken_site.yml
.github/ISSUE_TEMPLATE_tmpl/5_feature_request.yml
.github/ISSUE_TEMPLATE_tmpl/6_question.yml
CONTRIBUTING.md
README.md
yt_dlp/YoutubeDL.py
yt_dlp/extractor/common.py
yt_dlp/extractor/youtube.py
yt_dlp/options.py
yt_dlp/update.py
yt_dlp/utils.py

index f13ab2ebefd1e69ce5211fcb02a210de42022721..0ad3272aa34a8590c7fb6733a180e363173f6d64 100644 (file)
@@ -1,4 +1,4 @@
-name: Broken site support
+name: Broken site
 description: Report broken or misfunctioning site
 labels: [triage, site-bug]
 body:
index 476456322f38c46283dabacc96aeca3f05844ca0..3f1293d2c4c3054f0847b9baa7161969641f12fd 100644 (file)
@@ -11,6 +11,8 @@ body:
       options:
         - label: I'm reporting a feature request
           required: true
+        - label: I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
+          required: true
         - label: I've verified that I'm running yt-dlp version **2022.01.21**. ([update instructions](https://github.com/yt-dlp/yt-dlp#update))
           required: true
         - label: I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues including closed ones. DO NOT post duplicates
index 286281e24c6d9fdafe56d54b9f5004f50cb1a12a..061158ed3667e6785137f6b1236f0d269a4a1867 100644 (file)
@@ -25,7 +25,8 @@ body:
         Ask your question in an arbitrary form.
         Please make sure it's worded well enough to be understood, see [is-the-description-of-the-issue-itself-sufficient](https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient).
         Provide any additional information and as much context and examples as possible.
-        If your question contains "isn't working" or "can you add", this is most likely the wrong template
+        If your question contains "isn't working" or "can you add", this is most likely the wrong template.
+        If you are in doubt if this is the right template, use another template!
       placeholder: WRITE QUESTION HERE
     validations:
       required: true
index 65b6038fff48884b03b04581fa3d31423c0040ec..fd6435ba6093365d790a6b118c98cb3433ec9a81 100644 (file)
@@ -1,4 +1,4 @@
-name: Broken site support
+name: Broken site
 description: Report broken or misfunctioning site
 labels: [triage, site-bug]
 body:
index 6e8b2fd2866ce0570e5776879af26671d3dd0944..eb5d3d63475e5bcd5bfdafbe34321544b8fcab9a 100644 (file)
@@ -11,6 +11,8 @@ body:
       options:
         - label: I'm reporting a feature request
           required: true
+        - label: I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
+          required: true
         - label: I've verified that I'm running yt-dlp version **%(version)s**. ([update instructions](https://github.com/yt-dlp/yt-dlp#update))
           required: true
         - label: I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues including closed ones. DO NOT post duplicates
index 286281e24c6d9fdafe56d54b9f5004f50cb1a12a..061158ed3667e6785137f6b1236f0d269a4a1867 100644 (file)
@@ -25,7 +25,8 @@ body:
         Ask your question in an arbitrary form.
         Please make sure it's worded well enough to be understood, see [is-the-description-of-the-issue-itself-sufficient](https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient).
         Provide any additional information and as much context and examples as possible.
-        If your question contains "isn't working" or "can you add", this is most likely the wrong template
+        If your question contains "isn't working" or "can you add", this is most likely the wrong template.
+        If you are in doubt if this is the right template, use another template!
       placeholder: WRITE QUESTION HERE
     validations:
       required: true
index c25d6a2a576793c039698000697ee158412156ec..bfa8ae410cc1e877ae6c57ab95010c8161037aab 100644 (file)
@@ -113,7 +113,7 @@ ###  Is your question about yt-dlp?
 
 ### Are you willing to share account details if needed?
 
-The maintainers and potential contributors of the project often do not have an account for the website you are asking support for. So any developer interested in solving your issue may ask you for account details. It is your personal discression whether you are willing to share the account in order for the developer to try and solve your issue. However, if you are unwilling or unable to provide details, they obviously cannot work on the issue and it cannot be solved unless some developer who both has an account and is willing/able to contribute decides to solve it.
+The maintainers and potential contributors of the project often do not have an account for the website you are asking support for. So any developer interested in solving your issue may ask you for account details. It is your personal discretion whether you are willing to share the account in order for the developer to try and solve your issue. However, if you are unwilling or unable to provide details, they obviously cannot work on the issue and it cannot be solved unless some developer who both has an account and is willing/able to contribute decides to solve it.
 
 By sharing an account with anyone, you agree to bear all risks associated with it. The maintainers and yt-dlp can't be held responsible for any misuse of the credentials.
 
@@ -254,6 +254,8 @@ ### Mandatory and optional metafields
 
 The aforementioned metafields are the critical data that the extraction does not make any sense without and if any of them fail to be extracted then the extractor is considered completely broken. While all extractors must return a `title`, they must also allow it's extraction to be non-fatal.
 
+For pornographic sites, appropriate `age_limit` must also be returned.
+
 The extractor is allowed to return the info dict without url or formats in some special cases if it allows the user to extract usefull information with `--ignore-no-formats-error` - Eg: when the video is a live stream that has not started yet.
 
 [Any field](yt_dlp/extractor/common.py#219-L426) apart from the aforementioned ones are considered **optional**. That means that extraction should be **tolerant** to situations when sources for these fields can potentially be unavailable (even if they are always available at the moment) and **future-proof** in order not to break the extraction of general purpose mandatory fields.
index 958b9a0edc5f5e87ef577e0ead04fdaacfd3143b..a3cd9ba7b6bb2c2a4447c24af9e6ce4fb5824af0 100644 (file)
--- a/README.md
+++ b/README.md
@@ -394,7 +394,7 @@ ## Geo-restriction:
                                      option is not present) is used for the
                                      actual downloading
     --geo-bypass                     Bypass geographic restriction via faking
-                                     X-Forwarded-For HTTP header
+                                     X-Forwarded-For HTTP header (default)
     --no-geo-bypass                  Do not bypass geographic restriction via
                                      faking X-Forwarded-For HTTP header
     --geo-bypass-country CODE        Force bypass geographic restriction with
@@ -1143,6 +1143,7 @@ # OUTPUT TEMPLATE
 
  - `id` (string): Video identifier
  - `title` (string): Video title
+ - `fulltitle` (string): Video title ignoring live timestamp and generic title
  - `url` (string): Video URL
  - `ext` (string): Video filename extension
  - `alt_title` (string): A secondary title of the video
@@ -1198,16 +1199,16 @@ # OUTPUT TEMPLATE
  - `protocol` (string): The protocol that will be used for the actual download
  - `extractor` (string): Name of the extractor
  - `extractor_key` (string): Key name of the extractor
- - `epoch` (numeric): Unix epoch when creating the file
+ - `epoch` (numeric): Unix epoch of when the information extraction was completed
  - `autonumber` (numeric): Number that will be increased with each download, starting at `--autonumber-start`
  - `video_autonumber` (numeric): Number that will be increased with each video
  - `n_entries` (numeric): Total number of extracted items in the playlist
- - `playlist` (string): Name or id of the playlist that contains the video
+ - `playlist_id` (string): Identifier of the playlist that contains the video
+ - `playlist_title` (string): Name of the playlist that contains the video
+ - `playlist` (string): `playlist_id` or `playlist_title`
  - `playlist_count` (numeric): Total number of items in the playlist. May not be known if entire playlist is not extracted
  - `playlist_index` (numeric): Index of the video in the playlist padded with leading zeros according the final index
  - `playlist_autonumber` (numeric): Position of the video in the playlist download queue padded with leading zeros according to the total length of the playlist
- - `playlist_id` (string): Playlist identifier
- - `playlist_title` (string): Playlist title
  - `playlist_uploader` (string): Full name of the playlist uploader
  - `playlist_uploader_id` (string): Nickname or id of the playlist uploader
  - `webpage_url` (string): A URL to the video webpage which if given to yt-dlp should allow to get the same result again
@@ -1552,7 +1553,7 @@ # (https/ftps > http/ftp > m3u8_native > m3u8 > http_dash_segments ...)
 
 
 # Download the best video with h264 codec, or the best video if there is no such video
-$ yt-dlp -f "(bv*+ba/b)[vcodec^=avc1] / (bv*+ba/b)"
+$ yt-dlp -f "(bv*[vcodec^=avc1]+ba) / (bv*+ba/b)"
 
 # Download the best video with best codec no better than h264,
 # or the best video with worst codec if there is no such video
index e31edf50af14967b0661197591836681f08ebcb3..fd1584a7f0b566b17a434384beceb091a5ad3695 100644 (file)
@@ -596,14 +596,14 @@ def check_deprecated(param, option, suggestion):
         else:
             self.params['nooverwrites'] = not self.params['overwrites']
 
-        params.setdefault('forceprint', {})
-        params.setdefault('print_to_file', {})
+        self.params.setdefault('forceprint', {})
+        self.params.setdefault('print_to_file', {})
 
         # Compatibility with older syntax
         if not isinstance(params['forceprint'], dict):
-            params['forceprint'] = {'video': params['forceprint']}
+            self.params['forceprint'] = {'video': params['forceprint']}
 
-        if params.get('bidi_workaround', False):
+        if self.params.get('bidi_workaround', False):
             try:
                 import pty
                 master, slave = pty.openpty()
@@ -631,7 +631,7 @@ def check_deprecated(param, option, suggestion):
 
         if (sys.platform != 'win32'
                 and sys.getfilesystemencoding() in ['ascii', 'ANSI_X3.4-1968']
-                and not params.get('restrictfilenames', False)):
+                and not self.params.get('restrictfilenames', False)):
             # Unicode filesystem API will throw errors (#1474, #13027)
             self.report_warning(
                 'Assuming --restrict-filenames since file system encoding '
@@ -2240,10 +2240,7 @@ def restore_last_token(self):
 
     def _calc_headers(self, info_dict):
         res = std_headers.copy()
-
-        add_headers = info_dict.get('http_headers')
-        if add_headers:
-            res.update(add_headers)
+        res.update(info_dict.get('http_headers') or {})
 
         cookies = self._calc_cookies(info_dict)
         if cookies:
@@ -2309,6 +2306,8 @@ def process_video_result(self, info_dict, download=True):
             raise ExtractorError('Missing "id" field in extractor result', ie=info_dict['extractor'])
         elif not info_dict.get('id'):
             raise ExtractorError('Extractor failed to obtain "id"', ie=info_dict['extractor'])
+
+        info_dict['fulltitle'] = info_dict.get('title')
         if 'title' not in info_dict:
             raise ExtractorError('Missing "title" field in extractor result',
                                  video_id=info_dict['id'], ie=info_dict['extractor'])
@@ -2422,9 +2421,6 @@ def sanitize_numeric_fields(info):
         if not self.params.get('allow_unplayable_formats'):
             formats = [f for f in formats if not f.get('has_drm')]
 
-        # backward compatibility
-        info_dict['fulltitle'] = info_dict['title']
-
         if info_dict.get('is_live'):
             get_from_start = bool(self.params.get('live_from_start'))
             formats = [f for f in formats if bool(f.get('is_from_start')) == get_from_start]
index 31b1bab3b7ce517ba891bbf91d4a3fc18fb2e37a..ac9e285603a1e3a1bfc1341dc1f26bd0ad5bd4ea 100644 (file)
@@ -1291,7 +1291,8 @@ def _og_search_description(self, html, **kargs):
         return self._og_search_property('description', html, fatal=False, **kargs)
 
     def _og_search_title(self, html, **kargs):
-        return self._og_search_property('title', html, fatal=False, **kargs)
+        kargs.setdefault('fatal', False)
+        return self._og_search_property('title', html, **kargs)
 
     def _og_search_video_url(self, html, name='video url', secure=True, **kargs):
         regexes = self._og_regexes('video') + self._og_regexes('video:url')
index 452ed14d6ba0327fb86e2d6578ae9558501527bd..cd9a1b77441c232fe7da157daab159e2f6126946 100644 (file)
@@ -5353,7 +5353,7 @@ def _real_extract(self, url):
 
 
 class YoutubeMusicSearchURLIE(YoutubeTabBaseInfoExtractor):
-    IE_DESC = 'YouTube music search URLs with sorting and filter support'
+    IE_DESC = 'YouTube music search URLs with selectable sections (Eg: #songs)'
     IE_NAME = 'youtube:music:search_url'
     _VALID_URL = r'https?://music\.youtube\.com/search\?([^#]+&)?(?:search_query|q)=(?:[^&]+)(?:[&#]|$)'
     _TESTS = [{
index 5622100bb9d9091f4dfab738b43e8ee7ffbbc47a..a6d7c17eb7d0b9c44f145dc5e3f33bdb68312291 100644 (file)
@@ -381,10 +381,10 @@ def _dict_from_options_callback(
     geo.add_option(
         '--geo-bypass',
         action='store_true', dest='geo_bypass', default=True,
-        help='Bypass geographic restriction via faking X-Forwarded-For HTTP header')
+        help='Bypass geographic restriction via faking X-Forwarded-For HTTP header (default)')
     geo.add_option(
         '--no-geo-bypass',
-        action='store_false', dest='geo_bypass', default=True,
+        action='store_false', dest='geo_bypass',
         help='Do not bypass geographic restriction via faking X-Forwarded-For HTTP header')
     geo.add_option(
         '--geo-bypass-country', metavar='CODE',
index f3448568a51fce261b2a7ddce58f7ed655fc1cf8..a208e163c9d41b72dfa6a8ca94a2cc5893b16057 100644 (file)
@@ -54,7 +54,7 @@ def detect_variant():
     'win_dir': 'Auto-update is not supported for unpackaged windows executable; Re-download the latest release',
     'mac_dir': 'Auto-update is not supported for unpackaged MacOS executable; Re-download the latest release',
     'source': 'You cannot update when running from source code; Use git to pull the latest changes',
-    'unknown': 'It looks like you installed yt-dlp with a package manager, pip, setup.py or a tarball; Use that to update',
+    'unknown': 'It looks like you installed yt-dlp with a package manager, pip or setup.py; Use that to update',
 }
 
 
index fd3912d188fb3c56bcc244d68a80891fc0771c1a..fe1096168ff26dc931573192050fdb07a26c97d3 100644 (file)
@@ -1018,13 +1018,9 @@ def make_HTTPS_handler(params, **kwargs):
 
 
 def bug_reports_message(before=';'):
-    if ytdl_is_updateable():
-        update_cmd = 'type  yt-dlp -U  to update'
-    else:
-        update_cmd = 'see  https://github.com/yt-dlp/yt-dlp  on how to update'
-    msg = 'please report this issue on  https://github.com/yt-dlp/yt-dlp .'
-    msg += ' Make sure you are using the latest version; %s.' % update_cmd
-    msg += ' Be sure to call yt-dlp with the --verbose flag and include its complete output.'
+    msg = ('please report this issue on  https://github.com/yt-dlp/yt-dlp , '
+           'filling out the "Broken site" issue template properly. '
+           'Confirm you are on the latest version using -U')
 
     before = before.rstrip()
     if not before or before.endswith(('.', '!', '?')):