rlaphoenix / pynfogen Goto Github PK
View Code? Open in Web Editor NEWScriptable MediaInfo-fed NFO Generator for Movies and TV
License: MIT License
Scriptable MediaInfo-fed NFO Generator for Movies and TV
License: MIT License
Currently, it reads and writes files with the OS default text-encoding. It may be wanted to use a specific text-encoding for the output NFO file. Maybe not required for the description file though, as those would be shared to places where UTF-8 would be the norm.
This commonly occurs on the video track, as some people believe videos do not have language, yet they really do. Language can be defined by the on-screen text like the small credits that roll by at the start of the video, credits at the end of the video, signposts, letters, etc.
It's also common for media to have different masters per language, e.g. a lot of anime. Specifying one is always recommended.
I'm not suggesting the language check should be ignored, rather a helpful message should be printed when it occurs instead of crashing.
Traceback (most recent call last):
File "/home/user/.nfo/bin/nfo", line 8, in <module>
sys.exit(cli())
File "/home/user/.nfo/lib/python3.8/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/home/user/.nfo/lib/python3.8/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/home/user/.nfo/lib/python3.8/site-packages/click/core.py", line 1668, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/user/.nfo/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/user/.nfo/lib/python3.8/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/home/user/.nfo/lib/python3.8/site-packages/click/decorators.py", line 38, in new_func
return f(get_current_context().obj, *args, **kwargs)
File "/home/user/.nfo/lib/python3.8/site-packages/pynfogen/cli/generate.py", line 69, in generate
"videos_pretty": nfo.get_video_print(nfo.videos),
File "/home/user/.nfo/lib/python3.8/site-packages/pynfogen/nfo.py", line 209, in get_video_print
l1 = f"- {pycountry.languages.get(alpha_2=t.language).name}, {codec} " + \
File "/home/user/.nfo/lib/python3.8/site-packages/pycountry/db.py", line 41, in load_if_needed
return f(self, *args, **kw)
File "/home/user/.nfo/lib/python3.8/site-packages/pycountry/db.py", line 110, in get
raise LookupError()
LookupError
> nfo generate -tvdb 305074 -imdb tt5626028 My.Hero.Academia.S06E01.1080p.CR.WEB-DL.DDP2.0.H.264-GROUP.mkv episode 1 "My Hero Academia" 6
Traceback (most recent call last):
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\username\AppData\Local\Programs\Python\Python310\Scripts\nfo.exe\__main__.py", line 7, in <module>
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1626, in _process_result
value = ctx.invoke(self._result_callback, value, **ctx.params)
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\click\decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\pynfogen\cli\generate.py", line 122, in generator
nfo_txt = nfo.run(template_text, art=artwork_text, **template_vars)
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\pynfogen\nfo.py", line 116, in run
template = CustomFormats().format(template, **variables)
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\string.py", line 161, in format
return self.vformat(format_string, args, kwargs)
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\string.py", line 165, in vformat
result, _ = self._vformat(format_string, args, kwargs, used_args, 2)
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\string.py", line 205, in _vformat
obj, arg_used = self.get_field(field_name, args, kwargs)
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\string.py", line 278, in get_field
obj = obj[i]
TypeError: string indices must be integers
Without a DE/WM/GUI installed, the command xdg-open may not be available, hence the commands like nfo template explore
will fail.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.