Giter Site home page Giter Site logo

alexanderrevo / switch-scripts Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 394 KB

Python scripts to help manage screenshots & recordings from Nintendo Switch.

License: Creative Commons Zero v1.0 Universal

Python 100.00%
automation library nintendo nintendo-switch organizer recordings screenshot screenshots switch videos

switch-scripts's Introduction

Summary

This repo has two scripts that will help you manage your screenshots and recording from your Switch:

  1. flatten_sdcard_album.py - will flatten directory structure of an album from the Switch SD card, and rename the files nicely.
  2. rename_files_from_usb.py - will just rename the files from an album copied via USB connection to your computer.

Table of contents

Disclaimer

These scripts are provided as-is. I am not responsible if they delete your data, or eat your homework, or whatever. Make backups before running the scripts and don't tell me I didn't warn you!

flatten_sdcard_album

Will move all the files from their respective subfolders into the Album folder and rename them in YYYY-MM-DD_HH-mm-SS format, keeping their original extensions.

Before

Album
├── 2021
│   ├── 10
│   │   ├── 17
│   │   │   └── 2021101719543700-9A9B6E0371D34263D6B6577F9CBA54D5.jpg
│   │   ├── 18
│   │   │   └── 2021101818513900-9A9B6E0371D34263D6B6577F9CBA54D5.jpg
│   │   └── 30
│   │       └── 2021103003173900-F1C11A22FAEE3B82F21B330E1B786A39.mp4
│   └── 11
│       └── 01
│           └── 2021110120055400-638E7E1EEC4CD8A239243633C0345A07.jpg
└── 2022
    ├── 01
    │   ├── 12
    │   │   └── 2022011216570800-12450B0C782F38E35EF964906DB929D1.jpg
    │   └── 19
    │       └── 2022011922010700-638E7E1EEC4CD8A239243633C0345A07.jpg
    └── 02
        ├── 12
        │   └── 2022021223244900-12450B0C782F38E35EF964906DB929D1.jpg
        └── 14
            └── 2022021420391800-12450B0C782F38E35EF964906DB929D1.mp4
Show me more!

All the files are nested deep inside multiple folders and are a pain to browse through. Also, the file names are hard to read, ew.

"before" directory structure animation

After

Album
├── 2021-10-17_19-54-37.jpg
├── 2021-10-18_18-51-39.jpg
├── 2021-10-30_03-17-39.mp4
├── 2021-11-01_19-37-51.jpg
├── 2021-11-01_19-58-22.jpg
├── 2021-11-01_20-05-54.jpg
├── 2022-01-12_16-57-08.jpg
├── 2022-01-19_22-01-07.jpg
├── 2022-02-12_23-24-49.jpg
└── 2022-02-14_20-39-18.mp4
Show me more!

All the files are in one folder and have readable names.

"after" directory structure screenshot

Usage

python flatten_sdcard_album.py <path_to_nintendo_album>

For example, assuming you have the script in your Downloads folder and your Switch album on your desktop:

python ~/Downloads/flatten_sdcard_album.py ~/Desktop/Album

rename_files_from_usb

Will rename the files in their respective subfolders into YYYY-MM-DD_HH-mm-SS<suffix> format, keeping their original extensions. It will keep the files in their respective subfolders, since Switch conveniently names those after the games when using the USB mode.

Before

Switch
├──  Breath of the Wild
│   └── 2021103003173900_c.mp4
├── Contra Anniversary Collection
│   ├── 2022021223244900_c.jpg
│   └── 2022021420391800_c.mp4
├── Metroid Dread
│   ├── 2021102519303600_c.jpg
│   ├── 2021102519440900_c.mp4
│   ├── 2021102519441100_c.jpg
│   └── 2021102519451000_c.jpg
├── Other
│   └── 2022021215590000_c.jpg
└── Ring Fit Adventure
    └── 2022011922010700_c.jpg

After

Switch
├──  Breath of the Wild
│   └── 2021-10-30_03-17-39_00_c.mp4
├── Contra Anniversary Collection
│   ├── 2022-02-12_23-24-49_00_c.jpg
│   └── 2022-02-14_20-39-18_00_c.mp4
├── Metroid Dread
│   ├── 2021-10-25_19-30-36_00_c.jpg
│   ├── 2021-10-25_19-44-09_00_c.mp4
│   ├── 2021-10-25_19-44-11_00_c.jpg
│   └── 2021-10-25_19-45-10_00_c.jpg
├── Other
│   └── 2022-02-12_15-59-00_00_c.jpg
└── Ring Fit Adventure
    └── 2022-01-19_22-01-07_00_c.jpg

Usage

python rename_files_from_usb.py <path_to_nintendo_album>

For example, assuming you have the script in your Downloads folder and your Switch album in a Switch folder on your desktop:

python ~/Downloads/rename_files_from_usb.py ~/Desktop/Switch

switch-scripts's People

Contributors

alexanderrevo avatar

Watchers

 avatar  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.