]> jfr.im git - yt-dlp.git/blame - devscripts/make_issue_template.py
[cleanup] Update documentation for master and nightly channels
[yt-dlp.git] / devscripts / make_issue_template.py
CommitLineData
cc52de43 1#!/usr/bin/env python3
54007a45 2
3# Allow direct execution
4import os
5import sys
6
7sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
8
9
ca9f1df2 10import re
7710bdf4 11
115add43 12from devscripts.utils import (
13 get_filename_args,
14 read_file,
115add43 15 write_file,
16)
c1714454 17
ca9f1df2 18VERBOSE_TMPL = '''
19 - type: checkboxes
20 id: verbose
21 attributes:
22 label: Provide verbose output that clearly demonstrates the problem
23 options:
24 - label: Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
25 required: true
5b28cef7 26 - label: "If using API, add `'verbose': True` to `YoutubeDL` params instead"
27 required: false
ca9f1df2 28 - label: Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below
29 required: true
30 - type: textarea
31 id: log
32 attributes:
33 label: Complete Verbose Output
34 description: |
35 It should start like this:
36 placeholder: |
a00af298 37 [debug] Command-line config: ['-vU', 'https://www.youtube.com/watch?v=BaW_jenozKc']
ca9f1df2 38 [debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8
a00af298 39 [debug] yt-dlp version nightly@... from yt-dlp/yt-dlp [b634ba742] (win_exe)
ca9f1df2 40 [debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.22000-SP0
ca9f1df2 41 [debug] exe versions: ffmpeg N-106550-g072101bd52-20220410 (fdk,setts), ffprobe N-106624-g391ce570c8-20220415, phantomjs 2.1.1
42 [debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
43 [debug] Proxy map: {}
a00af298 44 [debug] Request Handlers: urllib, requests
45 [debug] Loaded 1893 extractors
46 [debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
47 yt-dlp is up to date (nightly@... from yt-dlp/yt-dlp-nightly-builds)
48 [youtube] Extracting URL: https://www.youtube.com/watch?v=BaW_jenozKc
ca9f1df2 49 <more lines>
50 render: shell
51 validations:
52 required: true
53'''.strip()
54
115add43 55NO_SKIP = '''
56 - type: checkboxes
57 attributes:
58 label: DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
59 description: Fill all fields even if you think it is irrelevant for the issue
60 options:
a5387729 61 - label: I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\\* field
115add43 62 required: true
63'''.strip()
ca9f1df2 64
7710bdf4 65
115add43 66def main():
a00af298 67 fields = {'no_skip': NO_SKIP}
ca9f1df2 68 fields['verbose'] = VERBOSE_TMPL % fields
69 fields['verbose_optional'] = re.sub(r'(\n\s+validations:)?\n\s+required: true', '', fields['verbose'])
70
115add43 71 infile, outfile = get_filename_args(has_infile=True)
72 write_file(outfile, read_file(infile) % fields)
7710bdf4 73
86e5f3ed 74
7710bdf4
SO
75if __name__ == '__main__':
76 main()