Skip to content

Commit 88f23a1

Browse files
committed
[docs,cleanup] Fix linter and misc cleanup
Closes yt-dlp#2419
1 parent bb66c24 commit 88f23a1

File tree

10 files changed

+16
-12
lines changed

10 files changed

+16
-12
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ contact_links:
33
- name: Get help from the community on Discord
44
url: https://discord.gg/H5MNcFW63r
55
about: Join the yt-dlp Discord for community-powered support!
6+
- name: Matrix Bridge to the Discord server
7+
url: https://matrix.to/#/#yt-dlp:matrix.org
8+
about: For those who do not want to use Discord

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,9 @@ You can also fork the project on github and run your fork's [build workflow](.gi
379379
--proxy URL Use the specified HTTP/HTTPS/SOCKS proxy.
380380
To enable SOCKS proxy, specify a proper
381381
scheme. For example
382-
socks5://127.0.0.1:1080/. Pass in an empty
383-
string (--proxy "") for direct connection
382+
socks5://user:[email protected]:1080/. Pass in
383+
an empty string (--proxy "") for direct
384+
connection
384385
--socket-timeout SECONDS Time to wait before giving up, in seconds
385386
--source-address IP Client-side IP address to bind to
386387
-4, --force-ipv4 Make all connections via IPv4
@@ -1049,7 +1050,7 @@ You can configure yt-dlp by placing any supported command line option to a confi
10491050

10501051
1. **Main Configuration**: The file given by `--config-location`
10511052
1. **Portable Configuration**: `yt-dlp.conf` in the same directory as the bundled binary. If you are running from source-code (`<root dir>/yt_dlp/__main__.py`), the root directory is used instead.
1052-
1. **Home Configuration**: `yt-dlp.conf` in the home path given by `-P "home:<path>"`, or in the current directory if no such path is given
1053+
1. **Home Configuration**: `yt-dlp.conf` in the home path given by `-P`, or in the current directory if no such path is given
10531054
1. **User Configuration**:
10541055
* `%XDG_CONFIG_HOME%/yt-dlp/config` (recommended on Linux/macOS)
10551056
* `%XDG_CONFIG_HOME%/yt-dlp.conf`

test/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def sanitize_got_info_dict(got_dict):
220220
IGNORED_PREFIXES = ('', 'playlist', 'requested', 'webpage')
221221

222222
def sanitize(key, value):
223-
if isinstance(value, str) and len(value) > 100:
223+
if isinstance(value, str) and len(value) > 100 and key != 'thumbnail':
224224
return f'md5:{md5(value)}'
225225
elif isinstance(value, list) and len(value) > 10:
226226
return f'count:{len(value)}'

yt_dlp/YoutubeDL.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ class YoutubeDL(object):
484484
extractor_args: A dictionary of arguments to be passed to the extractors.
485485
See "EXTRACTOR ARGUMENTS" for details.
486486
Eg: {'youtube': {'skip': ['dash', 'hls']}}
487+
mark_watched: Mark videos watched (even with --simulate). Only for YouTube
487488
youtube_include_dash_manifest: Deprecated - Use extractor_args instead.
488489
If True (default), DASH manifests and related
489490
data will be downloaded and processed by extractor.
@@ -3504,7 +3505,7 @@ def render_formats_table(self, info_dict):
35043505
delim=self._format_screen('\u2500', self.Styles.DELIM, '-', test_encoding=True))
35053506

35063507
def render_thumbnails_table(self, info_dict):
3507-
thumbnails = list(info_dict.get('thumbnails'))
3508+
thumbnails = list(info_dict.get('thumbnails') or [])
35083509
if not thumbnails:
35093510
return None
35103511
return render_table(

yt_dlp/extractor/abc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def _real_extract(self, url):
300300
unescapeHTML(webpage_data).encode('utf-8').decode('unicode_escape'), show_id)
301301
video_data = video_data['route']['pageData']['_embedded']
302302

303-
highlight = try_get(video_data, lambda x: ['highlightVideo']['shareUrl'])
303+
highlight = try_get(video_data, lambda x: x['highlightVideo']['shareUrl'])
304304
if not self._yes_playlist(show_id, bool(highlight), video_label='highlight video'):
305305
return self.url_result(highlight, ie=ABCIViewIE.ie_key())
306306

yt_dlp/extractor/archiveorg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ class YoutubeWebArchiveIE(InfoExtractor):
440440
}, {
441441
'url': 'ytarchive:BaW_jenozKc:20050214000000',
442442
'only_matching': True
443-
},{
443+
}, {
444444
'url': 'ytarchive:BaW_jenozKc',
445445
'only_matching': True
446446
},

yt_dlp/extractor/litv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _extract_playlist(self, season_list, video_id, program_info, prompt=True):
6565
return self.playlist_result(all_episodes, content_id, episode_title)
6666

6767
def _real_extract(self, url):
68-
url, data = unsmuggle_url(url, {})
68+
url, smuggled_data = unsmuggle_url(url, {})
6969

7070
video_id = self._match_id(url)
7171

yt_dlp/extractor/orf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
unified_strdate,
2323
unsmuggle_url,
2424
url_or_none,
25-
urljoin,
2625
)
2726

2827

yt_dlp/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def _dict_from_options_callback(
345345
help=(
346346
'Use the specified HTTP/HTTPS/SOCKS proxy. To enable '
347347
'SOCKS proxy, specify a proper scheme. For example '
348-
'socks5://127.0.0.1:1080/. Pass in an empty string (--proxy "") '
348+
'socks5://user:pass@127.0.0.1:1080/. Pass in an empty string (--proxy "") '
349349
'for direct connection'))
350350
network.add_option(
351351
'--socket-timeout',

yt_dlp/postprocessor/metadataparser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def f(info):
6666
self.write_debug(f'Searching for {out_re.pattern!r} in {template!r}')
6767
match = out_re.search(data_to_parse)
6868
if match is None:
69-
self.report_warning(f'Could not interpret {inp!r} as {out!r}')
69+
self.to_screen(f'Could not interpret {inp!r} as {out!r}')
7070
return
7171
for attribute, value in match.groupdict().items():
7272
info[attribute] = value
@@ -80,7 +80,7 @@ def replacer(self, field, search, replace):
8080
def f(info):
8181
val = info.get(field)
8282
if val is None:
83-
self.report_warning(f'Video does not have a {field}')
83+
self.to_screen(f'Video does not have a {field}')
8484
return
8585
elif not isinstance(val, str):
8686
self.report_warning(f'Cannot replace in field {field} since it is a {type(val).__name__}')

0 commit comments

Comments
 (0)