Greasy Fork

Greasy Fork is available in English.

javdb本地视频 python脚本搜索

有时候有的片子已看过,但不记得是否看过。本脚本配合Everything 和 python3 搜索本地文件和显示搜索结果

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
1637664504
日安装量
0
总安装量
297
评分
0 0 0
版本
0.3
创建于
2023-07-23
更新于
2023-08-03
大小
798 字节
许可证
none
适用于

1.小白/懒人一键安装包


2.手动安装步骤 与 注意事项

1.安装es.exe,python3,videoSearch.py

#coding=utf-8
import sys,os
import subprocess
number = sys.argv[1][8:]
#number = sys.argv[1]
print("number",number)
print(sys.getdefaultencoding())

def local_search_video(number):
    cmd = "es -highlight %s"%(number)
    ret = subprocess.run(cmd)
    result = os.popen(cmd)
    if(len(result.read()) <= 2):
        return -1
    return ret.returncode

def txt_search_video(number):
    # 修改为 文件文本存储路径: 示例 D:/video/丑.txt D:/video/垃圾.txt
    txt_dir="D:/video/*"
    cmd = "findstr /a:2 /S -I /c:%s %s"%(number,txt_dir)
    ret = subprocess.run(cmd)

    cmd2 = "grep --color -irn %s %s*"%(number,txt_dir)
    ret2 = subprocess.run(cmd2)
    return -ret.returncode

local_ret = local_search_video(number)
txt_ret = txt_search_video(number)
print("local_file_search:%d txt_search:%d"%(local_ret,txt_ret))
if local_ret and txt_ret:
    print("No")
    exit()
else:
    str="\n--------------------------------> %s \n"%(number)
    print(str)
    input("press any key")
    exit()

  • 解压ES-1.1.0.23.zip

  • 将es.exe 和 videoSearch.py 复制到 C:\Windows\System32

2.添加注册表

新建注册表文件browser_call_cmd.reg, 复制下面内容,

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\openExe]
@="URL:openExe Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\openExe\DefaultIcon]
@="cmd.exe,1"

[HKEY_CLASSES_ROOT\openExe\shell]

[HKEY_CLASSES_ROOT\openExe\shell\open]

[HKEY_CLASSES_ROOT\openExe\shell\open\command]
@="cmd /c videoSearch.py %1"

双击运行

3.安装此油猴脚本

4.运行Everything

非常重要:

  1. 只有先运行everything服务,es.exe搜索才能生效。
  2. 安装python3

6.搜索文件-->选项功能,非必要

通过搜索指定目录文件,查看是否已经看过. 如本人通过.txt记录看过视频:

D:\video

丑.txt 垃圾剧情.log 一般_60.txt 极品_90.txt

  • 配置目录 与 文件 在D盘下新建目录video,如下:

    D:\video
    丑.txt
    极品.txt
    ...自己可以新建任何.txt, 或其它任意文件后缀名 xxx.log
    
  • 如果要隐藏深一点,更改目录,可以修改脚本videoSearch.py 中 txt_dir="xxx"

    txt_dir="D:\video\*" --> 更改自定义目录
    txt_dir="D:\学习资料\考研\数据\记录事件\.111\*"
    
  • 下载与安装cygwin64, 支持grep.exe命令搜索文本(更好的搜索与显示, 非必要步骤) 国内下载 https://pc.qq.com/search.html#!keyword=cygwin64

    将grep.exe 拷贝到 C:\Windows\System32

    将C:\cygwin64\bin 注册到Path环境变量中

7.实际效果如附件