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