Skip to content

A CLI app for sorting, downloading posters and gathering information about Movies/Series.

License

Notifications You must be signed in to change notification settings

pwdz/go-videoSorter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-videoSorter

go-videoSorter is a CLI applications for sorting, downloading posters and gathering information about Movies/Series.

Contents

Overview
Installation
Sort
Download Image
Searching for Information

Overview

go-videoSorter is written using Cobra library and uses OMDB API in order to fetch data about movies/series and can download posters and create text files containing information aboud movies/series. Infos such as Writer, Actors, Awards and more.

At first I wanted to sort videos based on each video's metadata. But it could take quite a while since reading each file could take a second or two. Also in some cases, metadatas didn't contain usful information such as title of the video which is the base resource for sorting.
Hence I turned to videoNames for sorting.

Installation

Sort

sort command, sorts all the videos existing in the given source directory and all of its subdirectories base on the video title and if series, also seasons and episodes.
It works based on video names, so in case of irrelevant video naming, sorting series might not work properly.
so it is NOT completely safe yet, though I tried to cover as many renamings as possible(in almost 200 samples of videos, I found 8 videos with misordered foldering)

The sort result, if destinationDir given, will be in destionationDir/GoVideoSort/ if not, will be in sourceDir/GoVideoSort/.

sort command has the following optional flags:

--dlImage/-d Downloads poster of each go-videoSorter automatically while sorting and places it under the folder of the sorted video.
--createTxt/-c Creates a text file which has information about the go-videoSorter.

An example of directory tree before and after sort using both flags.
Before sort:

SourceDir
├── code.java
├── ...
├── temp1
|   └── abc                   
|       └── Silicon.Valley.S01E01.BDRip.x264-DEMAND.mkv  
├── temp2 
│   ├── 1917.2019.720p.DVDScr.Farsi.Dubbed.mkv           
│   ├── temp3  
│   │   ├── Se7en.1995.1080p.Farsi.Dubbed.mkv 
|   |   └── Friends.S01E04.720p.mkv
│   ├── Friends.1.2.480p.mkv
│   └── Friends.S01.E03.480p.mkv 
├── ...
└── Friends.1x1.480p.mkv

After sort:

destinationDir
└── GoVideoSort
    ├── Movies
    |   ├── 1917 (2019)
    |   |   ├── 1917.2019.720p.DVDScr.Farsi.Dubbed.mkv  
    |   |   ├── 1917.jpg
    |   |   └── 1917.txt
    |   └── Se7en (1995)
    |       ├── Se7en.1995.1080p.Farsi.Dubbed.mkv
    |       ...
    └── Series
        ├── Friends
        |   ├── Season1
        |   |   ├── E1
        |   |   |   └── Friends.1x1.480p.mkv
        |   |   ...
        |   ├── Friends.jpg
        |   └── Friends.txt
        └── Silicon Valley
            ├── ...
            ...

For example for movie 1917, using --dlImage/-d will place 1917.jpg under 1917/ folder:
1917

Also using --createTxt/-c will place 1917.txt by this format under 1917/

https://github.com/pwdz 
============O_o============
Title: 1917
Year: 2019
IMDB: 8.4
Metascore: 78
Genre: Drama, War
Type: movie
Writer: Sam Mendes, Krysty Wilson-Cairns
Actors: Dean-Charles Chapman, George MacKay, Daniel Mays, Colin Firth
Plot: April 6th, 1917. As a regiment assembles to wage war deep in enemy territory, two soldiers are assigned to race     against time and deliver a message that will stop 1,600 men from walking straight into a deadly trap.
Language: English, French, German
Awards: Won 3 Oscars. Another 108 wins & 158 nominations.
Poster: https://m.media-amazon.com/images/M/MV5BOTdmNTFjNDEtNzg0My00ZjkxLTg1ZDAtZTdkMDc2ZmFiNWQ1XkEyXkFqcGdeQXVyNTAzN    zgwNTg@._V1_SX300.jpg
Country: USA, UK, India, Spain, Canada
============o_O============

NOTICE: Using flags will result in calling API so sort process depending on the count of the existing videos would take some time.

sort command usage:

govideo sort sourceDirectory [DestinationDirectory] [--dlImage/-d][--createTxt/-c]

Download Image

download command can be used in two ways, first by the [videoName --video/-v] and second by giving it the URL of any image after download it will place it under destionationDir.
download command usage:

govideo download destinationDir [videoName --video/-v]/[URL]

Searching for Information

search command finds the info of the given videoName and prints the results. If destinationDir given, besides printing results, text files of the results will be created under destionationDir.
If using --search/-s, it will search for all the movies and series that contain the given videoName.

search result will be just like the 1917.txt example above.

search command usage:

govideo search videoName [destonationDir] [--search/-s]

About

A CLI app for sorting, downloading posters and gathering information about Movies/Series.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages