Add script to create dummy media files by JonnyWong16 · Pull Request #1432 · pushingkarmaorg/python-plexapi
Description
Adds tools/plex-dummyfiles.py to create dummy files for testing with the proper Plex folder and file naming structure.
Examples
Movies
References:
- https://support.plex.tv/articles/naming-and-organizing-your-movie-media-files/
- https://support.plex.tv/articles/200381043-multi-version-movies/
- https://support.plex.tv/articles/multiple-editions/
Separators for --versions argument:
|= Movie part separator
> python tools/plex-dummyfiles.py movie --root "D:\Movies" --title "Blade Runner" --year 1982 D:\Movies\ ├─ Blade Runner (1982)\ │ ├─ Blade Runner (1982).mp4 > python tools/plex-dummyfiles.py movie --root "D:\Movies" --title "Batman Begins" --year 2005 --tmdb 272 D:\Movies\ ├─ Batman Begins (2005) {tmdb-272}\ │ ├─ Batman Begins (2005) {tmdb-272}.mp4 > python tools/plex-dummyfiles.py movie --root "D:\Movies" --title "Blade Runner" --year 1982 --edition "Director's Cut" D:\Movies\ ├─ Blade Runner (1982) {edition-Director's Cut}\ │ ├─ Blade Runner (1982) {edition-Director's Cut}.mp4 > python tools/plex-dummyfiles.py movie --root "D:\Movies" --title "The Dark Knight" --year 2008 --versions "|2" D:\Movies\ ├─ The Dark Knight (2008)\ │ ├─ The Dark Knight (2008) - pt1.mp4 │ ├─ The Dark Knight (2008) - pt2.mp4 > python tools/plex-dummyfiles.py movie --root "D:\Movies" --title "Pulp Fiction" --year 1994 --versions "1080p|2" --versions "SD" D:\Movies\ ├─ Pulp Fiction (1994)\ │ ├─ Pulp Fiction (1994) - 1080p - pt1.mp4 │ ├─ Pulp Fiction (1994) - 1080p - pt2.mp4 │ ├─ Pulp Fiction (1994) - SD.mp4 > python tools/plex-dummyfiles.py movie --root "D:\Movies" --title "Blade Runner" --year 1982 --edition "Director's Cut" --versions "1080p.h264" --versions "1080p.hvec" --versions "4k.h264" --versions "4k.hevc" D:\Movies\ ├─ Blade Runner (1982) {edition-Director's Cut}\ │ ├─ Blade Runner (1982) - 1080p.h264 {edition-Director's Cut}.mp4 │ ├─ Blade Runner (1982) - 1080p.hvec {edition-Director's Cut}.mp4 │ ├─ Blade Runner (1982) - 4k.h264 {edition-Director's Cut}.mp4 │ ├─ Blade Runner (1982) - 4k.hevc {edition-Director's Cut}.mp4
TV Shows
References:
Separators for --seasons and --episodes arguments:
,= Season/episode list separator-= Season/episode range separator+= Episode stack separator|= Episode part separator
> python tools/plex-dummyfiles.py show --root "D:\TV Shows" --title "The Office (US)" --year 2005 --tvdb 73244 --seasons 1 --episodes "1-3,6-8" D:\TV Shows\ ├─ The Office (US) (2005) {tvdb-73244}\ │ ├─ Season 01\ │ │ ├─ The Office (US) (2005) - S01E01.mp4 │ │ ├─ The Office (US) (2005) - S01E02.mp4 │ │ ├─ The Office (US) (2005) - S01E03.mp4 │ │ ├─ The Office (US) (2005) - S01E06.mp4 │ │ ├─ The Office (US) (2005) - S01E07.mp4 │ │ ├─ The Office (US) (2005) - S01E08.mp4 > python tools/plex-dummyfiles.py show --root "D:\TV Shows" --title "Doctor Who" --year 1963 --seasons "1-3" --episodes "1-3" D:\TV Shows\ ├─ Doctor Who (1963)\ │ ├─ Season 01\ │ │ ├─ Doctor Who (1963) - S01E01.mp4 │ │ ├─ Doctor Who (1963) - S01E02.mp4 │ │ ├─ Doctor Who (1963) - S01E03.mp4 │ ├─ Season 02\ │ │ ├─ Doctor Who (1963) - S02E01.mp4 │ │ ├─ Doctor Who (1963) - S02E02.mp4 │ │ ├─ Doctor Who (1963) - S02E03.mp4 │ ├─ Season 03\ │ │ ├─ Doctor Who (1963) - S03E01.mp4 │ │ ├─ Doctor Who (1963) - S03E02.mp4 │ │ ├─ Doctor Who (1963) - S03E03.mp4 > python tools/plex-dummyfiles.py show --root "D:\TV Shows" --title "Grey's Anatomy" --year 2005 --seasons 0 --episodes 1 --seasons 1 --episodes "1|2,2-3" --seasons 2 --episodes "1+3,4" D:\TV Shows\ ├─ Grey's Anatomy (2005)\ │ ├─ Season 00\ │ │ ├─ Grey's Anatomy (2005) - S00E01.mp4 │ ├─ Season 01\ │ │ ├─ Grey's Anatomy (2005) - S01E01 - pt1.mp4 │ │ ├─ Grey's Anatomy (2005) - S01E01 - pt2.mp4 │ │ ├─ Grey's Anatomy (2005) - S01E02.mp4 │ │ ├─ Grey's Anatomy (2005) - S01E03.mp4 │ ├─ Season 02\ │ │ ├─ Grey's Anatomy (2005) - S02E01-E03.mp4 │ │ ├─ Grey's Anatomy (2005) - S02E04.mp4
Type of change
Please delete options that are not relevant.
- New feature (non-breaking change which adds functionality)
Checklist:
- My code follows the style guidelines of this project
- I have performed a self-review of my own code
- I have commented my code, particularly in hard-to-understand areas
- I have added or updated the docstring for new or existing methods
- I have added tests when applicable