GithubHelp home page GithubHelp logo

rlaphoenix / pynfogen Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 5.0 375 KB

Scriptable MediaInfo-fed NFO Generator for Movies and TV

License: MIT License

Python 100.00%
generator mediainfo nfo python scriptable

pynfogen's People

Contributors

dependabot[bot] avatar rlaphoenix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pynfogen's Issues

Ability to choose output text-encoding

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.

LookupError exception if a track has no language tag, or an invalid tag

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

TypeError: string indices must be integers

> 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.