axcore / tartube

A GUI front-end for youtube-dl, partly based on youtube-dl-gui and written in Python 3 / Gtk 3
GNU Lesser General Public License v2.1
2.05k stars 110 forks source link

Support for macOS #66

Closed EdricChan03 closed 4 years ago

EdricChan03 commented 4 years ago

P.S I found this project from your Reddit post while looking for GUI alternatives to youtube-dl.

Anyways, could there be support for a macOS package installer or something similar?

axcore commented 4 years ago

@EdricChan03, I don't have access to a Mac so I can't create a package installer. It should be fairly simple, but someone else will have to do it.

Tartube can actually be run without installation (most of the time). You might need to install some python stuff first; I don't know.

Installation on macOS via PyPI should be possible, too.

noahbroyles commented 4 years ago

I also am a Mac Man. How could I run this on my mac, is there a main python file I can just call like python3 main.py?

axcore commented 4 years ago

At a very minimum you would need to install Python 3 (Python 2 will not work), the python package manager pip, and the graphics library Gtk 3 (Gtk 2 will not work).

Once you have those, install the Python requests module via pip.

From there, installation should be similar to that on Linux/BSD. Either run the source code (see sections 5.3.6 and 5.3.7) or install via pip (see section 5.3.2).

Sorry I can't be more precise than that, but I haven't even touched a Mac since the 1990s.

tl;dr: The command is python3 tartube/tartube, and it must be run from the directory above the one containing main.py.

noahbroyles commented 4 years ago

I have python3.8, pip, and requests on my Mac already. Only when I try to run tartube, I get: ModuleNotFoundError: No module named 'gi' I think this is because I cannot properly install pygobject3. I get some pip errors when trying to install it. I have a horrible feeling that I should be using python3.7 and not python3.8.

I was able to successfully install tartube on one of my Linux machines running Ubuntu, and I like it a lot!

volcs0 commented 4 years ago

I got through the installation process on my mac by following the instructions in the README and installing the dependencies. When I just execute tartube (/usr/local/bin/tartube) I get the error: "pkg_resources.ResolutionError: Script 'scripts/tartube' not found in metadata at '/usr/local/lib/python3.7/site-packages/tartube-2.0.6.dist-info'"

When I try to run tartube directly ("python3 tartube") I get the error: "ValueError: Namespace Notify not available"

I'd like to get the /usr/local/bin/tartube running. Any advice? Thanks.

axcore commented 4 years ago

I'm sorry, I have no idea. I have not seen the same error messages on my system.

joremysh commented 4 years ago

I got through the installation process on my mac by following the instructions in the README and installing the dependencies. When I just execute tartube (/usr/local/bin/tartube) I get the error: "pkg_resources.ResolutionError: Script 'scripts/tartube' not found in metadata at '/usr/local/lib/python3.7/site-packages/tartube-2.0.6.dist-info'"

When I try to run tartube directly ("python3 tartube") I get the error: "ValueError: Namespace Notify not available"

I'd like to get the /usr/local/bin/tartube running. Any advice? Thanks.

I met the same question as @volcs0, but according to your comment "Notify" is a package on linux, right? So I tried to commented those lines out. gi.require_version('Notify', '0.7') Notify.init('Tartube')

And now I met another issue. image https://gist.github.com/JeremyShih/1ebd196d4a1d9295efac32a40fde762d

axcore commented 4 years ago

Tartube doesn't try to use Notify on MS Windows, so for the purposes of testing, we could just ignore it generally.

Assuming Tartube v2.1.070, in the file ../tartube/mainwin.py, at lines 39, 759 and 3365

if os.name != 'nt':

Could be replaced with something like

if False:

...taking care to preserve indentation.

EDIT: In case it's not obvious, os.name does not distinguish between Linux and MacOS, so for releasable code it would have to be replaced with something else.

joremysh commented 4 years ago

I just succeeded!!! Yeah!!!!! finally something appeared!!!! image After testing with the functions, I will provide the steps or update them in the document.

Yes I saw Tartube doesn't try to use Notify on MS Windows. I am trying to get it running on my Mac. And I guess it also doesn't work directly on macOS after googling about it and everyone said apt-get install gir1.2-notify-0.7... Maybe Tartube should also ignore that on macOS until we found some other choice for Notify.

axcore commented 4 years ago

@JeremyShih I amended the code to remove Notify as a dependency for MacOS. You can get v2.1.074 from here on github or via PyPi. Perhaps you can test it for me, and tell me if it works.

axcore commented 4 years ago

Thanks a lot for getting that working. Can Ffmpeg be installed on your system, and can Tartube detect it? (It's pretty much a necessity for many users).

If so, I can update the README for that.

ntphx commented 4 years ago

As a heads-up; following the install instructions for macOS will crash when trying to install pycairo without having first installed its dependency pkg-config normally through brew install pkg-config

edit; Currently does not run on macOS when following instructions as written

axcore commented 4 years ago

Thanks, I have updated the README to add that step.

joremysh commented 4 years ago

oh I didn't notice that since I already have pkg-config installed. Thanks about that.

@axcore I have also tested with ffmpeg brew install ffmpeg The above commend is for installing it. I didn't set path to ffmpeg binary in system preferences and only updated setting in download options. image And I got a m4a file. image So I guess it works without specifying the path.

axcore commented 4 years ago

Splendid! I think we can close this issue, in that case. Feel free to re-open it if you run into any issues, and thanks again for all your work.

joremysh commented 4 years ago

Just tried to package tartube into a macOS app with py2app but failed.

with the original setup.py and command python setup.py py2app -A will get error error: You must specify either app or plugin

then tried adding an attr to setuptools.setup( app=[], still get the same error

I also tried with app=['tartube/tartube'] then got error error: [Errno 30] Read-only file system: '/tartube' it was copying the file '/python3.8/site-packages/py2app/apptemplate/prebuilt/main-x86_64' into '/dist/tartube.app/Contents/MacOS/tartube' but '/tartube' is not a folder and it failed.

axcore commented 4 years ago

I have not had any success with other automatic package builders, such as py2exe. I think none of them are compatible with Gtk.

joremysh commented 4 years ago

oh really How did you packaged the exe files then?

axcore commented 4 years ago

Using Msys2 and NSIS. It's all documented in this file.