Port Subdownloader to MacOSX

Bug #245836 reported by Ivan Garcia on 2008-07-05
56
This bug affects 6 people
Affects Status Importance Assigned to Milestone
SubDownloader
Medium
eduo

Bug Description

It seems that the libraries for QT and PYQT for MACOSX leopard are not very stable.

In order to use the py2app we need first to be able to run Subdownloader in some MacOSX (I recommend Tiger do that way the resultant .app will be compatible with Tiger and above)

Here is some example of py2app script for the Calibre project
http://bazaar.launchpad.net/%7Ekovid/calibre/trunk/annotate/1658?file_id=360%40b0dd1a5d-880a-0410-ada5-a57097536bc1%3Alibprs500%252Ftrunk%3Aosx_installer.py

And this is the result of size (pyqt static libraries takes a lots of MB, however we won't need all them, just pyqtCore, pyqtGUI)
http://bazaar.launchpad.net/%7Ekovid/calibre/trunk/annotate/1658?file_id=360%40b0dd1a5d-880a-0410-ada5-a57097536bc1%3Alibprs500%252Ftrunk%3Aosx_installer.py

Ivan Garcia (capiscuas) wrote :

eduo has been able to compile the pyqt libraries in Leopard,
Now he's trying to compile into an .app program for MacosX, by using py2app module.

here is the screenshot

Changed in subdownloader:
assignee: nobody → eduo
importance: Undecided → Low
status: New → In Progress
sofauxboho (me-flatrabbit) wrote :

I've got Subdownloader 2.0 rev 308 successfully built and running on OS X Leopard (Intel.)

Using py2app, I've been able to build a working package using alias mode via the instructions here:
http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html#create-a-setup-py-file

The alias version functions perfectly, but when I try to build a stand-alone version for redistribution, I get the following console error:

<paste>
Traceback (most recent call last):
File "/Users/reed/Downloads/subdownloader/dist/run.app/Contents/Resources/__boot__.py", line 137, in <module>
_run('run.py')
File "/Users/reed/Downloads/subdownloader/dist/run.app/Contents/Resources/__boot__.py", line 134, in _run
execfile(path, globals(), globals())
File "/Users/reed/Downloads/subdownloader/dist/run.app/Contents/Resources/run.py", line 27, in <module>
import subdownloader.modules.configuration as conf
ImportError: No module named subdownloader.modules.configuration
2008-07-13 23:39:20.959 run[79397:10b] run Error
2008-07-13 23:39:20.960 run[79397:10b] run Error
An unexpected error has occurred during execution of the main script

ImportError: No module named subdownloader.modules.configuration
</paste>

I'm pretty close to having this all together. Any help on resolving this problem?

eduo (eduo) wrote :

sofauxboho: I'm stuck in the exact same place for a week now. I've tried doing several things (in fact mimicking the py2exe set-up) without much luck. The Py2exe file contains instructions to go above a directory and place the installer in "subdownloader", which is supposed to take care of this, but I haven't been able to replicate:

http://bazaar.launchpad.net/~subdownloader-developers/subdownloader/trunk/files/312?file_id=packages-20080705144745-lkxq3zojzz4376xl-1

These lines are supposed to take care of this:
import os, sys
os.chdir("..") #We are in the distribution subfolder, we want to be in subdownloader folder.
(parent, current) = os.path.split(os.path.dirname(os.getcwd()))
sys.path.insert(0, os.path.dirname(parent))
sys.path.insert(0, os.getcwd())

But I'm finding other errors. I haven't been able to put as much time into this as I'd like but this file may point you in the right direction. It may just be a matter of adding the proper path.

Ivan Garcia (capiscuas) wrote :

Hi sofauxboho and eduo, can you post the current py2app script that you have? in which folder do you have it placed it? and how do you execute it?

Changed in subdownloader:
importance: Low → Medium
status: In Progress → Fix Committed
Marco Ferreira (mferreira) wrote :

Please do some tests so I can close this. cheers

eduo (eduo) wrote :

Application now compiles cleanly with a default setup.py for py2app but still crashes in my machine due to some strange version error (I currently have only one version installed, so it makes no sense).

sofauxboho may be able to provide more help, with the current revision that has the paths fixed.

Ivan Garcia (capiscuas) wrote :

still researching how to get the py2app done.

Changed in subdownloader:
status: Fix Committed → In Progress
Ivan Garcia (capiscuas) wrote :

I've been able to generate a .app of 37MB (compressed only 11MB),

here is the setup.py i used.

Ivan Garcia (capiscuas) wrote :

this is the .app for you to try

Johan Lundström (johanlunds) wrote :

On my Macbook with Intel Core 2 Duo processor and Leopard 10.5.4 I got this when launching your attached app:

ImportError: dlopen(/Users/lundan/Downloads/SubDownloader.app/Contents/Resources/lib/python2.5/lib-dynload/PyQt4/QtCore.so, 2): no suitable image found. Did find:
 /Users/lundan/Downloads/SubDownloader.app/Contents/Resources/lib/python2.5/lib-dynload/PyQt4/QtCore.so: mach-o, but wrong architecture

Is it possible to compile QT/PyQT as a universal binary?

PS. Thanks for the try to port SubDownloader, it's appreciated.

Ivan Garcia (capiscuas) wrote :

Hello Johan, the mac I used to create that .app is a PowerBook, with PPC architecture, unluckily I had to return it so I cannot generate more .app, it worked very well with my machine , but I believe the .app was not cross-architecture.

Can you install py2app, pyqt and pytho2.5 in ur machine and run the script i attached to see if you will have more luck by creating a .app working everywhere?

The error message you got also appeared for eduo.

I will if I have the time, but I'm afraid I won't. I'll try to keep in touch.

2008/8/27 Ivan Garcia <email address hidden>:
> Hello Johan, the mac I used to create that .app is a PowerBook, with PPC
> architecture, unluckily I had to return it so I cannot generate more
> .app, it worked very well with my machine , but I believe the .app was
> not cross-architecture.
>
> Can you install py2app, pyqt and pytho2.5 in ur machine and run the
> script i attached to see if you will have more luck by creating a .app
> working everywhere?
>
> The error message you got also appeared for eduo.
>
> --
> Port Subdownloader to MacOSX
> https://bugs.launchpad.net/bugs/245836
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in SubDownloader. Find Subtitles for your Videos: In Progress
>
> Bug description:
> It seems that the libraries for QT and PYQT for MACOSX leopard are not very stable.
>
> In order to use the py2app we need first to be able to run Subdownloader in some MacOSX (I recommend Tiger do that way the resultant .app will be compatible with Tiger and above)
>
> Here is some example of py2app script for the Calibre project
> http://bazaar.launchpad.net/%7Ekovid/calibre/trunk/annotate/1658?file_id=360%40b0dd1a5d-880a-0410-ada5-a57097536bc1%3Alibprs500%252Ftrunk%3Aosx_installer.py
>
> And this is the result of size (pyqt static libraries takes a lots of MB, however we won't need all them, just pyqtCore, pyqtGUI)
> http://bazaar.launchpad.net/%7Ekovid/calibre/trunk/annotate/1658?file_id=360%40b0dd1a5d-880a-0410-ada5-a57097536bc1%3Alibprs500%252Ftrunk%3Aosx_installer.py
>

--
Mvh,
Johan Lundström

<email address hidden>

Maciek Szczesniak (vvarp) wrote :

Hi,

I am looking into possibilities of building native app for MacOSX, however I got stuck at very beginning.

Macports version of python2.5+qt4.4.1+pyqt4+sip throws "bus error" even before anything happens.
As this is bug within Macports itself, I decided to use python2.5 provided with 10.5.

Using prebuilt qt4.4.1 from trolltech and pyqt4+sip installed from source I am able to run SubDownloader but the only thing I can see is frozen GUI that doesn't throw any exception or anything that could allow me to investigate what's going on.

Did anyone here experienced same thing?

Ivan Garcia (capiscuas) on 2008-10-08
Changed in subdownloader:
status: In Progress → Confirmed
Ivan Garcia (capiscuas) wrote :

Hi Maciek, do you see any error in the commandline when running "python run.py -d" ??

Kuisathaverat (kuisathaverat) wrote :
Kuisathaverat (kuisathaverat) wrote :

I change the point of view i use platypus (http://sveinbjorn.org/platypus) and add sip and PyQt as resources , this make a universal binary that launch the shell script that launch the python program. It makes only necesary to have Qt libraries from trolltech (http://trolltech.com/downloads/opensource/appdev/mac-os-cpp).
I only proved it on Mac OS X 10.5.5, but it posible that it works almost in 10.4.X

Ivan Garcia (capiscuas) wrote :

Many thanks

Version 2.0.8 has just been released.
https://launchpad.net/subdownloader/+download

Do you mind creating the .dmg for the version 2.0.8 ?

Kuisathaverat (kuisathaverat) wrote :

Just do it ;)

Ivan Garcia (capiscuas) wrote :

Kuisathaverat,

does the locale folder works in ur version? I mean, when first time run of the application, does it ask to choose Language ?

Also, what is the link of the .dmg to install the QT dependency of that package?

Kuisathaverat (kuisathaverat) wrote :

No , it no ask to choose language. I run in commandline and now let me choose language. Where is the configuration file? What condition makes it ask for language?
Trolltech Qt package is in ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-4.4.3.dmg, it is the binary version.

angelus1969 (angelo-machils) wrote :

I have downloaded the Trolltech QT package, but can't seem to be able
to install it. The installer starts and goes through the several steps,
but it stays forever at the point "Select a Destination" with the
status "Examining additional volumes".

Angelo

On Sun, 09 Nov 2008 11:54:09 -0000, Kuisathaverat wrote:
> No , it no ask to choose language. I run in commandline and now let
> me choose language. Where is the configuration file? What condition
> makes it ask for language?
> Trolltech Qt package is in
> ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-4.4.3.dmg, it is
> the binary version.
>
> --
> Port Subdownloader to MacOSX
> https://bugs.launchpad.net/bugs/245836
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in SubDownloader. Find Subtitles for your Videos: Confirmed
>
> Bug description:
> It seems that the libraries for QT and PYQT for MACOSX leopard are
> not very stable.
>
> In order to use the py2app we need first to be able to run
> Subdownloader in some MacOSX (I recommend Tiger do that way the
> resultant .app will be compatible with Tiger and above)
>
> Here is some example of py2app script for the Calibre project
>
http://bazaar.launchpad.net/%7Ekovid/calibre/trunk/annotate/1658?file_id=360%40b0dd1a5d-880a-0410-ada5-a57097536bc1%3Alibprs500%252Ftrunk%3Aosx_installer.py
>
> And this is the result of size (pyqt static libraries takes a lots
> of MB, however we won't need all them, just pyqtCore, pyqtGUI)
>
http://bazaar.launchpad.net/%7Ekovid/calibre/trunk/annotate/1658?file_id=360%40b0dd1a5d-880a-0410-ada5-a57097536bc1%3Alibprs500%252Ftrunk%3Aosx_installer.py

Kuisathaverat (kuisathaverat) wrote :

I try to make a standalone version that not need Qt instaled

Kuisathaverat (kuisathaverat) wrote :

MacOSX 10.5.X or 10.4.X with Python 2.5.X

Kuisathaverat (kuisathaverat) wrote :

Platypus bash script to run subdownloader

Arthur Carli (arthur-carli) wrote :

Kuisathaverat,
Your files don't seem to work on my mac (a new mac book pro)
Attached the log file... seems to me that's there is a path to your user profile written in the code, doesn't find where though...

Kuisathaverat (kuisathaverat) wrote :

I am sorry i make a little mistake in the run.sh script with DYLD_FRAMEWORK_PATH i add Frameworks and this is not correct.
You can fix it overwriting the file SubDownloader.app/Contents/Resources/script with the athached o downloading a new version with the fix

Kuisathaverat (kuisathaverat) wrote :
Kuisathaverat (kuisathaverat) wrote :

do not download it , need a adicional fix for utf8 filenames support, in few minutes i upload the good file

Kuisathaverat (kuisathaverat) wrote :

Correct version

Arthur Carli (arthur-carli) wrote :

Great !
Work fine now !
Thanks a lot

Kuisathaverat (kuisathaverat) wrote :

New 2.0.9.3 version

Changed in subdownloader:
status: Confirmed → In Progress
Changed in subdownloader:
status: In Progress → Triaged
Kuisathaverat (kuisathaverat) wrote :

Finally i will put the instruction to make a bundle and a SDK to meke it on Mac OS X
You need installed macports to make the bundle and some packages , these are the install lines
$ sudo port install python25
$ sudo port install python_select
$ sudo python_select python25
$ sudo port install py25-macholib-devel
$ sudo port install py25-sip
$ sudo port install py25-pyqt4
$ sudo port install py25-py2app-devel
$ sudo port install py25-pyqt
When you have this packages installed you can uncompress the atacthment of this post is a directory with SubDownloader 9.0.3 and a script that makes py2app and a dmg image file. You only run build.sh and all will be make, it ask for a password to change the python version to 2.5, when the scripts exits put apple python as default.
To change the version of SubDownloader you only have to change the directory SubDownloader.

Ivan Garcia (capiscuas) wrote :

Hi Kuisathaverat,

We had to change the URL address to the opensubtitles API so the current Mac version is not working to search/download subs.
can you create a .dmg version of the latest SubDownloader ?

Thanks a lot in advance.

Damien Flasse (damien-flasse) wrote :

I'd definitely love to have a new build with the new API. Many thanks in advance!

Kuisathaverat (kuisathaverat) wrote :

I will try to make it this weekend

Un saludo
Iván Fernández Calvo

El 18/03/2010, a las 00:48, Ivan Garcia <email address hidden> escribió:

Hi Kuisathaverat,

We had to change the URL address to the opensubtitles API so the current Mac version is not working to search/download subs.
can you create a .dmg version of the latest SubDownloader ?

Thanks a lot in advance.

--
Port Subdownloader to MacOSX
https://bugs.launchpad.net/bugs/245836
You received this bug notification because you are a direct subscriber
of the bug.

Status in SubDownloader - Find Subtitles for your Videos: Triaged

Bug description:
It seems that the libraries for QT and PYQT for MACOSX leopard are not very stable.

In order to use the py2app we need first to be able to run Subdownloader in some MacOSX (I recommend Tiger do that way the resultant .app will be compatible with Tiger and above)

Here is some example of py2app script for the Calibre project
http://bazaar.launchpad.net/%7Ekovid/calibre/trunk/annotate/1658?file_id=360%40b0dd1a5d-880a-0410-ada5-a57097536bc1%3Alibprs500%252Ftrunk%3Aosx_installer.py

And this is the result of size (pyqt static libraries takes a lots of MB, however we won't need all them, just pyqtCore, pyqtGUI)
http://bazaar.launchpad.net/%7Ekovid/calibre/trunk/annotate/1658?file_id=360%40b0dd1a5d-880a-0410-ada5-a57097536bc1%3Alibprs500%252Ftrunk%3Aosx_installer.py

To unsubscribe from this bug, go to:
https://bugs.launchpad.net/subdownloader/+bug/245836/+subscribe

Kuisathaverat (kuisathaverat) wrote :

the version 2.0.10 is broken on Mac OS X, the new metadata feature uses no ported to Mac OS X libraries of python. I can compile kaa.metadata and mmpython libraries so i can do the new version.
At this moment i no have any time to port one of the libraries and bundle SubDownloader. I will try to make a litle bit of time but it will be so dificult.

Ivan Garcia (capiscuas) wrote :

I believe that the kaa.metadata is optional to run the program , it should be inside some try: except: python block so in the case of Mac or Fedora with no access to those packages easily, they can be ignored.

Kuisathaverat (kuisathaverat) wrote :

Finaly i found a litle bit of time and compile kaa.metadata to Mac OS X an here a¡is the new bundle 2.0.10. I only can probe it on Mac OS X 10.6, if someone use it on other version report please it.
Without support to kaa.metadata Subdownloader no find files on dirs.

Kuisathaverat (kuisathaverat) wrote :

Sorry it only works out of py2app there are some problems to include all kaa in bundle, I will try to solve it but i do not know when.

Kuisathaverat (kuisathaverat) wrote :

I fond the problem kaa use __import__ to import packages. Py2app do not undestand this imports and make a broken bundle. I am fooking for a solution in bits of time.

Kuisathaverat (kuisathaverat) wrote :

this version works, it still has some problems with filenames with no ascii characters in de names

Traceback (most recent call last):
  File "gui/main.pyc", line 925, in onFolderTreeClicked
  File "gui/main.pyc", line 762, in SearchVideos
  File "FileManagement/FileScan.pyc", line 43, in ScanFilesFolders
  File "FileManagement/FileScan.pyc", line 91, in ScanFolder
  File "encodings/utf_8.pyc", line 16, in decode
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0303' in position 42: ordinal not in range(128)

I tried to upload the bundle but fails, i will tried tomorrow
i make changes in metadata.py

#!/usr/bin/env python
# Copyright (c) 2009 SubDownloader Developers - See COPYING - GPLv3

import logging

log = logging.getLogger("subdownloader.modules.metadata")
try:
    import kaa.metadata as metadata
except ImportError:
    try:
        import mmpython as metadata
    except ImportError:
        log.warning("Failed to import metadata module. This means you will be unable to upload your videos with all details.")

# expose metadata parsing method for global usage
def parse(filepath):
 try:
  return metadata.parse(filepath)
 except:
  log.warning("Failed to import metadata module. This means you will be unable to upload your videos with all details.")
  return 1

Kuisathaverat (kuisathaverat) wrote :
Kuisathaverat (kuisathaverat) wrote :
Kuisathaverat (kuisathaverat) wrote :
Kuisathaverat (kuisathaverat) wrote :
Kuisathaverat (kuisathaverat) wrote :

And the last, It is a bundle to Mac OS X 10.6

Samuel Rizzo (samuel365) wrote :

Can't open SubDownloader.zip. :(

Samuel Rizzo (samuel365) wrote :

My bad. I forgot the other files.

Damien Flasse (damien-flasse) wrote :

Thank you so much!

Ricardo Duarte (ricardoduarte) wrote :

Kuisathaverat,

How can I join this files(.zip, .z01,...) in MacOSX?

Kuisathaverat (kuisathaverat) wrote :

try to use a unpacker program i use it
http://wakaba.c3.cx/s/apps/unarchiver.html

AmilaSK (amila-sk) wrote :

Kuisathaverat,

Thank you for the file.

I tried to run the app on my intel Mac 10.5.7 but I get this error,

".... ZipImportError: can't decompress data; zlib not available"

my Python version: 2.5.1

Kuisathaverat (kuisathaverat) wrote :

Since two versions ago, the bundle do not use the local python installed, it use a python version into the bundle. this version is 2.5.4 that needs zlib instaled, the problem is that I can make to Mac OS X to find it into bundle so you need to install it. I will try to post a pkg to install zlib in the systems that no have it.
Now you can try to copy it into /usr/local/lib from a terminal.

sudo cp /Applications/SubDownloader.app/Contents/Frameworks/libz.1.dylib /usr/local/lib

Kuisathaverat (kuisathaverat) wrote :

zlib library

Marco Ferreira (mferreira) wrote :

Hi.

I have released a new version and with an updated OSX subdownloader.
You can find it here: http://launchpad.net/subdownloader/trunk/2.0.15/+download/SubDownloader.dmg.zip

Please try it and report and issues you find.

Thanks

Changed in subdownloader:
status: Triaged → Fix Released

Thanks!
I'll try it and let you know.

Everything seems fine on Lion in an early 2011 MacBook Pro 13" 2.3 i5.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions