By default this script searches through folders and files to try and extract the season/episode info from it(since some shows only have 000.avi in them)
You can run the script without any parameters except the -p, which specifies the folder in which the downloaded files are.
You can also skip reading from the config file and send in -n argument followed by a string to search for a specific value(supports comma separated values, ex: top gear, top.gear)
It reads all valid extensions from the 'config.json'(.avi, .mp4, etc)
When you send in the -n argument, it will try and get the key from config.json(top.gear and top gear has key Top Gear), if it doesn't find a key, it will create a key as Top.gear (the -n arg capitalized)
For more fine-grained results you can strip whitespace from string before searching, using -rw, for example if you want to search for "house", but don't want any "house of cards" results
You can let the script try and delete all directories that were moved that don't have any shows in them any more using -dAfter running the script, you are prompted to view the results, after viewing the results you are prompted again asking if you want to edit any of the results, removing any values you deem necessary, using comma-separated indices.(i.e. you got some values you were not expecting)
NOTE: When viewing results, first we show the index, then the old path, then the path where the show would go after accepting the results.
cleanup.py [-h] [-p PATH] [-s SHOWS_FOLDER] [-n NAME] [-rw] [-d]
EXAMPLES: note: (examples are all relative the the downloaded folder Hjaltmaster gave us)
- Searching for a specific value
- python cleanup.py -p "downloads" -n "klovn"
- Searching for a specific comma separated value
- python cleanup.py -p "downloads" -n "desperate housewives, dexter"
- Searching for a string and specifying a custom shows folder, TV Shows
-
python cleanup.py -p "downloads" -s "TV Shows" -n "the big bang theory"
- -p PATH, --path PATH The path of the downloads folder(i.e. "C:\Users\User\Downloads")
- -s SHOWS_FOLDER, --shows_folder SHOWS_FOLDER The path to put all the TV shows in(i.e. "E:\Shows"
- -n NAME, --name NAME Send in if you only want to look for a specific string, i.e "dexter", or "top gear, top.gear" (it supports comma separated values)
- -rw, --rm_ws Removes whitespace from string, can be useful when you want to search for "house" and not get any results from "House of Cards", since some House episode are in the format of "House.S03" or "House S03" then the regex check cannot differentiate between those values
- util.py: Reusable utility functions
- categorizer.py: The class that handles all the moving/creating/searching of shows
- cleanup.py: The script that takes in parameters and prompts the user
<dt>
Running default using <em>config.json</em>:
</dt>
<dd>
python cleanup.py -p "downloads"
<dt>
Searching for a specific string and stripping whitespace(since <em>house</em> can return <em>house of cards</em>):
</dt>
<dd>
python cleanup.py -p "downloads" -n "house" -rw
<dt>
Searching for a specific string and deleting all modern family directores if they have no files(.avi, .mp4, .mkv, etc) in the folder left:
</dt>
<dd>
python cleanup.py -p "downloads" -n "modern family" -d
<br><strong>This can add the ovearhead of a few seconds because it has to go through each folder iteratively to check if it contains no tv shows before deleting</strong>
</dd>
<br />
<dt>
Searching for comma separated values that are present in <em>config.json</em>
</dt>
<dd>
python cleanup.py -p "downloads" -n <em>top gear, top.gear, top_gear</em><br />
<strong>Warning: Sending in comma-separated values such as "dragons.den, dragons_den" will create a folder Dragons.den and Dragons_den, since they are not specified in <em>config.json</em> - but for <em>Top Gear</em>, only one folder
will be created because it extracts they key from the values(where top_gear, top.gear, top gear are the values, and <em>Top Gear</em> is key)</strong>
</dl>
<hr />
<h2>
Arguments:
<li>
-d, --delete Try to delete the directories we moved if they have no shows left
colorama: https://pypi.python.org/pypi/colorama