kone
소미소프트

소미소프트

요즘 애용하고있는 랜덤 파일 선택기

07/07/2025, 06:15:32
유틸
4203 views · 13 likes

이전 거처 멸망 전에 만든 방주가 감당이 안되서 gpt로 프로그램 짜봤는데 생각보다 유용한것 같아서 평소에 받은 은혜를 갚아보기 위해서 올려봄.

세줄요약 있음

실행하면 이런 화면이고, 여기서 방주 주소 추가랑 제거 가능함.


코드

import os
import random
import tkinter as tk
from tkinter import filedialog, messagebox, Listbox, Scrollbar, END, SINGLE
import subprocess
import json
import webbrowser
import re

CONFIG_FILE = "folder_config.json"
ARCHIVE_EXTENSIONS = ('.zip', '.7z', '.rar', '.egg')

class ArchiveFileSelectorApp:
    def __init__(self, root):
        self.root = root
        self.root.title("랜덤 압축 파일 선택기")
        self.folder_list = []

        # Load saved folders
        self.load_folder_list()

        # Frame for folder list and scrollbar
        list_frame = tk.Frame(root)
        list_frame.pack(padx=10, pady=10)

        self.folder_listbox = Listbox(list_frame, selectmode=SINGLE, width=60)
        self.folder_listbox.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)

        scrollbar = Scrollbar(list_frame, orient="vertical")
        scrollbar.config(command=self.folder_listbox.yview)
        scrollbar.pack(side=tk.RIGHT, fill=tk.Y)
        self.folder_listbox.config(yscrollcommand=scrollbar.set)

        # Populate listbox
        for folder in self.folder_list:
            self.folder_listbox.insert(END, folder)

        # Frame for buttons
        button_frame = tk.Frame(root)
        button_frame.pack(padx=10, pady=10)

        self.add_button = tk.Button(button_frame, text="폴더 추가", command=self.add_folder)
        self.add_button.grid(row=0, column=0, padx=5)

        self.remove_button = tk.Button(button_frame, text="선택한 폴더 제거", command=self.remove_selected_folder)
        self.remove_button.grid(row=0, column=1, padx=5)

        self.open_button = tk.Button(button_frame, text="랜덤 압축 파일 열기", command=self.open_random_archive)
        self.open_button.grid(row=0, column=2, padx=5)

        # Save folders on close
        self.root.protocol("WM_DELETE_WINDOW", self.on_close)

    def add_folder(self):
        folder = filedialog.askdirectory(title="추가할 폴더 선택")
        if folder and folder not in self.folder_list:
            self.folder_list.append(folder)
            self.folder_listbox.insert(END, folder)

    def remove_selected_folder(self):
        selected = self.folder_listbox.curselection()
        if selected:
            index = selected[0]
            self.folder_listbox.delete(index)
            del self.folder_list[index]

    def open_random_archive(self):
        archive_files = []
        for folder in self.folder_list:
            for dirpath, _, filenames in os.walk(folder):
                for filename in filenames:
                    if filename.lower().endswith(ARCHIVE_EXTENSIONS):
                        full_path = os.path.abspath(os.path.join(dirpath, filename))
                        archive_files.append(full_path)

        if archive_files:
            selected_file = random.choice(archive_files)
            subprocess.run(f'explorer /select,"{selected_file}"', shell=True)

            # Check for RJ or VJ code in filename
            filename = os.path.basename(selected_file)
            match = re.search(r'(RJ|VJ)(\d+)', filename, re.IGNORECASE)
            if match:
                code = match.group(0).upper()
                prefix = code[:2]
                if prefix == 'RJ':
                    url = f'https://www.dlsite.com/maniax/work/=/product_id/{code}.html'
                elif prefix == 'VJ':
                    url = f'https://www.dlsite.com/pro/work/=/product_id/{code}.html'
                webbrowser.open(url)
        else:
            messagebox.showinfo("알림", "선택된 폴더들에서 압축 파일(.zip, .7z, .rar, .egg)을 찾을 수 없습니다.")

    def load_folder_list(self):
        if os.path.exists(CONFIG_FILE):
            try:
                with open(CONFIG_FILE, 'r', encoding='utf-8') as f:
                    self.folder_list = json.load(f)
            except Exception as e:
                print(f"폴더 목록 로드 실패: {e}")
                self.folder_list = []

    def save_folder_list(self):
        try:
            with open(CONFIG_FILE, 'w', encoding='utf-8') as f:
                json.dump(self.folder_list, f, ensure_ascii=False, indent=2)
        except Exception as e:
            print(f"폴더 목록 저장 실패: {e}")

    def on_close(self):
        self.save_folder_list()
        self.root.destroy()

# Run the app
if __name__ == "__main__":
    root = tk.Tk()
    app = ArchiveFileSelectorApp(root)
    root.mainloop()


기능

다중 폴더 선택 가능

지정 폴더 내의 하위 폴더에서도 압축파일 검색 가능

지금 .zip .7z .rar .egg 파일 검색 됨

파일명에 RJ나 VJ 있으면 컴터 기본 브라우저로 DL링크 열어줌


*코드 수정해서 쓸사람은 알아서 수정해 gpt 코딩 잘하더라


젤다

https://kio.ac/c/cwMCZA5AmJQ_b36cgd45Cb


세줄요약

  1. 방주 양이 감당이 안되서 랜덤 선택기 만듦

  2. 쓸사람 써라

  3. 복구 항상 고맙다

13
1 comment
Sign in to comment
07/07/25
이것도 링크 암호화해야 하는지 모르겠네
Sign in to comment
(청아)your mom 용 vrm 파일 2개
유틸
hamellton1144
01/08 11079 24
동급생2 리메이크 *DL Version* v1.0.2.0 크랙
유틸
핏짜허엇
01/07 10990 30
starmaker(스타메이커) 갤러리 모드
유틸
horseking94
01/04 35465 53
(01.07수정됨)슬레이 더 스파이어 (Slay the Spire) R18 모드 - Echidna (Ai 번역 + 손번역)
유틸
고기사장님
01/04 20431 60
언홀리 메이든 폭탄 증가패치
유틸
yuri88
01/04 14050 18
멀웨어 검사 스크립트 - 편집증 모드 추가 (DLL 전수조사)
유틸
moomin
01/03 8037 23
🔞 슬레이 더 스파이어 NSFW 모드 모음집 + 디펙트 리플레이서
유틸
Rasmodia
01/03 24670 56
⚠️⚠️멀웨어 탐지 스크립트⚠️⚠️ - 260104 수정
유틸
moomin
01/03 33018 128
카린즈 프리즌 개인모드공유
유틸
보바도사
12/31/25 18689 12
타락신관 조이플 언어설정+이미지 오류 해결파일
유틸
kimchi1234
12/31/25 10144 2
우리아이 판타지아 cGFzc2ZpbGU=
유틸
askted
12/30/25 4019 6
하급생리메이크 1.0.1패치+크랙
유틸
쿠로
12/28/25 14784 41
모카 러브 ReLive♪ ~진심 순애 거리에서의 절정 표정 관찰 + 귀여운 미소에 폭발 분사 애니메이션~ 노모파일
유틸
미스터장
12/27/25 19384 80
Anaertailin 작가의 Slay the Spire 일부 모드만
유틸
oobd69
12/26/25 16737 15
[후타]pernio의 후타나리 시리즈 노모패치 모음 + 복구 제한 안 두기로 했음
유틸
레가토
12/24/25 9658 20
darkest dungeon 성전사(crusader) 스킨
유틸
ine158cm
12/24/25 4461 11
음혈조복토에하 천박한 한글 데칼 공유
유틸
kkkkcccc
12/23/25 13978 46
언홀리 메이든 스탠딩 일러 노예 마스크 수정해 봄
유틸
5dk2io1
12/23/25 14553 30
[유틸] RJ01497368 라스트 스탠드 기번세트
유틸
Ghost
12/21/25 15524 34
용사 파티 무너뜨리기(Hero Party Must Fall) 0.6 회상방 개선 모드
유틸
이드씬
12/21/25 14267 31
시니시스타2 모드 노모 덮어쓰기 툴
유틸
sims9876
12/20/25 13930 15
통합노모모드 시니시스타2 (SiNiSistar2) 1.2.1 마지막... (25.12.24)
유틸
크로우
12/20/25 44059 131
[요청복구] 감옥용사 조이플 구동 패치
유틸
감비아
12/20/25 4775 9
ai로 만든 히토미 다운로더 kemono
유틸
skybleu
12/19/25 8684 9
신문고 인증) Brotli 텍스트 압축 및 해제 도구 사이트 소개
유틸
ㅇㅇ
12/17/25 4591 1
슬레이 더 스파이어 (Slay The Spire) R18 패치 복구 + 2 모드
유틸
cirial
12/15/25 28038 42
[유틸] RJ01389782 비밀 노출 -배덕의 달콤함에 물든 마나카 커스텀 미션 번역
유틸
kdhehejd
12/14/25 18447 25
촉수로 세뇌 1.00 CG버그 수정파일
유틸
Bulchevik
12/14/25 5250 13
윈도우 폴더 검색용 bat 파일
유틸
asdawv123
12/13/25 4131 -6
후타)[복구]잠꾸러기 후타나리의 착정던전 구출기 노모패치
유틸
레가토
12/03/25 5371 5