Stash Explorer

Open galleries/images in Windows Explorer. Requires included stashExplorer.py to be running locally.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

लेखक
stashtastic
दैनिक इंस्टॉल
0
एकूण इंस्टॉल
5
रेटिंग
0 0 0
आवृत्ती
2024-09-13
बनवली
2024-10-05
अपडेट केली
2024-10-05
आकार
6.82 KB
License
MIT
यांवर लागू होते:

Open images/galleries in Windows Explorer from Stash https://github.com/stashapp/stash/

  • Adds a folder icon to the top-left of gallery/image pages.
  • Clicking the icon will open Windows Explorer, automatically selecting the file.

NOTE: Required Python Script

UserScripts do not have the ability to open Windows Explorer.

This script requires a separate Python script is running on your local host, in order to open Windows Explorer.

The Python script will open a port on your computer (port 9998). The Python script code is included in the UserScript comments, and below:

from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse
from urllib.parse import parse_qs
import subprocess

class StashExplorerHandler(BaseHTTPRequestHandler):
    def o(self, text):
        text = str(text)
        print(f"[StashExplorer.py] {text}")
        output = text + "\n\n"
        self.wfile.write(output.encode("utf-8"))

    def do_GET(self):
        """handle GET requests."""
        self.send_response(200)
        self.send_header("Content-type", "text/html")
        self.end_headers()

        # Parse path
        parsed_url = urlparse(self.path)
        params = parse_qs(parsed_url.query)

        if "path" not in params:
            self.o(f"Could not find 'path' in params: {params}")
            return

        path = params["path"][0]
        path = path.replace('/', '\\')

        # Sanitize
        if '"' in path:
            path = path.replace('"', '\\"')

        command = f'explorer /select,"{path}"'
        self.o(f"Opening: {command}")
        subprocess.Popen(command)


def run(server_class=HTTPServer, handler_class=StashExplorerHandler):
    server_address = ('', 9998)
    httpd = server_class(server_address, handler_class)
    httpd.serve_forever()

run()