mirror of
https://source.perfectable.org/nivertius/napi.git
synced 2025-07-02 02:54:31 +02:00
Allow forcing filename
This commit is contained in:
parent
5ebd56a3fb
commit
246bc01971
1 changed files with 3 additions and 1 deletions
4
napi
4
napi
|
@ -24,6 +24,8 @@ default_language = "PL"
|
||||||
parser = argparse.ArgumentParser(description='Searches subtitles for movies from napiproject')
|
parser = argparse.ArgumentParser(description='Searches subtitles for movies from napiproject')
|
||||||
parser.add_argument('-l', '--language', dest='language', default=default_language,
|
parser.add_argument('-l', '--language', dest='language', default=default_language,
|
||||||
help='requested subtitle language')
|
help='requested subtitle language')
|
||||||
|
parser.add_argument('-f', '--filename', dest='filename',
|
||||||
|
help='forced filename')
|
||||||
parser.add_argument('movies', metavar='movie', nargs='+',
|
parser.add_argument('movies', metavar='movie', nargs='+',
|
||||||
help='movie for which to find subtitles')
|
help='movie for which to find subtitles')
|
||||||
|
|
||||||
|
@ -68,7 +70,7 @@ for movie_filename in args.movies:
|
||||||
decoded_content = base64.b64decode(content)
|
decoded_content = base64.b64decode(content)
|
||||||
with open(input_filename, "wb") as input_file:
|
with open(input_filename, "wb") as input_file:
|
||||||
input_file.write(decoded_content)
|
input_file.write(decoded_content)
|
||||||
subtitle_filename = movie_filename[:-4] + ".srt"
|
subtitle_filename = args.filename or movie_filename[:-4] + ".srt"
|
||||||
|
|
||||||
executed = [
|
executed = [
|
||||||
'7z', # executable
|
'7z', # executable
|
||||||
|
|
Loading…
Add table
Reference in a new issue