aajanki / yle-dl

Download videos from Yle servers
https://aajanki.github.io/yle-dl/index-en.html
GNU General Public License v3.0
309 stars 52 forks source link

AdobeHDS path seems to be hard-coded #89

Closed ilmaisin closed 7 years ago

ilmaisin commented 7 years ago

If I install yle-dl to a custom path, all files go to correct place, but the AdobeHDS path seems to be always /usr/local/share/yle-dl/AdobeHDS.php. Yle-dl fails to work until the user manually changes the path in the yle-dl executable.

Akuli commented 7 years ago

Doesn't the --adobehds option work?

ilmaisin commented 7 years ago

I haven't tried that because I wasn't aware of the option.

But it's not a very good user experience if you need to specify the installation paths every time you run the program. Could the os.path.dirname function or something similar be used to find out the install path? Or maybe edit the correct path to the script using the makefile?

harski commented 7 years ago

I maintain a package for Gentoo in my own repository, and what I have done is patch the correct path in during the installation process: sed -i 's|/usr/local/share/yle-dl/AdobeHDS.php|/usr/share/yle-dl/AdobeHDS.php|g' yle-dl. This is a hack, though, and ideally you'd want to correct the paths in setup.py according to parameters passed to it.

aajanki commented 7 years ago

As a quick work-around, you can define a shell alias to avoid repeating the switch every time: alias yle-dl2="yle-dl --adobehds /path/to/AdobeHDS.php"

I agree that it would be nice to setup the correct path in setup.py properly, but this isn't a high priority item for me right now.

Akuli commented 7 years ago

The "correct" way to implement this would be using Python's setuptools, and a Python module with an entry point instead of just an executable script.