{"id":13910699,"url":"https://github.com/vpistis/OrganizeMediaFiles","last_synced_at":"2025-07-18T09:32:34.706Z","repository":{"id":15034006,"uuid":"77486129","full_name":"vpistis/OrganizeMediaFiles","owner":"vpistis","description":"a collection of Python scripts that help you organize media files into a directory tree \"year/month\" based on metadata , using exiftool","archived":false,"fork":false,"pushed_at":"2023-06-01T09:51:10.000Z","size":102,"stargazers_count":30,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-08T00:44:00.057Z","etag":null,"topics":["exiftool","nextcloud","organize-media-files","python","python-script","sort-images","sort-media-files","sort-photos","sort-videos","utilities","utils","video"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vpistis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-27T22:26:03.000Z","updated_at":"2024-02-29T21:17:05.000Z","dependencies_parsed_at":"2022-08-28T10:01:37.627Z","dependency_job_id":null,"html_url":"https://github.com/vpistis/OrganizeMediaFiles","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpistis%2FOrganizeMediaFiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpistis%2FOrganizeMediaFiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpistis%2FOrganizeMediaFiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpistis%2FOrganizeMediaFiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vpistis","download_url":"https://codeload.github.com/vpistis/OrganizeMediaFiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226388705,"owners_count":17617320,"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":["exiftool","nextcloud","organize-media-files","python","python-script","sort-images","sort-media-files","sort-photos","sort-videos","utilities","utils","video"],"created_at":"2024-08-07T00:01:42.751Z","updated_at":"2024-11-25T19:31:43.105Z","avatar_url":"https://github.com/vpistis.png","language":"Python","readme":"# OrganizeMediaFiles Alpha\n\nThis project is a collection of Python scripts that help to organize media\nfiles into a directory tree \"year/month\" based on file metadata, using [exiftool](https://exiftool.org/)\n\nUsed by me into my personal [Nextcloud](https://www.nextcloud.com) installation to organize unsorted files.\nStrongly inspired by: https://github.com/OneLogicalMyth/Random-Scripts/blob/master/NextCloud/SortPictures.py\n\n**Tested with Linux/Debian and MacOS python 2 and 3**\n\n**ATTENTION alpha version backup your files before use!**\n\nThis picture describe the final result:\n![final result](final_result.png)\n\n## Features\n\n+ manages duplicate files due to milliseconds difference (the new file uses the same old name).\n+ support all file types supported by [exiftool](https://exiftool.org/)\n+ proccess video and photo at same time (see `config.json`)\n+ if exists, add sub second time original (fraction of seconds) to file name\n\n## Getting OrganizeMediaFiles:\n\nClone the repository: `git clone https://github.com/vpistis/OrganizeMediaFiles.git`.\nAlternatively download [tarball](https://github.com/vpistis/OrganizeMediaFiles/tarball/master)\nor [zip](https://github.com/vpistis/OrganizeMediaFiles/archive/master.zip). There haven't been any releases yet.\n\n## Installation\n\nNo installation required, it's a simple python script :) It run in `python`.\n\n## Requirements\n\nIn order to use the script, is necessary install at least [exiftool](https://exiftool.org/).\nAlso install all `requirements.txt`\n\n### Debian based\n\n`sudo apt-get install exiftool`\n\n### MacOS\n\n`brew install exiftool`\n\n## Usage\n\n### Step 1: configuration\n\nConfigure using `config.json`\n\n### Step 2: run\n\n`python organize_media_files.py`\n\n## Configuration\n\n**Important**: process only photo/video files with specified extensions.\nUse the `config.json` to change paths and other stuff.\n\n**All paths are intended without any escaping char,like backslashes**\n\n### LOG_LEVEL\n\nDefault: `\"LOG_LEVEL\": \"INFO\"`\nLog files are in the source directory\n\n### LOG_PATH\n\nDefault: `\"LOG_DIR\": \"/tmp\"`.\nIf not specified use this directory. If you cannot write into this path, maybe the best choice is to use `/tmp`\n\n### RENAME_SORTED_FILES\n\nDefault: `\"RENAME_SORTED_FILES\": false`.\nIf `true` rename sorted files according to metadata creation time.\nSee `DATE_FORMAT_OUTPUT` for the name of new file.\n\n### REMOVE_OLD_FILES\n\nDefault: `\"REMOVE_OLD_FILES\": false`.\nIf `true` delete old file after creation of new processed file.\n\n### APPEND_ORIG_FILENAME\n\nDefault: `\"APPEND_ORIG_FILENAME\": false`.\nIf `true` append the original file name at the end of new created file.\n\n### REMOVE_SPACE_FROM_FILENAME\n\nDefault: `\"REMOVE_SPACE_FROM_FILENAME\": true`.\nSometimes some space remains into filename, i want to replace it with underscores: `_`\n\n### DATE_FORMAT_OUTPUT\n\nDefault: `\"DATE_FORMAT_OUTPUT\": \"%Y%m%d_%H%M%S\"`.\nThe date output string in python used to name the new created file.\nUsed only if `RENAME_SORTED_FILE=true`.\n\n### PROCESS_IMAGES\n\nDefault: `\"PROCESS_IMAGES\": true`.\nIf `true` process image files according to the `IMAGE_FILES_EXTENSIONS`.\n\n### IMAGE_FILENAME_SUFFIX\n\nDefault: `\"IMAGE_FILENAME_SUFFIX\": \"IMG_\"`.\nPrepend this string to the new created file name.\n\n### IMAGES_SOURCE_PATH\n\nDefault: `\"IMAGES_SOURCE_PATH\": \"/media/drivemount/user/files/FilesToSort\"`.\nThe path where original image files are stored.\n\n### IMAGES_DESTINATION_PATH\n\nDefault: `\"IMAGES_DESTINATION_PATH\": \"/media/drivemount/user/files/FilesSorted\"`.\nThe root path where store the new organized image files.\n\n### IMAGE_FILES_EXTENSIONS\n\nDefault: `\"IMAGE_FILES_EXTENSIONS\": [\".jpg\",\".gif\",\".tiff\"]`.\nFiles with these extensions are processed as images (NOTE: exiftool support internally many file types, and the command\nused in this script is the same for images/videos)\n\n### PROCESS_VIDEOS\n\nDefault: `\"PROCESS_VIDEOS\": false`.\nIf `true` process video files according to the `VIDEO_FILES_EXTENSIONS`.\n\n### VIDEO_FILENAME_SUFFIX\n\nDefault: `\"VIDEO_FILENAME_SUFFIX\": \"VID_\"`.\nPrepend this string to the new created file name.\n\n### VIDEOS_SOURCE_PATH\n\nDefault: `\"VIDEOS_SOURCE_PATH\": \"/media/drivemount/user/files/FilesToSort\"`\nThe path where original video files are stored.\n\n### VIDEOS_DESTINATION_PATH\n\nDefault: `\"VIDEOS_DESTINATION_PATH\": \"/media/drivemount/user/files/FilesSorted\"`.\nThe root path where store the new organized video files.\n\n### VIDEO_FILES_EXTENSIONS\n\nDefault: `\"VIDEO_FILES_EXTENSIONS\": [\".mp4\",\".3gp\"]`.\nFiles with these extensions are processed as videos see [IMAGE_FILES_EXTENSIONS](#image_files_extensions) note.\n\n### NEXTCLOUD\n\nDefault: `\"NEXTCLOUD\": false`.\nIf `true` exec nextcloud command to rescan data directory for new files.\n\n### NEXTCLOUD_PATH\n\nDefault: `\"NEXTCLOUD_PATH\": \"/var/www/html/nextcloud\"`.\nThe path of nextcloud installation.\n\n### NEXTCLOUD_USER\n\nDefault: `\"NEXTCLOUD_USER\": \"www-data\"`\nLaunch nextcloud scan command as a `\"NEXTCLOUD_USER\"`.\n\n# LICENSE\n\nMIT License\n\nCopyright (c) 2017-2023 Valentino Pistis\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpistis%2FOrganizeMediaFiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvpistis%2FOrganizeMediaFiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpistis%2FOrganizeMediaFiles/lists"}