1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 08:35:32 +00:00

Add option --netrc-cmd (#6682)

Authored by: NDagestad, pukkandan
Closes #1706
This commit is contained in:
Nicolai Dagestad
2023-06-21 05:07:42 +02:00
committed by GitHub
parent af7585c824
commit db3ad8a676
6 changed files with 58 additions and 28 deletions

View File

@ -25,6 +25,7 @@ import json
import locale
import math
import mimetypes
import netrc
import operator
import os
import platform
@ -864,6 +865,13 @@ def escapeHTML(text):
)
class netrc_from_content(netrc.netrc):
def __init__(self, content):
self.hosts, self.macros = {}, {}
with io.StringIO(content) as stream:
self._parse('-', stream, False)
def process_communicate_or_kill(p, *args, **kwargs):
deprecation_warning(f'"{__name__}.process_communicate_or_kill" is deprecated and may be removed '
f'in a future version. Use "{__name__}.Popen.communicate_or_kill" instead')