Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

youtube-dl not working on mpv client inside syncplay #228

Closed
brenolf opened this Issue Mar 13, 2019 · 10 comments

Comments

Projects
None yet
2 participants
@brenolf
Copy link

brenolf commented Mar 13, 2019

Whenever I try to add an URL to syncplay playlist to run, MPV will throw

[ytdl_hook] youtube-dl failed: unexpected error ocurred 
Failed to recognize file format.

This doesn't happen if I call mpv directly from the terminal, even if I pass --player-operation-mode=pseudo-gui to it, it will normally play the video. youtube-dl is on /usr/local/bin/youtube-dl and /usr/local/bin is on my PATH.

@albertosottile

This comment has been minimized.

Copy link
Member

albertosottile commented Mar 13, 2019

Thanks for reporting this. We need further information to reproduce the issue:

  • your Syncplay client version
  • your operative system version
  • your mpv version
  • (if possible) the URL that caused the problem, or another URL that causes the same problem
@brenolf

This comment has been minimized.

Copy link
Author

brenolf commented Mar 13, 2019

Syncplay: 1.6.2
youtube-dl: 2019.03.09
mpv: 0.29.1

Running on OSX Mojave 10.14.3

Any URL fail, for example https://www.youtube.com/watch?v=VrS6akzR3sk.

@albertosottile

This comment has been minimized.

Copy link
Member

albertosottile commented Mar 13, 2019

Reproduced EDIT

My error message is quite different, though:

[ytdl_hook] youtube-dl failed: not found or not enough permissions 
Failed to recognize file format.
@brenolf

This comment has been minimized.

Copy link
Author

brenolf commented Mar 13, 2019

Sometimes I also get that error, which made me think youtube-dl was not in the PATH or that it didn't have the right permission. I tried changing it to 777 and creating a symlink inside ~/.config/mpv but none of these approaches worked.

Thanks for checking, though, and awesome work with Syncplay 🏆

@albertosottile

This comment has been minimized.

Copy link
Member

albertosottile commented Mar 13, 2019

I was wrong, the bug is reproducible at least on 10.13 and 10.14 (but probably also on older systems) and from Syncplay 1.5.0. So, thank you for reporting this!

We identified py2app as the culprit and I am currently drafting a workaround.

albertosottile added a commit to albertosottile/syncplay that referenced this issue Mar 14, 2019

Run mpv subprocess with a system PYTHONPATH env on macOS.
youtube-dl relies on system python to run on macOS, but system
python cannot be executed in a subprocess created from the frozen
python3 executable. This makes youtube-dl unusable from frozen
versions of Syncplay on macOS. So, the environment of the mpv
subprocess is modified with system PYTHONPATH, allowing the
execution of /usr/bin/python (and hence, of youtube-dl)
from within the subprocess also in frozen executables.

Fixes: Syncplay#228

albertosottile added a commit to albertosottile/syncplay that referenced this issue Mar 14, 2019

Run mpv subprocess with a system PYTHONPATH env on macOS.
youtube-dl relies on system python to run on macOS, but system
python cannot be executed in a subprocess created from the frozen
python3 executable. This makes youtube-dl unusable from frozen
versions of Syncplay on macOS. So, the environment of the mpv
subprocess is modified with system PYTHONPATH, allowing the
execution of /usr/bin/python (and hence, of youtube-dl)
from within the subprocess in frozen executables.

Fixes: Syncplay#228

albertosottile added a commit to albertosottile/syncplay that referenced this issue Mar 14, 2019

Run mpv subprocess with a system PYTHONPATH env on macOS.
youtube-dl relies on system python to run on macOS, but system
python cannot be executed in a subprocess created from the frozen
python3 executable. This makes youtube-dl unusable from frozen
versions of Syncplay on macOS. So, the environment of the mpv
subprocess is modified with system PYTHONPATH, allowing the
execution of /usr/bin/python (and hence, of youtube-dl)
from within the subprocess in frozen executables.

Fixes: Syncplay#228
@albertosottile

This comment has been minimized.

Copy link
Member

albertosottile commented Mar 14, 2019

@brenolf Could you please test the fix on your system? If you are running Syncplay from the packed dmg, you can download an updated test version from my Bintray:
https://bintray.com/alby128/Syncplay/download_file?file_path=Syncplay_1.6.3.dmg

@brenolf

This comment has been minimized.

Copy link
Author

brenolf commented Mar 14, 2019

yes, it works! thanks @albertosottile!

@albertosottile

This comment has been minimized.

Copy link
Member

albertosottile commented Mar 14, 2019

Thank you for testing this. I am going to close this issue now. Remember to download the next official release of Syncplay with the included fix as soon as it is ready.

@brenolf

This comment has been minimized.

Copy link
Author

brenolf commented Mar 14, 2019

thanks for the fast fix! 🚀

@brenolf

This comment has been minimized.

Copy link
Author

brenolf commented Mar 22, 2019

For other people that might face this problem: running on

Syncplay: 1.6.3
youtube-dl: 2018.XX.XX
mpv: 0.29.1
OSX Mojave 10.14.3

Caused error on some videos. Solved by upgrading youtube-dl to the newest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.