akiirui / mpv-handler

A protocol handler for mpv. Use mpv and yt-dlp to play video and music from the websites.
MIT License
262 stars 22 forks source link

mpv does not appear when opened using script #54

Closed distrair closed 4 months ago

distrair commented 4 months ago

When I try to play video using mpv-handler it just opens the terminal and that's it. When I copy the mpv:// url and paste it into the terminal, it works as expected. Heres the output of the mpv executable:

Playing: https://www.youtube.com/watch?v=c70PHT7cu-A
[osc] Loading lua script @osc.lua...
[ytdl_hook] Loading lua script @ytdl_hook.lua...
[osc] loading mp.defaults
[stats] Loading lua script @stats.lua...
[ytdl_hook] loading mp.defaults
[osc] loading @osc.lua
[console] Loading lua script @console.lua...
[stats] loading mp.defaults
[auto_profiles] Loading lua script @auto_profiles.lua...
[stats] loading @stats.lua
[global] config path: 'scripts' -> 'C:\Users\askir\AppData\Roaming/mpv/scripts'
[global] config path: 'scripts' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/scripts'
[global] config path: 'scripts' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/scripts'
[ytdl_hook] loading @ytdl_hook.lua
[osc] reading options for osc
[sponsorblock] Loading lua script C:\Users\askir\AppData\Roaming/mpv/scripts/sponsorblock.lua...
[auto_profiles] loading mp.defaults
[stats] reading options for stats
[ytdl_hook] reading options for ytdl_hook
[sponsorblock_shared] Loading lua script C:\Users\askir\AppData\Roaming/mpv/scripts/sponsorblock_shared/main.lua...
[sponsorblock] loading mp.defaults
[auto_profiles] loading @auto_profiles.lua
[global] config path: 'script-opts/stats.conf' -/-> 'C:\Users\askir\AppData\Roaming/mpv/script-opts/stats.conf'
[global] config path: 'script-opts/osc.conf' -/-> 'C:\Users\askir\AppData\Roaming/mpv/script-opts/osc.conf'
[console] loading mp.defaults
[cplayer] Waiting for scripts...
[global] config path: 'script-opts/ytdl_hook.conf' -/-> 'C:\Users\askir\AppData\Roaming/mpv/script-opts/ytdl_hook.conf'
[global] config path: 'script-opts/ytdl_hook.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/script-opts/ytdl_hook.conf'
[sponsorblock] loading file C:\Users\askir\AppData\Roaming/mpv/scripts/sponsorblock.lua
[global] config path: 'script-opts/stats.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/script-opts/stats.conf'
[global] config path: 'script-opts/osc.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/script-opts/osc.conf'
[sponsorblock_shared] loading mp.defaults
[console] loading @console.lua
[sponsorblock_shared] loading file C:\Users\askir\AppData\Roaming/mpv/scripts/sponsorblock_shared/main.lua
[console] reading options for console
[global] config path: 'script-opts/osc.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/script-opts/osc.conf'
[osc] script-opts/osc.conf not found.
[sponsorblock] reading options for sponsorblock
[global] config path: 'script-opts/ytdl_hook.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/script-opts/ytdl_hook.conf'
[ytdl_hook] script-opts/ytdl_hook.conf not found.
[global] config path: 'script-opts/console.conf' -/-> 'C:\Users\askir\AppData\Roaming/mpv/script-opts/console.conf'
[global] config path: 'script-opts/console.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/script-opts/console.conf'
[global] config path: 'lua-settings/osc.conf' -/-> 'C:\Users\askir\AppData\Roaming/mpv/lua-settings/osc.conf'
[global] config path: 'lua-settings/osc.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/lua-settings/osc.conf'
[global] config path: 'script-opts/stats.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/script-opts/stats.conf'
[stats] script-opts/stats.conf not found.
[global] config path: 'script-opts/sponsorblock.conf' -/-> 'C:\Users\askir\AppData\Roaming/mpv/script-opts/sponsorblock.conf'
[global] config path: 'lua-settings/osc.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/lua-settings/osc.conf'
[global] config path: 'lua-settings/ytdl_hook.conf' -/-> 'C:\Users\askir\AppData\Roaming/mpv/lua-settings/ytdl_hook.conf'
[global] config path: 'script-opts/console.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/script-opts/console.conf'
[global] config path: 'lua-settings/stats.conf' -/-> 'C:\Users\askir\AppData\Roaming/mpv/lua-settings/stats.conf'
[global] config path: 'script-opts/sponsorblock.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/script-opts/sponsorblock.conf'
[osc] lua-settings/osc.conf not found.
[console] script-opts/console.conf not found.
[global] config path: 'script-opts/sponsorblock.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/script-opts/sponsorblock.conf'
[sponsorblock] script-opts/sponsorblock.conf not found.
[global] config path: 'lua-settings/console.conf' -/-> 'C:\Users\askir\AppData\Roaming/mpv/lua-settings/console.conf'
[global] config path: 'lua-settings/console.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/lua-settings/console.conf'
[global] config path: 'lua-settings/stats.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/lua-settings/stats.conf'
[global] config path: 'lua-settings/sponsorblock.conf' -/-> 'C:\Users\askir\AppData\Roaming/mpv/lua-settings/sponsorblock.conf'
[global] config path: 'lua-settings/console.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/lua-settings/console.conf'
[console] lua-settings/console.conf not found.
[global] config path: 'lua-settings/sponsorblock.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/lua-settings/sponsorblock.conf'
[global] config path: 'lua-settings/ytdl_hook.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/lua-settings/ytdl_hook.conf'
[global] config path: 'lua-settings/stats.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/lua-settings/stats.conf'
[stats] lua-settings/stats.conf not found.
[global] config path: 'lua-settings/ytdl_hook.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/lua-settings/ytdl_hook.conf'
[ytdl_hook] lua-settings/ytdl_hook.conf not found.
[cplayer] Run command: define-section, flags=64, args=[name="showhide", contents="mouse_move script-binding osc/__keybinding1\nmouse_leave script-binding osc/__keybinding2\n", flags="force"]
[input] add: section='showhide' key='MOUSE_MOVE' cmd='script-binding osc/__keybinding1' location='<api>:1'
[input] add: section='showhide' key='MOUSE_LEAVE' cmd='script-binding osc/__keybinding2' location='<api>:2'
[global] config path: 'lua-settings/sponsorblock.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/lua-settings/sponsorblock.conf'
[cplayer] Run command: define-section, flags=64, args=[name="showhide_wc", contents="mouse_move script-binding osc/__keybinding3\nmouse_leave script-binding osc/__keybinding4\n", flags="force"]
[sponsorblock] lua-settings/sponsorblock.conf not found.
[input] add: section='showhide_wc' key='MOUSE_MOVE' cmd='script-binding osc/__keybinding3' location='<api>:1'
[input] add: section='showhide_wc' key='MOUSE_LEAVE' cmd='script-binding osc/__keybinding4' location='<api>:2'
[cplayer] Run command: enable-section, flags=64, args=[name="showhide", flags="allow-hide-cursor+allow-vo-dragging"]
[input] enable section 'showhide'
[input] active section stack:
[input]  default 12
[input]  showhide 12
[cplayer] Run command: enable-section, flags=64, args=[name="showhide_wc", flags="allow-hide-cursor+allow-vo-dragging"]
[input] enable section 'showhide_wc'
[input] active section stack:
[input]  default 12
[input]  showhide 12
[input]  showhide_wc 12
[global] config path: 'scripts' -> 'C:\Users\askir\AppData\Roaming/mpv/scripts'
[cplayer] Run command: define-section, flags=64, args=[name="input", contents="mbtn_left script-binding osc/__keybinding5\nshift+mbtn_left script-binding osc/__keybinding6\nmbtn_right script-binding osc/__keybinding7\nmbtn_mid script-binding osc/__keybinding8\nwheel_up script-binding osc/__keybinding9\nwheel_down script-binding osc/__keybinding10\nmbtn_left_dbl ignore\nshift+mbtn_left_dbl ignore\nmbtn_right_dbl ignore\n", flags="force"]
[input] add: section='input' key='MBTN_LEFT' cmd='script-binding osc/__keybinding5' location='<api>:1'
[input] add: section='input' key='Shift+MBTN_LEFT' cmd='script-binding osc/__keybinding6' location='<api>:2'
[input] add: section='input' key='MBTN_RIGHT' cmd='script-binding osc/__keybinding7' location='<api>:3'
[input] add: section='input' key='MBTN_MID' cmd='script-binding osc/__keybinding8' location='<api>:4'
[input] add: section='input' key='WHEEL_UP' cmd='script-binding osc/__keybinding9' location='<api>:5'
[input] add: section='input' key='WHEEL_DOWN' cmd='script-binding osc/__keybinding10' location='<api>:6'
[input] add: section='input' key='MBTN_LEFT_DBL' cmd='ignore' location='<api>:7'
[input] add: section='input' key='Shift+MBTN_LEFT_DBL' cmd='ignore' location='<api>:8'
[input] add: section='input' key='MBTN_RIGHT_DBL' cmd='ignore' location='<api>:9'
[cplayer] Run command: define-section, flags=64, args=[name="input_sponsorblock", contents="g script-binding sponsorblock/set_segment\nG script-binding sponsorblock/submit_segment\nh script-binding sponsorblock/upvote_segment\nH script-binding sponsorblock/downvote_segment\n", flags="default"]
[input] add: section='input_sponsorblock' key='g' builtin cmd='script-binding sponsorblock/set_segment' location='<api>:1'
[input] add: section='input_sponsorblock' key='G' builtin cmd='script-binding sponsorblock/submit_segment' location='<api>:2'
[input] add: section='input_sponsorblock' key='h' builtin cmd='script-binding sponsorblock/upvote_segment' location='<api>:3'
[input] add: section='input_sponsorblock' key='H' builtin cmd='script-binding sponsorblock/downvote_segment' location='<api>:4'
[cplayer] Run command: enable-section, flags=64, args=[name="input", flags=""]
[input] enable section 'input'
[input] active section stack:
[input]  default 12
[input]  showhide 12
[input]  showhide_wc 12
[input]  input 0
[cplayer] Run command: define-section, flags=64, args=[name="input_console", contents="", flags="default"]
[cplayer] Run command: enable-section, flags=64, args=[name="input_sponsorblock", flags="allow-hide-cursor+allow-vo-dragging"]
[input] enable section 'input_sponsorblock'
[input] active section stack:
[input]  default 12
[input]  showhide 12
[input]  showhide_wc 12
[input]  input 0
[input]  input_sponsorblock 12
[cplayer] Run command: define-section, flags=64, args=[name="window-controls", contents="mbtn_left script-binding osc/__keybinding11\n", flags="force"]
[input] add: section='window-controls' key='MBTN_LEFT' cmd='script-binding osc/__keybinding11' location='<api>:1'
[cplayer] Run command: define-section, flags=64, args=[name="input_forced_sponsorblock", contents="", flags="force"]
[cplayer] Run command: define-section, flags=64, args=[name="input_stats", contents="", flags="default"]
[cplayer] Run command: enable-section, flags=64, args=[name="input_forced_sponsorblock", flags="allow-hide-cursor+allow-vo-dragging"]
[input] enable section 'input_forced_sponsorblock'
[input] active section stack:
[input]  default 12
[input]  showhide 12
[input]  showhide_wc 12
[input]  input 0
[input]  input_sponsorblock 12
[input]  input_forced_sponsorblock 12
[cplayer] Run command: enable-section, flags=64, args=[name="input_console", flags="allow-hide-cursor+allow-vo-dragging"]
[input] enable section 'input_console'
[input] active section stack:
[input]  default 12
[input]  showhide 12
[input]  showhide_wc 12
[input]  input 0
[input]  input_sponsorblock 12
[input]  input_forced_sponsorblock 12
[input]  input_console 12
[cplayer] Run command: enable-section, flags=64, args=[name="input_stats", flags="allow-hide-cursor+allow-vo-dragging"]
[input] enable section 'input_stats'
[input] active section stack:
[input]  default 12
[input]  showhide 12
[input]  showhide_wc 12
[input]  input 0
[input]  input_sponsorblock 12
[input]  input_forced_sponsorblock 12
[input]  input_console 12
[input]  input_stats 12
[cplayer] Run command: enable-section, flags=64, args=[name="window-controls", flags=""]
[input] enable section 'window-controls'
[input] active section stack:
[input]  default 12
[input]  showhide 12
[input]  showhide_wc 12
[input]  input 0
[input]  input_sponsorblock 12
[input]  input_forced_sponsorblock 12
[input]  input_console 12
[input]  input_stats 12
[input]  window-controls 0
[cplayer] Run command: define-section, flags=64, args=[name="input_forced_console", contents="", flags="force"]
[osc] hide_osc
[cplayer] Run command: enable-section, flags=64, args=[name="input_forced_console", flags="allow-hide-cursor+allow-vo-dragging"]
[input] enable section 'input_forced_console'
[input] active section stack:
[input]  default 12
[input]  showhide 12
[input]  showhide_wc 12
[input]  input 0
[input]  input_sponsorblock 12
[input]  input_forced_sponsorblock 12
[input]  input_console 12
[input]  input_stats 12
[input]  window-controls 0
[input]  input_forced_console 12
[cplayer] Set property: user-data/osc/visibility="auto" -> 1
[cplayer] Run command: define-section, flags=64, args=[name="input_forced_stats", contents="", flags="force"]
[cplayer] Run command: disable-section, flags=64, args=[name="input"]
[cplayer] Run command: enable-section, flags=64, args=[name="input_forced_stats", flags="allow-hide-cursor+allow-vo-dragging"]
[input] enable section 'input_forced_stats'
[input] active section stack:
[input]  default 12
[input]  showhide 12
[input]  showhide_wc 12
[input]  input_sponsorblock 12
[input]  input_forced_sponsorblock 12
[input]  input_console 12
[input]  input_stats 12
[input]  window-controls 0
[input]  input_forced_console 12
[input]  input_forced_stats 12
[cplayer] Run command: disable-section, flags=64, args=[name="window-controls"]
[cplayer] Set property: user-data/osc/margins={"l":0,"t":0,"b":0,"r":0} -> 1
[cplayer] Done loading scripts.
[global] state path: 'watch_later' -> 'C:\Users\askir\AppData\Local/mpv/watch_later'
[cplayer] Running hook: auto_profiles/on_before_start_file
[cplayer] Run command: show-text, flags=64, args=[text="", duration="-1", level="0"]
[cplayer] Run command: show-text, flags=64, args=[text="", duration="-1", level="0"]
[cplayer] Set property: user-data/osc/margins={"l":0,"t":0,"b":0,"r":0} -> 1
[osc] rendering
[global] state path: 'watch_later' -> 'C:\Users\askir\AppData\Local/mpv/watch_later'
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] ytdl:// hook
[ytdl_hook] not a ytdl:// url
[cplayer] Run command: show-text, flags=64, args=[text="", duration="-1", level="0"]
[cplayer] Running hook: ytdl_hook/on_load
[cplayer] Run command: show-text, flags=64, args=[text="", duration="-1", level="0"]
[osc] osc_init
[cplayer] Run command: show-text, flags=64, args=[text="", duration="-1", level="0"]
[ytdl_hook] playlist hook
[cplayer] Running hook: auto_profiles/on_load
[ffmpeg] Opening https://www.youtube.com/watch?v=c70PHT7cu-A
[cplayer] Set property: user-data/osc/margins={"l":0,"t":0,"b":0,"r":0} -> 1
[ffmpeg] https: Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
[cplayer] Run command: osd-overlay, flags=64, args=[id="1", format="ass-events", data="", res_x="854", res_y="854", z="1000", hidden="no", compute_bounds="no"]
[global] config path: 'fonts' -/-> 'C:\Users\askir\AppData\Roaming/mpv/fonts'
[global] config path: 'fonts' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/fonts'
[global] config path: 'fonts' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/fonts'
[osd/libass] ASS library version: 0x1701000 (runtime 0x1701000)
[osd/libass] libass API version: 0x1701000
[osd/libass] libass source: commit: 0.17.0-82-g2cea926568f0a06c2ec38b30bfb83714a6e259f1
[osd/libass] Raster: FreeType 2.13.2
[osd/libass] Shaper: FriBidi 1.0.13 (SIMPLE) HarfBuzz-ng 8.4.0 (COMPLEX)
[osd/libass] Initialized
[global] config path: 'subfont.ttf' -/-> 'C:\Users\askir\AppData\Roaming/mpv/subfont.ttf'
[global] config path: 'subfont.ttf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/subfont.ttf'
[global] config path: 'subfont.ttf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/subfont.ttf'
[global] config path: 'fonts.conf' -/-> 'C:\Users\askir\AppData\Roaming/mpv/fonts.conf'
[global] config path: 'fonts.conf' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/fonts.conf'
[global] config path: 'fonts.conf' -> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/fonts.conf'
[osd/libass] Setting up fonts...
[ffmpeg] tcp: Original list of addresses:
[ffmpeg] tcp: Address 142.251.39.14 port 443
[ffmpeg] tcp: Address 142.251.39.46 port 443
[ffmpeg] tcp: Address 142.251.39.78 port 443
[ffmpeg] tcp: Address 142.251.208.110 port 443
[ffmpeg] tcp: Address 142.251.208.142 port 443
[ffmpeg] tcp: Address 142.251.208.174 port 443
[ffmpeg] tcp: Address 172.217.19.110 port 443
[ffmpeg] tcp: Address 172.217.20.14 port 443
[osd/libass] Using font provider directwrite (with GDI)
[osd/libass] Done.
[ffmpeg] tcp: Address 142.250.180.206 port 443
[ffmpeg] tcp: Address 142.250.180.238 port 443
[ffmpeg] tcp: Address 142.250.201.206 port 443
[ffmpeg] tcp: Interleaved list of addresses:
[osc] rendering
[ffmpeg] tcp: Address 142.251.39.14 port 443
[osc] osc_init
[ffmpeg] tcp: Address 142.251.39.46 port 443
[ffmpeg] tcp: Address 142.251.39.78 port 443
[ffmpeg] tcp: Address 142.251.208.110 port 443
[ffmpeg] tcp: Address 142.251.208.142 port 443
[ffmpeg] tcp: Address 142.251.208.174 port 443
[ffmpeg] tcp: Address 172.217.19.110 port 443
[cplayer] Set property: user-data/osc/margins={"l":0,"t":0,"b":0,"r":0} -> 1
[ffmpeg] tcp: Address 172.217.20.14 port 443
[cplayer] Run command: define-section, flags=64, args=[name="input_osc", contents="", flags="default"]
[ffmpeg] tcp: Address 142.250.180.206 port 443
[cplayer] Run command: enable-section, flags=64, args=[name="input_osc", flags="allow-hide-cursor+allow-vo-dragging"]
[input] enable section 'input_osc'
[input] active section stack:
[input]  default 12
[input]  showhide 12
[input]  showhide_wc 12
[input]  input_sponsorblock 12
[input]  input_forced_sponsorblock 12
[input]  input_console 12
[input]  input_stats 12
[input]  input_forced_console 12
[input]  input_forced_stats 12
[input]  input_osc 12
[ffmpeg] tcp: Address 142.250.180.238 port 443
[cplayer] Run command: define-section, flags=64, args=[name="input_forced_osc", contents="", flags="force"]
[ffmpeg] tcp: Address 142.250.201.206 port 443
[cplayer] Run command: enable-section, flags=64, args=[name="input_forced_osc", flags="allow-hide-cursor+allow-vo-dragging"]
[input] enable section 'input_forced_osc'
[input] active section stack:
[input]  default 12
[input]  showhide 12
[input]  showhide_wc 12
[input]  input_sponsorblock 12
[input]  input_forced_sponsorblock 12
[input]  input_console 12
[input]  input_stats 12
[input]  input_forced_console 12
[input]  input_forced_stats 12
[input]  input_osc 12
[input]  input_forced_osc 12
[ffmpeg] tcp: Starting connection attempt to 142.251.39.14 port 443
[ffmpeg] tcp: Successfully connected to 142.251.39.14 port 443
[ffmpeg] https: request: GET /watch?v=c70PHT7cu-A HTTP/1.1
[ffmpeg] User-Agent: libmpv
[ffmpeg] Accept: */*
[ffmpeg] Range: bytes=0-
[ffmpeg] Connection: close
[ffmpeg] Host: www.youtube.com
[ffmpeg] Icy-MetaData: 1
[ffmpeg]
[ffmpeg]
[ffmpeg] https: header='HTTP/1.1 200 OK'
[ffmpeg] https: http_code=200
[ffmpeg] https: header='Content-Type: text/html; charset=utf-8'
[ffmpeg] https: header='X-Content-Type-Options: nosniff'
[ffmpeg] https: header='Cache-Control: no-cache, no-store, max-age=0, must-revalidate'
[ffmpeg] https: header='Pragma: no-cache'
[ffmpeg] https: header='Expires: Mon, 01 Jan 1990 00:00:00 GMT'
[ffmpeg] https: header='Date: Sat, 20 Jul 2024 18:08:16 GMT'
[ffmpeg] https: header='Strict-Transport-Security: max-age=31536000'
[ffmpeg] https: header='X-Frame-Options: SAMEORIGIN'
[ffmpeg] https: header='Report-To: {"group":"youtube_main","max_age":2592000,"endpoints":[{"url":"https://csp.withgoogle.com/csp/report-to/youtube_main"}]}'
[ffmpeg] https: header='Origin-Trial: AmhMBR6zCLzDDxpW+HfpP67BqwIknWnyMOXOQGfzYswFmJe+fgaI6XZgAzcxOrzNtP7hEDsOo1jdjFnVr2IdxQ4AAAB4eyJvcmlnaW4iOiJodHRwczovL3lvdXR1YmUuY29tOjQ0MyIsImZlYXR1cmUiOiJXZWJWaWV3WFJlcXVlc3RlZFdpdGhEZXByZWNhdGlvbiIsImV4cGlyeSI6MTc1ODA2NzE5OSwiaXNTdWJkb21haW4iOnRydWV9'
[ffmpeg] https: header='Cross-Origin-Opener-Policy: same-origin-allow-popups; report-to="youtube_main"'
[ffmpeg] https: header='Permissions-Policy: ch-ua-arch=*, ch-ua-bitness=*, ch-ua-full-version=*, ch-ua-full-version-list=*, ch-ua-model=*, ch-ua-wow64=*, ch-ua-form-factors=*, ch-ua-platform=*, ch-ua-platform-version=*'
[ffmpeg] https: header='P3P: CP="This is not a P3P policy! See http://support.google.com/accounts/answer/151657?hl=uk for more info."'
[ffmpeg] https: header='Transfer-Encoding: chunked'
[ffmpeg] https: header='Server: ESF'
[ffmpeg] https: header='X-XSS-Protection: 0'
[ffmpeg] https: header='Set-Cookie: GPS=1; Domain=.youtube.com; Expires=Sat, 20-Jul-2024 18:38:16 GMT; Path=/; Secure; HttpOnly'
[ffmpeg] https: header='Set-Cookie: YSC=i7bPJMjRIYo; Domain=.youtube.com; Path=/; Secure; HttpOnly; SameSite=none'
[ffmpeg] https: header='Set-Cookie: VISITOR_INFO1_LIVE=JHGZ6ca7gJw; Domain=.youtube.com; Expires=Thu, 16-Jan-2025 18:08:16 GMT; Path=/; Secure; HttpOnly; SameSite=none'
[ffmpeg] https: header='Set-Cookie: VISITOR_PRIVACY_METADATA=CgJVQRIEGgAgGQ%3D%3D; Domain=.youtube.com; Expires=Thu, 16-Jan-2025 18:08:16 GMT; Path=/; Secure; HttpOnly; SameSite=none'
[ffmpeg] https: header='Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000'
[ffmpeg] https: header='Connection: close'
[ffmpeg] https: header=''
[ffmpeg] resize stream to 131072 bytes, drop 0 bytes
[ffmpeg] Mime-type: 'text/html'
[ffmpeg] Stream opened successfully.
[demux] Trying demuxers for level=normal.
[demux] Trying demuxer: disc (force-level: normal)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: edl (force-level: normal)
[ffmpeg] seek request from 0 to 0
[ffmpeg] https: Chunked encoding data size: 8676
[demux] Trying demuxer: cue (force-level: normal)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: rawaudio (force-level: normal)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: rawvideo (force-level: normal)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: mkv (force-level: normal)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: libarchive (force-level: normal)
[ffmpeg] seek request from 3 to 0
[demux] Trying demuxer: lavf (force-level: normal)
[ffmpeg] seek request from 0 to 0
[ffmpeg] https: Chunked encoding data size: 32768
[ffmpeg] https: Chunked encoding data size: 21202
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] https: Chunked encoding data size: 11558
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] resize stream to 262144 bytes, drop 0 bytes
[ffmpeg] https: Chunked encoding data size: 21203
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] https: Chunked encoding data size: 11557
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] https: Chunked encoding data size: 21204
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] resize stream to 524288 bytes, drop 0 bytes
[ffmpeg] https: Chunked encoding data size: 11556
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] https: Chunked encoding data size: 21205
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] https: Chunked encoding data size: 11555
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] https: Chunked encoding data size: 21206
[ffmpeg] https: Chunked encoding data size: 6317
[ffmpeg] https: Chunked encoding data size: 8121
[ffmpeg] https: Chunked encoding data size: 32768
[ffmpeg] https: Chunked encoding data size: 32750
[ffmpeg] resize stream to 1048576 bytes, drop 0 bytes
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] https: Chunked encoding data size: 22410
[ffmpeg] https: Chunked encoding data size: 162
[ffmpeg] https: Chunked encoding data size: 32768
[ffmpeg] https: Chunked encoding data size: 32585
[ffmpeg] https: Chunked encoding data size: 32933
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] https: Chunked encoding data size: 32764
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] https: Chunked encoding data size: 32764
[ffmpeg] https: Chunked encoding data size: 32754
[ffmpeg] https: Chunked encoding data size: 16169
[ffmpeg] https: Chunked encoding data size: 0
[ffmpeg] https: Last chunk received, closing conn
[ffmpeg] resize stream to 2097152 bytes, drop 0 bytes
[lavf] No format found, try lowering probescore or forcing the format.
[demux] Trying demuxer: mf (force-level: normal)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: playlist (force-level: normal)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: null (force-level: normal)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxers for level=unsafe.
[demux] Trying demuxer: disc (force-level: unsafe)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: edl (force-level: unsafe)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: cue (force-level: unsafe)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: rawaudio (force-level: unsafe)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: rawvideo (force-level: unsafe)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: mkv (force-level: unsafe)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: libarchive (force-level: unsafe)
[ffmpeg] seek request from 3 to 0
[demux] Trying demuxer: lavf (force-level: unsafe)
[ffmpeg] seek request from 0 to 0
[ffmpeg] resize stream to 1048576 bytes, drop 0 bytes
[ffmpeg] resize stream to 2097152 bytes, drop 0 bytes
[lavf] No format found, try lowering probescore or forcing the format.
[demux] Trying demuxer: mf (force-level: unsafe)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: playlist (force-level: unsafe)
[ffmpeg] seek request from 0 to 0
[demux] Trying demuxer: null (force-level: unsafe)
[ffmpeg] seek request from 0 to 0
[ffmpeg] AVIOContext: Statistics: 902003 bytes read, 0 seeks
[cplayer] Opening failed or was aborted: https://www.youtube.com/watch?v=c70PHT7cu-A
[cplayer] Running hook: ytdl_hook/on_load_fail
[ytdl_hook] full hook
[global] config path: 'yt-dlp.exe' -/-> 'C:\Users\askir\AppData\Roaming/mpv/yt-dlp.exe'
[global] config path: 'yt-dlp.exe' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/yt-dlp.exe'
[global] config path: 'yt-dlp.exe' -/-> 'C:/Users/askir/AppData/Local/Programs/WingetUI/choco-cli/lib/mpvio.install/tools/mpv/yt-dlp.exe'
[ytdl_hook] No youtube-dl found with path yt-dlp.exe in config directories
[ytdl_hook] Running: yt-dlp --no-warnings -J --flat-playlist --sub-format ass/srt/best --format bestvideo+bestaudio/best --print-to-file C:\Users\askir\AppData\Local\Programs\Python\Python312\Scripts\log.txt --all-subs --no-playlist -- https://www.youtube.com/watch?v=c70PHT7cu-A
[cplayer] Run command: subprocess, flags=64, args=[args="yt-dlp,--no-warnings,-J,--flat-playlist,--sub-format,ass/srt/best,--format,bestvideo+bestaudio/best,--print-to-file,C:\\Users\\askir\\AppData\\Local\\Programs\\Python\\Python312\\Scripts\\log.txt,--all-subs,--no-playlist,--,https://www.youtube.com/watch?v=c70PHT7cu-A", playback_only="yes", capture_size="67108864", capture_stdout="yes", capture_stderr="yes", detach="no", env="", stdin_data="", passthrough_stdin="no"]

As you can see here, it gets stuck on yt-dlp, so i think problem with yt-dlp when I try to open a video through script.

akiirui commented 4 months ago

I have a few questions:

  1. Where is your yt-dlp.exe?
  2. Have you configured ytdl-hook related options in mpv.conf or yt-dlp.conf?
  3. Have you configured the ytdl path in mpv-handler's config.toml?
  4. Manually copying the mpv:// URL to mpv-handler.exe on the command line works fine, but not via the browser script?
distrair commented 4 months ago

I have a few questions:

  1. Where is your yt-dlp.exe?
  2. Have you configured ytdl-hook related options in mpv.conf or yt-dlp.conf?
  3. Have you configured the ytdl path in mpv-handler's config.toml?
  4. Manually copying the mpv:// URL to mpv-handler.exe on the command line works fine, but not via the browser script?
  1. It uses yt-dlp that is declared in PATH, but i had it installed in the mpv folder, same thing
  2. yes, i did with adding script-opts=ytdl_hook-ytdl_path=yt-dlp in mpv's config, same thing
  3. yes, same thing
  4. yes

Also, trying different browser doesn't help, same thing happens on chromium browsers and firefox based browsers.

distrair commented 4 months ago

Update: for some strange reason, adding ytdl-raw-options=extractor-args="youtube:player-client=android" to a mpv.conf file fixes the problem, also this line fixes the seeking problem (if you had one)