snblog

Read my ramblings about computers, Linux, math, video games and other interests/hobbies.

PS Vita Screenshot Transferring

Jul 18, 2025 - 5 minute read - CATEGORIES: Video Games Programming

I take a lot of screenshots on my PS Vita but transferring them over to my computer is a bit of a hassle for a few reasons. Sony’s CMA is not available on Linux, and QCMA (which is on Linux) is a bit janky, so neither of those are viable options for me. What I have to do is manually grab the screenshots from the Vita’s filesystem.

However, a USB connection to the Vita or directly inserting its SD card into my computer doesn’t work for me, so I’m left with the world’s fastest file-transfer protocol: FTP1! But that aside, the biggest hassle when getting your screenshots like this is how they’re stored. Screenshots are stored randomly in subdirectories inside of the screenshots directory.

Screenshots are randomly stored in such folders (i.e. you'll find 2 screenshots in the first folder, 1 in the second, 3 in the third, so on and so forth). If you've accumulated a lot of screenshots, you have a lot more directories like this. Screenshots are randomly stored in such folders (i.e. you'll find 2 screenshots in the first folder, 1 in the second, 3 in the third, so on and so forth). If you've accumulated a lot of screenshots, you have a lot more directories like this.

What I’d generally do is copy over the entire screenshots directory to a random place on my computer, open the folder in the terminal and run mv */*.png {destination path} (this is a clear instance of terminal file management superiority). Then I’d delete the screenshots from the Vita…

…which is fine, but we can do better! Here’s a script I wrote that’ll partially automate that.

This script will:

  1. connect to your Vita’s FTP server
  2. copy over your screenshots to your computer in the directory you specified
  3. ask you if you want to delete them from the Vita

There are two things you’ll have to do once, and two others that you’ll have to do every time you use the script:

  1. Do once: install the toml Python library (with pip install toml)
  2. Do once2: enter details in a configuration file
  3. activate an FTP server on your PS Vita
  4. delete all of your screenshots from the Photos app on the Vita3 even if you’ve chosen to do that in the script (do this after you’ve copied over your screenshots)

If you want to use this, then place the script and the configuration file in the same directory (or modify the code however you want) before running the it.

config.toml
1
2
3
4
5
6
[server]
ip_addr = "xxx.xxx.xx.xx"
port = 0000

[misc]
destination_directory = "/absolute-path-to-destination-directory"
Main Script
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import ftplib
import os
import sys
import toml

# read config file
with open('config.toml', 'r') as f:
    try:
        config = toml.load(f)
    except ModuleNotFoundError:
        print("The \'toml\' package hasn't been installed. Please install it with \'pip install toml\'.")

# set IP address, port number and destination path
IP_ADDR = config['server']['ip_addr']
PORT = config['server']['port']
DESTINATION_DIRECTORY = config['misc']['destination_directory']

server = ftplib.FTP()

# connect to FTP server
try:
    server.connect(IP_ADDR, PORT)
    server.login()
except OSError:
    print("The program failed to run. Possible reasons:\n- incorrect IP address\n- incorrect port number\n- FTP server isn't active")
    print("\nTerminating program now.")
    sys.exit()

# change directory to ux0:picture/SCREENSHOT
server.cwd('ux0:picture/SCREENSHOT')

# populate array with all of the subdirectories in the SCREENSHOT folder
directory_list = []
server.dir(directory_list.append)

print("Copying images to the destination...\n")
for line in directory_list:
    subdirectory = line[29:].strip().split(' ') # clean up the output of server.dir()
    subdirectory_name = subdirectory[3] 
    server.cwd(subdirectory_name) 

    file_list = []
    server.dir(file_list.append)
    for file in file_list:
        files = file[29:].strip().split(' ')
        file_name = files[3]
        print(f"Sending {file_name}...")
        try:
            with open(f"{DESTINATION_DIRECTORY}/{file_name}", 'wb') as file:
                server.retrbinary(f"RETR {file_name}", file.write) # copy file to the destination
        except FileNotFoundError:
            print("Invalid destination directory selected. Please make sure it is an absolute path.")
            sys.exit()

    server.cwd('../')

while True:
    user_option = input("\nAll images have been copied to the destination. Would you like to delete them from the server? (y/n) ").lower()
    if user_option == "y":
        for line in directory_list:
            subdirectory = line[29:].strip().split(' ')
            subdirectory_name = subdirectory[3]
            server.cwd(subdirectory_name)

            file_list = []
            server.dir(file_list.append)
            for file in file_list:
                files = file[29:].strip().split(' ')
                file_name = files[3]
                print(f"Deleting {file_name}...")  
                try:
                    server.delete(file_name) # delete files from FTP server
                except ftplib.error_reply as e:
                    pass

            server.cwd('../')
        break
    elif user_option == "n":
        break
    else:
        print("Invalid option.")

print("\nTerminating program now.")
server.quit()

I found the ftplib library a bit janky to work with but that’s probably because I haven’t used it before.

Anyway, this isn’t a full automation but it is better than what I used to do. Now I can just run this script!


  1. Funnily enough, the transfer speeds of FTP don’t particularly bother me in this context. But they do when transferring larger files. ↩︎

  2. In my experience, the IP address I get from my Vita for its FTP server changes every now and again. So you’ll need to keep an eye on that. ↩︎

  3. This is something to do with the PS Vita’s database. Choosing to delete your screenshots in the script will indeed delete them, but their thumbnails will still be visible in your Vita’s photos app. ↩︎

Comments?

If you have any thoughts about this post, feel free to get in touch!