Giter VIP home page Giter VIP logo

tgcrename's Introduction

About

If you're like me and working on a headless machine with a PLEX server installed, you've probably had to do a bunch of commands like:

for i in *; do echo "FILE: $i" && mv "$i" "echo "$i" | sed 's/.*lecture-//g'"; done

and again and again until you got the TGC course video files named corretly. Well, I got tired of doing this so I wrote a shell and perl script to do all the work for us.

TGCrename2.0.sh is a bulk TGC course renamer. TGCrename.sh is deprecated at this time as TGCrename2.0.sh handles single courses or a bulkfile list.

These three files:

  • AllTGC_TItlesandCNonly.csv - All TGC course names and numbers separated by '['.
  • levenstein.pl - A fuzzy matching algorithm written in PERL.
  • TGCrename.sh - The brain (or heart) of it all.

will use the data in the directory name to find the best course match and will rename all the multimedia files to an appropriate name that the TGC.bundle Agent can then use to collect metadata.

Usage

./TGCrename2.0.sh y_option [bulkfile]

There are two options that can be used:

-y , Trust TGCrename2.0.shto automatically rename all the files, but will prompt for acceptance of matching course.

-yy , Fully trust TGCrename2.0.shto do everything for you. i.e., it finds the correct course and names all the files correctly.

If you just run:

./TGCrename2.0.sh

it will show a usage menu

If you run:

./TGCrename2.0.sh -y

It will prompt for acceptance of the course name and will use that data to automatcially rename the files.

if you run: (not recommnded)

./TGCrename2.0.sh -yy

It won't prompt you for any acceptance and will use the data collected to automatically rename the files. This means you are fully trusting the program. (It tends to work 52% of the time, but it's up to you what level of trust you would like).

if you run:

./TGCrename2.0 -y /home/bubonic/tgcfiles

where tgcfiles is a text file of directors containing your TGC lectures like the following:

/home/bubonic/Downloads/TheGreatCourses/TTC - Great Music of the Twentieth Century
/home/bubonic/Downloads/TheGreatCourses/TTC - Law School for Everyone
/home/bubonic/Downloads/TheGreatCourses/TTC - Radio Astronomy
/home/bubonic/Downloads/TheGreatCourses/TTC - The Great Trials of World History
/home/bubonic/Downloads/TheGreatCourses/TTC - The Rise of Rome
/home/bubonic/Downloads/TheGreatCourses/TTC - Understanding Imperial China
/home/bubonic/Downloads/TheGreatCourses/TTC - Why You Are Who You Are

It will prompt for verification of the course found and rename all those found in the tgcfiles file.

tgcrename's People

Contributors

bubonic avatar

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.