[ie] Resolve `language` to ISO639-2 for ISM formats (#11359)
[yt-dlp3.git] / devscripts / make_issue_template.py
blob2a418ddbf728a59d18c504c94ef094ad611c9c43
1 #!/usr/bin/env python3
3 # Allow direct execution
4 import os
5 import sys
7 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
10 import re
12 from devscripts.utils import get_filename_args, read_file, write_file
14 VERBOSE_TMPL = '''
15 - type: checkboxes
16 id: verbose
17 attributes:
18 label: Provide verbose output that clearly demonstrates the problem
19 options:
20 - label: Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
21 required: true
22 - label: "If using API, add `'verbose': True` to `YoutubeDL` params instead"
23 required: false
24 - label: Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below
25 required: true
26 - type: textarea
27 id: log
28 attributes:
29 label: Complete Verbose Output
30 description: |
31 It should start like this:
32 placeholder: |
33 [debug] Command-line config: ['-vU', 'https://www.youtube.com/watch?v=BaW_jenozKc']
34 [debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8
35 [debug] yt-dlp version nightly@... from yt-dlp/yt-dlp-nightly-builds [1a176d874] (win_exe)
36 [debug] Python 3.10.11 (CPython AMD64 64bit) - Windows-10-10.0.20348-SP0 (OpenSSL 1.1.1t 7 Feb 2023)
37 [debug] exe versions: ffmpeg 7.0.2 (setts), ffprobe 7.0.2
38 [debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2024.08.30, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.40.1, urllib3-2.2.3, websockets-13.1
39 [debug] Proxy map: {}
40 [debug] Request Handlers: urllib, requests, websockets, curl_cffi
41 [debug] Loaded 1838 extractors
42 [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
43 Latest version: nightly@... from yt-dlp/yt-dlp-nightly-builds
44 yt-dlp is up to date (nightly@... from yt-dlp/yt-dlp-nightly-builds)
45 [youtube] Extracting URL: https://www.youtube.com/watch?v=BaW_jenozKc
46 <more lines>
47 render: shell
48 validations:
49 required: true
50 - type: markdown
51 attributes:
52 value: |
53 > [!CAUTION]
54 > ### GitHub is experiencing a high volume of malicious spam comments.
55 > ### If you receive any replies asking you download a file, do NOT follow the download links!
57 > Note that this issue may be temporarily locked as an anti-spam measure after it is opened.
58 '''.strip()
60 NO_SKIP = '''
61 - type: checkboxes
62 attributes:
63 label: DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
64 description: Fill all fields even if you think it is irrelevant for the issue
65 options:
66 - label: I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\\* field
67 required: true
68 '''.strip()
71 def main():
72 fields = {'no_skip': NO_SKIP}
73 fields['verbose'] = VERBOSE_TMPL % fields
74 fields['verbose_optional'] = re.sub(r'(\n\s+validations:)?\n\s+required: true', '', fields['verbose'])
76 infile, outfile = get_filename_args(has_infile=True)
77 write_file(outfile, read_file(infile) % fields)
80 if __name__ == '__main__':
81 main()