Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Video file management CLI tool that parses ill-formed media file names, looks up movie and episode metadata, subtitles, and other attributes, and outputs a singular media file using a user-defined file hierarchy.

License

NotificationsYou must be signed in to change notification settings

src-run/serferals

Repository files navigation

Welcome! Thesrc-run/serferals package provides a CLI application for looking-upand organizing media files, with support for movies and TV episodes.

The following list shows the name of the input files to the left of the output paths this script would move them to onthe right.

Stranger Things S01E01.mkv -> tv/Stranger Things (2016)/Season 01/Stranger Things (2016) [S01E01] Chapter One: The Vanishing Of Will Byers.mkvstranger_things_s01e02.mkv -> tv/Stranger Things (2016)/Season 01/Stranger Things (2016) [S01E02] Chapter Two: The Weirdo on Maple Street.mkv3:10-To-Yuma-720p-2007.mkv -> movie/3:10 to Yuma (2007)/3:10 to Yuma (2007) [5176].mkv

This behavior is especially useful for media servers such asPlex that require theirlibrary files follow specific naming conventions. It is also useful for those with OCD-tendencies who require theirarchive of media to be properly and consistently named.

Customization

The output file path formats can be easily customized by overwriting the default templates in theparameters.ymlconfiguration file. The default template for TV episodes is the following.

tv/{{name|raw }}{%ifyearisdefined %} ({{year }}){%endif %}/Season {{season }}/{{name|raw }}{%ifyearisdefined %} ({{year }}){%endif %} [S{{season }}E{{start }}{%ifendisdefined %}-{{end }}{%endif %}]{%iftitleisdefined %} {{title|raw }}{%endif %}.{{ext }}

You may recognize the template syntax asTwig, a widely used template engine in manyweb frameworks (such asSymfony,Drupal, and others). While its usein this project may be a bit of a "sledge hammer approach", it also means that customizing the output file paths is easyand straightforward to anyone who's worked with any modern web template language. To further exemplify the simplicityof this approach, take a look at the same template as above, but re-formatted with newlines for clarity and displayingthe output of each statement in the right-hand side comments, given the following input fileStranger Things (2016) [S01E01] Chapter One: The Vanishing Of Will Byers.mkv.

tv/                           # tv/  {{name|raw }}              # Stranger Things  {%ifyearisdefined %}    # <true>    ({{year }})              # (2016)  {%endif %}  /Season {{season }}/       # Season 01/  {{name|raw }}              # Stranger Things  {%ifyearisdefined %}    # <true>    ({{year }})              # (2016)  {%endif %}  [                           # [    S{{season }}             # S01    E{{start }}              # E01    {%ifendisdefined %}   # <false>      -{{end }}    {%endif %}  ]                           # ]  {%iftitleisdefined %}   # <true>    {{title|raw }}           # Chapter One: The Vanishing Of Will Byers  {%endif %}  .{{ext }}                  # .mkv

JTT

This package represents a single project within alarge collection of open-source codereleased under theSR namespace, comprised of framework-agnostic libraries, and a number of Symfony bundles. Theseprojects are authored and maintained byRob Frawley 2nd andcollaborators.

Quick Start

Basic Usage Video

Serferals basic usage example

Installation

Before beginning, ensure you have created an account and requested a free API key fromThe Movie DB website. Once you have an API key, take note of it and enter it whenprompted by themake script.

Note: For the installation to complete successfully,PHAR archive writing must not be disabled. To find thelocation of your configuration file, runphp -i | grep "Loaded Configuration File". Edit yourphp.ini file,ensuring the variablephar.readonly is uncommented and assigned the valueOff.

git clone https://github.com/robfrawley/serferals.git&&cd serferals./make

If installation completes without error, the final line of output will be the version string of the serferals command.

src-run/serferals version 2.2.3 by Rob Frawley 2nd <rmf@src.run> (69975c3)

Troubleshooting

If you experience issues with the installer script, debug mode can be enabled by defining a bash variable when callingmake.

SERFERALS_DEBUG=true ./make

Additionally, you can enable "clean installation" mode, which ensures all dependencies and helper PHARs (Composer, Box)are forcefully re-fetched.

SERFERALS_CLEAN=true ./make

Moreover, you can enable "pristine installation" mode, which forces removal and re-creation of configuration files aswell as enables everything from "clean installation" mode.

SERFERALS_PRISTINE=true ./make

Lastly, all the above mentioned environment variables can be passed in any combination.

SERFERALS_DEBUG=true SERFERALS_PRISTINE=true ./make

Note: All troubleshooting variables are only checked to see if they are defined or undefined; they are not checkedfor a specific value.Their value is irrelevant. CallingSERFERALS_DEBUG=false ./make will enable "debug mode"because the variable is defined.

Installation Video

Serferals installation video

Reference

My prefered CLI usage includes the-vvv and-s options, enabling verbose output and the "smart overwrite" feature.

serferals -vvv -s -o /output/path /input/path/foo [...] /input/path/bar

The only required option is the output path (-o|--output-path). At least one input path must be provided as an argument,though you can specify multiple inputpaths if required.

serferals --output-path=/output/path /input/path [...]

Contributing

Discussion

For general inquiries or to discuss a broad topic or idea, find "robfrawley" on Freenode. He is always happy todiscuss language-level ideas, possible new directions for a project, emerging technologies, as well as the weather.

Issues

To report issues or request a new feature, use theproject issue tracker.Include as much information as possible in any bug reports. Feel free to "ping" the topic if you don't get a responsewithin a few days (sometimes Github notification e-mails fall through the cracks).

Code

You created additional functionality while utilizing this package? Wonderful: send it back upstream!Don't hesitate tosubmit a pull request! Yourimagination and the requirements outlined withinourCONTRIBUTING.md file are the only limitations.

License

This project is licensed under theMIT License, anFSF- andOSI-approved,GPL-compatible, permissive free software license.Review theLICENSE file distributed with this source code for additionalinformation.

API Usage

PThe Movie Database

Serferals episode and movie lookup powered byThe Movie DatabaseAPI.

About

Video file management CLI tool that parses ill-formed media file names, looks up movie and episode metadata, subtitles, and other attributes, and outputs a singular media file using a user-defined file hierarchy.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp