diff --git a/plugins/AdulttimeInteractiveDL/AdulttimeInteractiveDL.py b/plugins/AdulttimeInteractiveDL/AdulttimeInteractiveDL.py index 4256168..131d108 100644 --- a/plugins/AdulttimeInteractiveDL/AdulttimeInteractiveDL.py +++ b/plugins/AdulttimeInteractiveDL/AdulttimeInteractiveDL.py @@ -1,28 +1,10 @@ import requests, os, shutil import re, sys, json import datetime as dt -import pathlib import time -from inspect import getmembers, isfunction - -CurRunDir = pathlib.Path(__file__).parent.resolve() -vENVDir = f"{CurRunDir}/../PythonToolsInstaller/venv/lib/python3.11/site-packages" - -try: - if os.path.isdir(vENVDir): - print(f"VENV Dir {vENVDir} used", file=sys.stderr) - sys.path.insert(0, vENVDir) - else: - print(f"VENV Dir {vENVDir} not used", file=sys.stderr) - -except Exception as e: - # Ignore - print("Caught exception") try: import stashapi.log as log - from stashapi.tools import human_bytes, human_bits - from stashapi.stash_types import PhashDistance from stashapi.stashapp import StashInterface except ModuleNotFoundError: @@ -85,13 +67,10 @@ def main(): if MODE == "disable": return True else: - FRAGMENT_HOOK_TYPE = FRAGMENT["args"]["hookContext"]["type"] - FRAGMENT_SCENE_ID = FRAGMENT["args"]["hookContext"]["id"] try: get_download() # ToDo use single Scene except Exception as err: log.LogError(f"main function error: {err}") - traceback.print_exc() log.exit("Plugin exited normally.") @@ -135,10 +114,7 @@ def get_download(): i = 0 for i, scene in enumerate(scenes): - title = re.sub(r"\[PDT: .+?\]\s+", "", scene["title"]) - url = scene["url"] urls = scene["urls"] - for u in urls: # if re.search(r"members\.adulttime\.com", u): if re.search(r"\.adulttime\.com", u): @@ -176,7 +152,7 @@ def get_download(): else: log.debug(f"No Interactive for this ID") - except KeyError as error: + except KeyError: log.error( "File '%s' can not be read, invailed format" % fpw ) @@ -193,7 +169,6 @@ def get_download(): def map_file_with_funscript(sceneinfo, funscriptfile): - scenefiles = sceneinfo["files"] for u in scenefiles: filepath = os.path.dirname(os.path.abspath(u["path"])) diff --git a/plugins/AdulttimeInteractiveDL/AdulttimeInteractiveDL.yml b/plugins/AdulttimeInteractiveDL/AdulttimeInteractiveDL.yml index f738d61..9c79f2b 100644 --- a/plugins/AdulttimeInteractiveDL/AdulttimeInteractiveDL.yml +++ b/plugins/AdulttimeInteractiveDL/AdulttimeInteractiveDL.yml @@ -1,6 +1,6 @@ name: "Adulttime Interactive Downloader" description: Download Interactive Files for Adulttime Scenes -version: 0.1.1 +version: 0.1.2 url: https://github.com/tooliload/StashAppCommunityScripts/tree/main/plugins/AdulttimeInteractiveDL exec: - python diff --git a/plugins/PythonToolsInstaller/PythonToolsInstaller.py b/plugins/PythonToolsInstaller/PythonToolsInstaller.py index e2c253b..da1f99f 100644 --- a/plugins/PythonToolsInstaller/PythonToolsInstaller.py +++ b/plugins/PythonToolsInstaller/PythonToolsInstaller.py @@ -1,8 +1,7 @@ -import requests, os, shutil -import re, sys, json, time, sysconfig -from inspect import getmembers, isfunction +import shutil +import sys, json, sysconfig from venv import create -from os.path import join, expanduser, abspath +from os.path import abspath import subprocess import shutil @@ -32,18 +31,12 @@ def run(input, output): PLUGIN_DIR = input["server_connection"]["PluginDir"] modeArg = input['args']["mode"] - try: - if modeArg == "" or modeArg == "add": - return - - elif modeArg == "process_py_stashapi_tools": - get_download_py_stashapp_tools(PLUGIN_DIR) - - except Exception as e: - raise - output["error"] = str(e) + if modeArg == "" or modeArg == "add": return + elif modeArg == "process_py_stashapi_tools": + get_download_py_stashapp_tools(PLUGIN_DIR) + output["output"] = "ok" def get_download_py_stashapp_tools(PLUGIN_DIR): @@ -56,9 +49,9 @@ def get_download_py_stashapp_tools(PLUGIN_DIR): # where requirements.txt is in same dir as this script subprocess.run([f"{used_dir}/venv/bin/pip", "install", "-r", abspath(f"{used_dir}/packages/stashtools.txt")],stdout=None) - # venv/lib/python3.12/site-packages/stashapp_tools- + # venv/lib/python3.11/site-packages/stashapp_tools- - src = f"{used_dir}/venv/lib/python3.11/site-packages" + src = f"{used_dir}/venv/lib/python3.12/site-packages" destination = shutil.copytree(src, org_packagedir,ignore_func,None,shutil.copy2,False,True) fp = open(f'{used_dir}/copydo.txt', 'w+') fp.write("%s\n" % print(destination)) diff --git a/plugins/PythonToolsInstaller/PythonToolsInstaller.yml b/plugins/PythonToolsInstaller/PythonToolsInstaller.yml index 1e1b658..151366f 100644 --- a/plugins/PythonToolsInstaller/PythonToolsInstaller.yml +++ b/plugins/PythonToolsInstaller/PythonToolsInstaller.yml @@ -1,6 +1,6 @@ name: "Python Tools Installer" description: Download stashapp-tools for DockerEnv -version: 0.1. +version: 0.1.2 url: https://github.com/tooliload/StashAppCommunityScripts/tree/main/plugins/PythonToolsInstaller exec: - python