mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.81k stars 2.93k forks source link

drag'n'drop and CLI for URL needed to turn in quote #4069

Closed ww7 closed 7 years ago

ww7 commented 7 years ago

mpv version and platform

0.23.0_2 installed via homebrew on macOS 10.12.2

Reproduction steps

drag'n'drop webloc_link from browser adressbar to MPV icon in Dock drag'n'drop direct text_link form webpage in MPV_window

Expected behavior

Open stream from direct link or Youtube link

Actual behavior

MPV open and immediately close himself

Description

Opening URL's with d'n'd not work when URL contain needed to be escaped characters .\+*?[^]($)= If turn URL in quote marks ("") problem is gone

Additionally, d'n'd in mpv_window not accept text links

Related to #4036

wiiaboo commented 7 years ago

Don't just delete everything in the issue template without reading it. How are we supposed to reproduce your problem?

ww7 commented 7 years ago

Thanks, updated.

Akemi commented 7 years ago

drag'n'drop webloc_link from browser adressbar to MPV icon in Dock

i am a bit confused by the title and your reproducing steps lack a bit of information. are you trying to drop it on the mpv icon (binary) when started from CLI? since this doesn't work at all and isn't supposed to. dropping on the mpv bundle icon should definitely work. since it's relevant, what browser do you use? same as in the other issue Chrome? do you have an example URL?

drag'n'drop direct text_link form webpage in MPV_window

i assume you mean selecting a link which is just a text (not an URL to click on) and dragging the selected text on mpv? you can try this, it's kinda WIP.

ww7 commented 7 years ago

Problem not with URL, but with mpv.app when drag'n'drop (to Dock and window) not direct link but links with stream on page (youtube_dl).

Akemi commented 7 years ago

so i watched your screen recording. first of all it's not a problem with escaping, at least not on mpv's side.

cases that didn't work in the recording:

  1. dragging the favicon from the URL bar in safari onto the mpv bundle.
  2. selecting the URL in the address bar in safari and dragging the selected text on the mpv bundle
  3. same as 1 just from chrome
  4. same as 2 just from chrome
  5. unescaped URL on CLI from zsh

case 1-4 work here without problems. case 5 is clearly a problem on your end since zsh complains "zsh: no matches found" before it even gets to mpv. 5 also work without problems here.

ww7 commented 7 years ago

yep, sorry. 6 hours ago i delete previous issue interpretation and now i see a problem in drag'n'drop (to Dock and window) not direct link but links with stream on page (ytdl_hook/youtube_dl).

ww7 commented 7 years ago

in your environment d'n'd youtube URL to mpv in Dock work without problems?

Akemi commented 7 years ago

yes, i did the exact same as you did in your previously posted screen recording.

ww7 commented 7 years ago

i reinstall mpv via homebrew --with-bundle, but youtube links still not open with d'n'd Sierra 10.12.3

try to found another macos for testing

Akemi commented 7 years ago

okay i think i know the reason. when mpv is started from the bundle it doesn't use all environment vars that are used from the terminal. in your case it probably doesn't find youtube-dl and can't resolve the URL in our youtube-dl hook. a work around for that, which i use, is to symlink the youtube-dl binary to your mpv config folder.

ln -s /usr/local/bin/youtube-dl ~/.config/mpv/youtube-dl

if there is no youtube-dl binary in /usr/local/bin (that shouldn't be the case since homebrew crates a symlink there) you can search in /usr/local/Cellar/youtube-dl/2017.01.28/bin/. the date in the path depends on the version you installed.

ww7 commented 7 years ago

yeah. thanks Akemi. ln -s able to create symlink from symlink, now issue is gone. hope this helps someone.

i create extension for PopClip app (button), what accept http-url. youtube_dl hook works when PATH is additionally set in sh script or source bashrc file from ~/. i don't guessed .app bundle needed environment too, but now i realized what youtube-dl is not bundled with mpv and hook without path

Akemi commented 7 years ago

that's good. you are welcome.