7 with open(fname
, encoding
='utf-8') as f
:
11 # Get the version from yt_dlp/version.py without importing the package
12 def read_version(fname
):
13 exec(compile(read(fname
), fname
, 'exec'))
14 return locals()['__version__']
18 parser
= optparse
.OptionParser(usage
='%prog INFILE OUTFILE')
19 options
, args
= parser
.parse_args()
21 parser
.error('Expected an input and an output filename')
23 infile
, outfile
= args
24 with open(outfile
, 'w', encoding
='utf-8') as outf
:
26 read(infile
) % {'version': read_version('yt_dlp/version.py')}
)
29 if __name__
== '__main__':