{"id":17160185,"url":"https://github.com/obfusk/m","last_synced_at":"2025-04-13T14:09:11.714Z","repository":{"id":57442441,"uuid":"113498484","full_name":"obfusk/m","owner":"obfusk","description":"m - minimalistic media manager","archived":false,"fork":false,"pushed_at":"2018-10-01T15:23:18.000Z","size":210,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T14:08:51.027Z","etag":null,"topics":["kodi","media","mpv","pypi","shell","video","vlc"],"latest_commit_sha":null,"homepage":"https://obfusk.ch/m/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obfusk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.GPLv3","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-07T21:05:39.000Z","updated_at":"2022-07-30T15:38:32.000Z","dependencies_parsed_at":"2022-09-26T17:21:12.747Z","dependency_job_id":null,"html_url":"https://github.com/obfusk/m","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obfusk%2Fm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obfusk%2Fm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obfusk%2Fm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obfusk%2Fm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obfusk","download_url":"https://codeload.github.com/obfusk/m/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724630,"owners_count":21151561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kodi","media","mpv","pypi","shell","video","vlc"],"created_at":"2024-10-14T22:23:58.952Z","updated_at":"2025-04-13T14:09:11.692Z","avatar_url":"https://github.com/obfusk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- {{{1 --\u003e\n\n    File        : README.md\n    Maintainer  : Felix C. Stegerman \u003cflx@obfusk.net\u003e\n    Date        : 2018-09-16\n\n    Copyright   : Copyright (C) 2018  Felix C. Stegerman\n    Version     : v0.4.2\n    License     : GPLv3+\n\n\u003c!-- }}}1 --\u003e\n\n[![PyPI Version](https://img.shields.io/pypi/v/mmm.svg)](https://pypi.python.org/pypi/mmm)\n[![Build Status](https://travis-ci.org/obfusk/m.svg?branch=master)](https://travis-ci.org/obfusk/m)\n[![GPLv3+](https://img.shields.io/badge/license-GPLv3+-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)\n\n## Description\n\nm - minimalistic media manager\n\nm keeps track of which files you've played (or are still playing) and\nthus allows you to easily continue playing the next file (using vlc or\nmpv).\n\n* Supports importing existing playing/watched data from Kodi.\n* Stores its data in JSON files (one per directory) in `~/.obfusk-m`;\n  you can put this directory in git if you want a changelog :)\n\nNB: extracting the timestamp from the vlc config and mpv output is a\nlittle hacky :(\n\nNB: m uses `$PWD` to make sure it sees the current path the same as\nthe shell it is run from (i.e. it does not resolve the path by\nfollowing symlinks, allowing the link targets to be relocated);\nunfortunately, this means that it *does not* see two directories as\nidentical if they are accessed using different paths, even if the\nresolved path is the same.  So you may want to avoid using different\npaths to the same directory (and `--dir`).\n\n## Examples\n\n```bash\n$ cd /some/media/dir\n$ m ls    # list files ([*] = skip, [x] = done, [\u003e] = playing, [ ] = new)\n[x] Something - 01.mkv\n[x] Something - 02.mkv\n[x] Something - 03.mkv\n[x] Something - 04.mkv\n[x] Something - 05.mkv\n[x] Something - 06.mkv\n[\u003e] Something - 07.mkv 0:04:04\n[ ] Something - 08.mkv\n[ ] Something - 09.mkv\n$ m next  # plays current/next episode (i.e. #7) w/ vlc\n```\n\n```bash\n$ m ld    # list dirs (shows #playing, #new for indexed subdirectories)\n(   2!) Dir A\n(     ) Dir B\n(1\u003e 0!) Dir C\n(   0!) Dir D\n```\n\nCommands include: `list`/`ls`, `list-dirs`/`ld`, `list-all`/`la`,\n`next`, `play FILE`, `mark FILE`, `unmark FILE`, `skip FILE`, `index`,\n`playing`, `watched`, `skipped`, `todo`.\n\nSee also the tests in the source code (also available as `m examples`)\nfor more examples.\n\n### Command-line\n\nm is designed to work well with other command-line tools:\n\n```bash\n$ m --colour ld | column\n$ m --colour ls | tail\n$ cat \"$( m db-file )\" | jq .dir\n```\n\n## GUI\n\nIn situations where you prefer simple keybindings to typing on the\ncommand-line, you can use the [m-gui](https://github.com/obfusk/m-gui)\nwrapper.\n\n## Help\n\n```bash\n$ m --help      # global options \u0026 subcommands\n$ m ls --help   # subcommand (ls in this case) options \u0026 argument(s)\n$ m examples    # show some examples (from the tests)\n```\n\n## Requirements\n\nPython \u003e= 3.5.\n\n## Installing\n\nYou can just put `m.py` somewhere on your `$PATH` (in e.g. `~/bin`; I\nsuggest calling it `m`, but you're free to choose another name).\n\nYou may want to clone the repository instead of just downloading\n`m.py` to be able to get new versions easily.\n\nAlternatively, you can install m using pip (the Python package\nmanager) or build and install a Debian package.\n\nNB: the pip and Debian packages are called `mmm` instead of `m`.\n\n### Using git\n\n```bash\n$ cd /some/convenient/dir\n$ git clone https://github.com/obfusk/m.git obfusk-m\n$ cd ~/bin                  # or some other dir on your $PATH\n$ ln -s /some/convenient/dir/obfusk-m/m.py m\n```\n\nUpdating:\n\n```bash\n$ cd /some/convenient/dir/obfusk-m\n$ git pull\n```\n\n### Using pip\n\n```bash\n$ pip3 install --user mmm   # for Debian; on other OS's you may need\n                            # pip instead of pip3 and/or no --user\n```\n\n### Building a Debian package\n\n```bash\n$ sudo apt install debhelper dh-python pandoc # install build dependencies\n$ cd /some/convenient/dir\n$ git clone https://github.com/obfusk/m.git obfusk-m\n$ cd obfusk-m\n$ dpkg-buildpackage\n$ sudo dpkg -i ../mmm_*_all.deb\n```\n\n## Configuration File\n\nYou can set/override some defaults in `~/.obfusk-m/config.json`; for\nexample:\n\n```json\n{\n  \"add_exts\": [\".mp3\", \".ogg\"],\n  \"colour\": true,\n  \"exts\": [\".avi\", \".m4v\", \".mkv\", \".mp4\", \".ogv\", \".webm\"],\n  \"ignorecase\": true,\n  \"numbers\": true,\n  \"numeric_sort\": true,\n  \"only_indexed\": true,\n  \"player\": \"mpv\",\n  \"show_hidden\": true\n}\n```\n\n## TODO\n\n* update README + version (4x + dch) + package (deb + pip)!\n* `ack TODO`\n* debian Tag:?\n\n\u003c!-- --\u003e\n\n* use markdown for README now that pypi supports it\n  - as soon as I have wheel \u003e= 0.31.0 in Debian\n  - no need to build `README.rst`\n  - `setup.py`: `with_name(\"README.md\")`,\n    `long_description_content_type = \"text/markdown\"`\n\n\u003c!-- --\u003e\n\n* more file extensions!\n* document `safe()` vs `--zero`\n* `_pty_run`: also minimize output if not a tty?\n* fix `m _test` when run via wrapper (`m.MError` vs `MError`)?\n\n### Maybe\n\n* `m --virtual foo/bar {ls,...}` + `m virt [--update] [--title]*\n  [--url]* [--url-template] [--episodes] [--browser]` +\n  `VIRTUAL:/foo/bar` + `virt__*.json` + `m {watching,...}\n  --include-virtual`?\n\n\u003c!-- --\u003e\n\n* test edge cases/failures?\n* `--config-dir`?\n* test `END_SECS`?\n* note usage of dyn vars?\n\n\u003c!-- --\u003e\n\n* bash completion?\n* `m mv`?\n* `--tree` for `playing` etc.?\n* `--json`?\n* kodi db export/sync?\n* sign pypi package?\n* fix `.exist()` race conditions?\n* use `locale.strcoll` vs `--ignorecase`?\n\n## CAVEATS\n\nBecause the `alias` command uses symlinks internally, you should\nprobably not create symlinks named `dir__*.json` in `~/.obfusk-m`\nunless you know what you are doing.\n\n## License\n\n[![GPLv3+](https://www.gnu.org/graphics/gplv3-127x51.png)](https://www.gnu.org/licenses/gpl-3.0.html)\n\n\u003c!-- vim: set tw=70 sw=2 sts=2 et fdm=marker : --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobfusk%2Fm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobfusk%2Fm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobfusk%2Fm/lists"}