renaming-youtube-dl-videos icon indicating copy to clipboard operation
renaming-youtube-dl-videos copied to clipboard

Script used to organize your video library downloaded with youtube-dl and make it parseable by media centers.

rename-youtube-dl-videos.sh

Script used to organize your video library downloaded with youtube-dl and make it parseable by media centers.
It parses the metadata file (video_name.info.json) to rename the video as SxxEyy - video_name:

  • xx the year index (01 for the year this first channel's video was uploaded)
  • yy the video index (01 for the first video uploaded this year on the channel)

Each season is thus composed of all the videos released per year.

Prerequisites

  • jq
  • bash v4.0 minimum

Installation

  • Clone the repo
  • chmod +x rename_videos.sh
  • Execute the script in your Videos folder

Usage

When downloading videos with youtube-dl, the flag write-info-json is necessary.
The script rename_videos.sh then has to be executed in the video library folder. It will check each subdirectories for *.info.json files. When it finds some, it will extract all uploading dates with jq and rename the files given this information.

Contributing

Do not hesitate to create an issue to spark discussion or submit a PR if you see an improvement that needs to be made!

License

License: GPL v3