@@ -1,9 +1,12 @@
#!/usr/bin/env python3
+
+# Allow direct execution
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import yt_dlp
BASH_COMPLETION_FILE = "completions/bash/yt-dlp"
@@ -1,10 +1,14 @@
-import optparse
+import optparse
from yt_dlp.utils import shell_quote
@@ -1,11 +1,15 @@
-import codecs
-import subprocess
+import codecs
+import subprocess
from yt_dlp.aes import aes_encrypt, key_expansion
from yt_dlp.utils import intlist_to_bytes
@@ -1,4 +1,5 @@
import optparse
import re
@@ -1,4 +1,12 @@
+import os
+import sys
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@@ -7,7 +15,7 @@ def read(fname):
return f.read()
-# Get the version from yt_dlp/version.py without importing the package
+# Get the version without importing the package
def read_version(fname):
exec(compile(read(fname), fname, 'exec'))
return locals()['__version__']
@@ -1,12 +1,15 @@
-from inspect import getsource
+from inspect import getsource
NO_ATTR = object()
STATIC_CLASS_PROPERTIES = ['IE_NAME', 'IE_DESC', 'SEARCH_KEY', '_WORKING', '_NETRC_MACHINE', 'age_limit']
CLASS_METHODS = [
@@ -1,7 +1,11 @@
-# yt-dlp --help | make_readme.py
-# This must be run in a console of correct width
+"""
+yt-dlp --help | make_readme.py
+This must be run in a console of correct width
import functools
from yt_dlp.extractor import list_extractor_classes
import os.path
@@ -23,7 +24,7 @@ yt\-dlp \- A youtube-dl fork with additional features and patches
def main():
parser = optparse.OptionParser(usage='%prog OUTFILE.md')
- options, args = parser.parse_args()
+ _, args = parser.parse_args()
if len(args) != 1:
parser.error('Expected an output filename')
import subprocess
from datetime import datetime