Python script to rename SportTorrents files to TSDB naming convention to appease SportScanner Plex agent for proper metadata parsing
**D i s c l a i m e r :**
- This script is not perfect. Im still working on the logic to get the matching more presice. But overall, it does a good job.
- Please double check your results and report back specific files that do not get named.
Requirments:
Python 3.0+
SETUP ENV:
pip install csv
pip install os
pip install re
HOW TO:
- Download: https://github.com/AcidAlchamy/Acids-SportTorrent-Renamer/archive/refs/heads/main.zip
- Extract somewhere
- Update Renamer.py with your actual Paths
- Open Command Prompt (or equal..)
- Type: "cd {Location of Acids-SportTorrent-Renamer}"
- Type: "python Renamer.py"
--Script should now be trying to match & rename your files in video_dir to the data in csv_dir
TheSportDB offers 3 styles of naming conventions to work along Plex and Kodi.
The script can extract either of the 3 naming conventions.
Simply edit the Renamer.py code and select your desired column to pull the new name from.
Request Data: To request .csv data for your specific desired league, please visit "https://thesportsdb.com/" and find your League, and send me a Pull Request with the League ID associated with the League. (i.e, https://thesportsdb.com/league/4380 - "4380" is the League ID for the NHL)
I will refresh the Data folder every few days.
Tools:
Organizer.py
- I made this script with the aim of automatically moving/Organizing files that were freshly renamed.
currently this script creates a folder for every league that TSDB covers...which...is 989 leagues or something...
Please be prepared for that! OR edit the code in Organizer.py to only handle the Leagues you like.
Instructions:
- Edit the code in Organizer.py and highlight
'J:
- Toggle Ctrl + H to "Replace"
-
Write new desired Drive letter/location.
-
Toggle Ctrl + Alt + Enter to Confirm replacement.
- Your Code should be updated:
For Sport Torrents, the most consistent naming convention to follow was provided by this twitter account @SportTorrents; this made the job of making a Renamer much "easier".