AssrtOSS / mpv-assrt

mpv自动下载字幕脚本 Automatically download subtitles from assrt.net
123 stars 13 forks source link

mpv 0.33 无法加载脚本 #11

Closed in-out closed 4 years ago

in-out commented 4 years ago

MPV:https://sourceforge.net/projects/mpv-player-windows/files/64bit/mpv-x86_64-20200517-git-152b0e2.7z/download 脚本语言:lua和js版本都试过,类似的错误 log: Cannot find main.* for any supported scripting backend in: D:/app/mpv/mpv/scripts/modules.js Can't load unknown script: D:/app/mpv/mpv/scripts/win-helper.vbs [assrt] Error: Cannot find module file 'AssFormat.js' [assrt] at resolve_module_file (@/defaults.js:496) [assrt] at require (@/defaults.js:564) [assrt] at D:/app/mpv/mpv/scripts/assrt.js:13 [assrt] at run_script (native) [assrt] Could not load javascript D:/app/mpv/mpv/scripts/assrt.js

AssrtOpenSource commented 4 years ago

scripts文件夹里有拷贝modules或者modules.js吗

in-out notifications@github.com于2020年5月23日 周六下午1:19写道:

MPV: https://sourceforge.net/projects/mpv-player-windows/files/64bit/mpv-x86_64-20200517-git-152b0e2.7z/download 脚本语言:lua和js版本都试过,类似的错误 log: Cannot find main.* for any supported scripting backend in: D:/app/mpv/mpv/scripts/modules.js Can't load unknown script: D:/app/mpv/mpv/scripts/win-helper.vbs [assrt] Error: Cannot find module file 'AssFormat.js' [assrt] at resolve_module_file (@/defaults.js:496) [assrt] at require (@/defaults.js:564) [assrt] at D:/app/mpv/mpv/scripts/assrt.js:13 [assrt] at run_script (native) [assrt] Could not load javascript D:/app/mpv/mpv/scripts/assrt.js

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AssrtOSS/mpv-assrt/issues/11, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7A5LRMJCFSQ7ZY5KTDGY3RS5MEZANCNFSM4NIJR37A .

tuchit commented 4 years ago

我的情况是按下a完全没反应 解压缩的 scripts 与 script-opts 文件夹放在mpv目录下的 portable_config 目录 之前一直好好的,最近一些天不能用了

in-out commented 4 years ago

scripts文件夹里有拷贝modules或者modules.js吗 in-out notifications@github.com于2020年5月23日 周六下午1:19写道: MPV: https://sourceforge.net/projects/mpv-player-windows/files/64bit/mpv-x86_64-20200517-git-152b0e2.7z/download 脚本语言:lua和js版本都试过,类似的错误 log: Cannot find main.* for any supported scripting backend in: D:/app/mpv/mpv/scripts/modules.js Can't load unknown script: D:/app/mpv/mpv/scripts/win-helper.vbs [assrt] Error: Cannot find module file 'AssFormat.js' [assrt] at resolve_module_file (@/defaults.js:496) [assrt] at require (@/defaults.js:564) [assrt] at D:/app/mpv/mpv/scripts/assrt.js:13 [assrt] at run_script (native) [assrt] Could not load javascript D:/app/mpv/mpv/scripts/assrt.js — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#11>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7A5LRMJCFSQ7ZY5KTDGY3RS5MEZANCNFSM4NIJR37A .

有 tree的结果是这样的 │ mpv.com │ mpv.exe │
├─doc │
├─fonts │
├─installer │
└─mpv │ fonts.conf │ input.conf │ mpv.conf │
├─script-opts │ assrt.conf │
└─scripts │ assrt.js │ win-helper.vbs │
└─modules.js AssFormat.js MicroUtils.js Options.js SelectionMenu.js

IstPlayer commented 4 years ago

我也有同样的情况,mpv版本为:

> mpv -v
[cplayer] Command line options: '-v'
[cplayer] mpv 0.32.0-484-g152b0e2a8c Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Sun May 17 14:05:21 +08 2020
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       56.45.100
[cplayer]    libavcodec      58.84.100
[cplayer]    libavformat     58.43.100
[cplayer]    libswscale      5.6.101
[cplayer]    libavfilter     7.81.100
[cplayer]    libswresample   3.6.100
[cplayer] FFmpeg version: git-2020-05-17-f603d10b1
[cplayer]

只用了 lua 版本,控制台相关的提示:

Cannot find main.* for any supported scripting backend in: C:/scoop/apps/mpv-git/current/portable_config/scripts/modules
[assrt] stack traceback:
[assrt]         [string "C:/scoop/apps/mpv-git/current/portable_config..."]:26: in main chunk
[assrt]         [C]: at 0x00d3c9a0
[assrt]         [C]: at 0x00d3c1a0
[assrt] Lua error: [string "C:/scoop/apps/mpv-git/current/portable_config..."]:26: module 'modules.AssFormat' not found:
[assrt]         no field package.preload['modules.AssFormat']
[assrt]         no file ':/scoop/apps/mpv-git/current/portable_config/scripts/modules\AssFormat.lua'
[assrt]         no file 'C:\scoop\apps\mpv-git\current\lua\modules\AssFormat.lua'
[assrt]         no file 'C:\scoop\apps\mpv-git\current\lua\modules\AssFormat\init.lua'
[assrt]         no file 'C:\scoop\apps\mpv-git\current\modules\AssFormat.dll'
[assrt]         no file 'C:\scoop\apps\mpv-git\current\loadall.dll'
[assrt]         no file 'C:\scoop\apps\mpv-git\current\modules.dll'
[assrt]         no file 'C:\scoop\apps\mpv-git\current\loadall.dll'

# 甚至在调用快捷键 a 时会显示
[input] No key binding found for key 'a'.

看起来似乎时modules的问题,但是相关文件我是有的:

> tree
├── input.conf
├── mpv.conf
├── playlists
│   └── .........
├── script-opts
│   ├── assrt.conf
│   ├── mpv_thumbnail_script.conf
│   └── playlistmanager.conf.example
├── scripts
│   ├── assrt.lua
│   ├── autoload.lua
│   ├── modules
│   │   ├── AssFormat.lua
│   │   ├── MicroUtils.lua
│   │   └── SelectionMenu.lua
│   ├── .........
│   ├── .........
│   └── playlistmanager.lua
└── watch_later
    ├── .........
IstPlayer commented 4 years ago

在使用 stable 版本的时候没有这个问题(Windows 系统)

❯ mpv -v
[cplayer] Command line options: '-v'
[cplayer] mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Mon Jan 27 12:34:40 +08 2020
[cplayer] ffmpeg library versions:
[cplayer]    libavutil       56.38.100
[cplayer]    libavcodec      58.67.100
[cplayer]    libavformat     58.36.100
[cplayer]    libswscale      5.6.100
[cplayer]    libavfilter     7.71.100
[cplayer]    libswresample   3.6.100
[cplayer] ffmpeg version: git-2020-01-26-5e6210015
[cplayer]

但是会显示 API请求错误,请检查控制台输出

[assrt] curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - ���ڵ������������ѻ������������޷���������
[assrt] subprocess exit with code 35

assrt.conf

# 菜单外观
## 设置多少秒后自动关闭菜单,设为0时不关闭
auto_close=0

## 设置每页显示字幕条数
#max_lines=15

## 设置菜单字体大小
#font_size=24

# 设置是否使用https
use_https=yes

# 自定义API Token, 在https://assrt.net/usercp.php注册后免费使用 
#api_token=

# 下载字幕命名为与视频文件同名
auto_rename=yes

尝试过设置 api_token,得到的结果是一样的。

AssrtOpenSource commented 4 years ago

我有点感觉是mpv那边把什么搞炸了😂

Hrand Liu notifications@github.com于2020年5月24日 周日下午2:35写道:

在使用 stable 版本的时候没有这个问题(Windows 系统)

❯ mpv -v

[cplayer] Command line options: '-v'

[cplayer] mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects

[cplayer] built on Mon Jan 27 12:34:40 +08 2020

[cplayer] ffmpeg library versions:

[cplayer] libavutil 56.38.100

[cplayer] libavcodec 58.67.100

[cplayer] libavformat 58.36.100

[cplayer] libswscale 5.6.100

[cplayer] libavfilter 7.71.100

[cplayer] libswresample 3.6.100

[cplayer] ffmpeg version: git-2020-01-26-5e6210015

[cplayer]

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/AssrtOSS/mpv-assrt/issues/11#issuecomment-633186951, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7A5LXWQ6KKLNT2S4ETEBLRTC53XANCNFSM4NIJR37A .

fffonion commented 4 years ago

mpv 0.33 对子文件夹有迷惑的操作,而且是breaking change 😂

稍后修复

fffonion commented 4 years ago

@in-out @Ni1fheim 有机会的话可以试一下这个分支 https://github.com/AssrtOSS/mpv-assrt/tree/0.33/scripts

目前lua版本是合并成了单文件,这个可以向前兼容0.33以前的版本;js版本在0.33上去除了modules.js的导入,现在需要拷贝整个assrt文件夹。

in-out commented 4 years ago

@in-out @Ni1fheim 有机会的话可以试一下这个分支 https://github.com/AssrtOSS/mpv-assrt/tree/0.33/scripts

目前lua版本是合并成了单文件,这个可以向前兼容0.33以前的版本;js版本在0.33上去除了modules.js的导入,现在需要拷贝整个assrt文件夹。

lua没有问题 js没有试。。。 不过用0.33分支的话 同时 启用自定义设定的话 会报api错误 Can't load unknown script: D:/app/mpv/mpv/scripts/win-helper.vbs to boolean! : Can't convert yes ' for key 'use_https' srt.conf:10 error converting value 'yes to boolean! : Can't convert yes ' for key 'auto_rename' t.conf:16 error converting value 'yes [assrt] loaded assrt Lua flavor Resuming playback. This behavior can be disabled with --no-resume-playback. (+) Video --vid=1 () (h264 1280x720 23.976fps) (+) Audio --aid=1 --alang=jpn () (aac 2ch 48000Hz) [vo/gpu] Interpolation now requires enabling display-sync mode. [vo/gpu] E.g.: --video-sync=display-resample AO: [wasapi] 48000Hz stereo 2ch float VO: [gpu] 1280x720 yuv420p10 [vo/gpu] ICC profile detected contrast very high (>100000), falling back to contrast 1000 for sanity. Set the icc-contrast option to silence this warning. AV: 00:10:54 / 00:45:54 (24%) A-V: 0.000 [assrt] selected: curl AV: 00:10:54 / 00:45:54 (24%) A-V: 0.000 [assrt] curl: (3) Illegal characters found in URL [assrt] subprocess exit with code 3 [assrt] curl: (3) Illegal characters found in URL [assrt] subprocess exit with code 3 AV: 00:11:03 / 00:45:54 (24%) A-V: 0.000