当前位置: 首页 > news >正文

Automatically Naming the Screenshots to Steam

Automatically Naming the Screenshots to Steam

The Problem

I want to upload my own screenshot to steam, but I found that the methods I found are a bit tedious.

Steam expects screenshots to follow a specific naming convention in its screenshot and thumnails folders:

YYYYMMDDHHMMSS_N.jpg

Where:

  • YYYYMMDDHHMMSS is the timestamp
  • N is a sequence number
  • .jpg is the required file format

Solution

I wrote a Python script to automate this process

import os
import shutil
from PIL import Image
from datetime import datetimedef copy_images(source_folder, destination_folder, resize_thumbnails=True, thumbnail_size=(200, 125)):"""Copy all image files from source folder to destination folder with timestamp-based naming.Optionally create thumbnails in a subfolder.Args:source_folder (str): Path to source folder containing imagesdestination_folder (str): Path to destination folderresize_thumbnails (bool): Whether to create thumbnailsthumbnail_size (tuple): Size for thumbnails if enabled"""image_extensions = ('.jpg', '.jpeg', '.png', '.bmp', '.gif', '.tiff')os.makedirs(destination_folder, exist_ok=True)if resize_thumbnails:thumbnails_folder = os.path.join(destination_folder, 'thumbnails')os.makedirs(thumbnails_folder, exist_ok=True)copied_files = 0sequence_number = 1  # Starting sequence number# Get current timestamp in YYYYMMDDHHMMSS formattimestamp = datetime.now().strftime("%Y%m%d%H%M%S")for filename in os.listdir(source_folder):if filename.lower().endswith(image_extensions):source_path = os.path.join(source_folder, filename)try:new_filename = f"{timestamp}_{sequence_number}.jpg"destination_path = os.path.join(destination_folder, new_filename)with Image.open(source_path) as img:if img.mode in ('RGBA', 'P'):img = img.convert('RGB')img.save(destination_path, 'JPEG', quality=95)copied_files += 1print(f"Saved: {new_filename}")if resize_thumbnails:thumbnail_path = os.path.join(thumbnails_folder, new_filename)thumb = img.copy()thumb.thumbnail(thumbnail_size)thumb.save(thumbnail_path, 'JPEG', quality=90)print(f"Created thumbnail: {new_filename}")sequence_number += 1except Exception as e:print(f"Error processing {filename}: {str(e)}")print(f"\nDone! Saved {copied_files} images to {destination_folder}")if resize_thumbnails:print(f"Created thumbnails in {thumbnails_folder}")if __name__ == "__main__":# Example usagesource = "C:\\Users\\miyas\\Pictures\\VRChat\\SELECT" # change to your pathdestination = "X:\\steam\\userdata\\861267303\\760\\remote\\438100\\screenshots" # change to your pathcopy_images(source, destination, resize_thumbnails=True)

How to Use the Script

  1. Install Requirements:

    pip install pillow
    
  2. Edit the Paths:

    • Change source to your screenshot folder
    • Change destination to your Steam screenshots folder (usually in steam/userdata/[yourID]/760/remote/[appID]/screenshots)
  3. Run the Script:

    python upload.py
    

    After the process done, restart steam and you will see the customized pictures in the screenshot manager.

Key Features

  1. Automatic Timestamping: Uses current time for proper Steam format
  2. Format Conversion: Converts all images to JPG automatically
  3. Thumbnail Generation: Creates 200x125 thumbnails in a subfolder
http://www.jsqmd.com/news/1816/

相关文章:

  • 穷举法(c语言版)
  • ZYNQ PS 端 UART 接收数据素材帧(初学者友好版)嵌入式编程 C语言 c++ 软件开发
  • 01 Tasking IDE软件安装及新建工程
  • 详细介绍:深入理解Kafka事务
  • 能碳园区 / 工厂系统 - 智慧园区
  • 代码随想录算法训练营第五天 |242.有效的字母异位词、349. 两个数组的交集、第202题. 快乐数、1. 两数之和
  • Python - GaussDB table sync to Hive
  • Photoshop 2025 v26.0(PS2025)下载安装教程(含一键安装包下载)
  • 网络加速原理
  • 无意中在应用层瞥见了一个微内核的操作系统调度器
  • 数据结构思维题选做(长期更新)
  • 政治笔记/错题
  • 9.22模拟赛总结
  • 莫队 n的序列,多次查询一段区间内的数字的个数
  • 【mysql】mysql客户端中文显示乱码
  • 很烦不知道 自己以后要做什么,工作不会很稳定。感觉有很多东西要学习 但是 也有很多东西 不会 不知道咋办了
  • 揭秘“牛牛透视”
  • 2- 不知道自己现在做的对不对,有没有浪费掉自己的才华 也许自己是一个天才马术 但是没有资源只能 这样
  • k8s系列--资源清单yml文件
  • k8s系列--容器生命周期
  • k8s系列(14)--探针检测
  • k8s系列--控制器yml(15)
  • 从 Web 到 LLM,多入口、多链路的自动化威胁如何防护? - 详解
  • 学生管理系统案例初步分析报告
  • 【mysql】mysql5.6 版本修改用户的登录
  • AT_abc200_e [ABC200E] Patisserie ABC 2 题解
  • 日总结 5
  • Linux驱动开发(1)概念、环境与代码框架 - 实践
  • 9月22号
  • 0.5*8 边形 != 式