Closed nu-vi closed 9 years ago
The action "Services" only appears when there are enough "Services". So it's quite normal for Services to not appear. I need you to answer these questions for me:
install.sh
successfully or not.Edit: Do check if you moved the folder Sub-Downloader to your home directory or not.
It might be possible that the subtitles for a given file might not exist in thesubdb's Database. Download sample files from their website here, and right click and then "Get Subtitles". If they download, that implies the script is working fine.
If the issue still persists copy the logs.txt
file in ~/Sub-Downloader
and paste its contents here.
First I installed using GIT, but since it was not working I followed the instructions on your website (changing the name in the mv command to the name of the downloaded file of course). I ran the install.sh successfully and requests was installed properly. The error occurs every time I right click a movie and click in "Get Subtitles". It refers to the "Get Subtitles.workflow" present in users/myusername/Library/Services/Get Subtitles.workflow
The Sub-Downloader is in my home directory (and so is the requests folder) and I have tried with numerous movies including sample files but it keeps resulting in the same error, I'm running OS X 10.10.5 by the way.
Strangely the Logs.txt file only says the following: "Requests is installed Moving Get Subtitles.workflow"
I have updated main_script.py
to write logs to script.log
, along with some minor updates elsewhere in the Repo.
What I strongly recommend you to do is delete and then try a fresh install.
To Delete the Service and all files:
rm -rf ~/Sub-Downloader
rm -rf ~/Library/Services/Get\ Subtitles.workflow/
Once this is done, follow the instructions as mentioned in README. Also it is important that you clone the repo again and follow the instructions.
If you still get an error while trying to download subtitles, then go to ~/Sub-Downloader
and copy the contents of script.log
and paste them here. Note that script.log is created after the first time you try to download subtitles by clicking on Get Subtitles. If no such file exists even after trying to download using Get Subtitles, then let me know.
Edit: I have added logs to be written to script.log
that rests inside the Sub-Downloader
directory. You should be able to figure out what's wrong with your installation now.
I re-installed it and checked the logs, it seems requests isn't installed properly. Here is the log: "main - INFO - Trying Imports main - INFO - Imported sys, os and re main - INFO - Imported meta_extract, hash_video main - ERROR - Cannot Import Requests main - INFO - Extracting Meta Data from File Name main - INFO - File Name: dexter main - INFO - Directory: /Users/nuvi/Desktop main - INFO - Extension: .mp4 main - INFO - Extracted Meta Data"
Ok so, I uninstalled requests (sudo pip uninstall requests) and Sub-Downloader. Then I cloned Sub-Downloader and installed it again, responding yes when asked whether requests to be installed I answered yes (Y). The problem wasn't solved and the logs are the same as before
Clearly the script can't import requests. Open up terminal and start a python session (2.x not 3.x), generally done by typing python. Try to import requests
now, if it cannot, then the reason is that requests didn't install. Try this,
pip freeze
in terminal to check if requests in installed. If it is installed, uninstall it using pip again, and check pip freeze
again to see if it is removed or not.Clone requests to your home directory, then install using python setup.py install
.
To summarise
cd ~
git clone https://github.com/kennethreitz/requests.git
cd ~/requests
python setup.py install
Now start a python 2.x session and try and import requests
and then try the script. To put in another way, script will only work if you are able to import requests
in python 2.x.
The script itself is fine. Problem in your case is installation of requests. For that I am considering to remove install.sh
or update it.
Do tell me if it works.
Sorry for the late reply, I've been busy. I'm trying this from a clean os x 10.10.5 install. I have python 2.7 installed and I have installed requests from source as requested. I'm able to import requests fine on a python session but I still get the same error and same script.log results. For some reason the script isn't importing requests. Do you know what can be causing this?
Thank you for your time
A few clarifications:
python
in terminal.import requests
.If anything is not as mentioned above, let me know
To find the issue that's causing this:
main_script
, I have updated it at the time of writing this answer.
Note that you can do git pull
in the Sub-Downloader directory to do that.script.log
file if it exists in the Sub-Downloader directory.script.log
, which should be created again and paste its contents here.What I have done:
script.log
.sys.path
in case requests cannot be imported. For requests to be "importable", it should be there in sys.path
.Probable Cause:
sys.path
.script.log
's contents here. Your issue might not be the same as the one mentioned in the question.Knowing both the python version that gets invoked and the value of sys.path
, We can probably solve your issue.
Ok so, when I evoke a python session and import requests this is what happens:
MBP-de-Nuno:~ nuvi$ python Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. import requests quit()
So I can import requests fine on terminal.
As for the new script.log here is what I got:
main - INFO - 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
main - INFO - Trying Imports
main - INFO - Imported sys, os and re
main - INFO - Imported meta_extract, hash_video
main - ERROR - Cannot Import Requests
main - ERROR - No module named requests
Traceback (most recent call last):
File "main_script.py", line 42, in
EDIT: I have removed the need for requests.
You just need to do the following:
Remove current Sub-Downloader
directory from your home-directory and from ~/Library/Services/
and clone it again from the repo. In terminal, to summarize:
cd ~
rm -rf ~/Sub-Downloader
rm -rf ~/Library/Services/Get\ Subtitles.workflow
git clone https://github.com/bk2dcradle/Sub-Downloader
mv ~/Sub-Downloader/Get\ Subtitles.workflow ~/Library/Services/
After the installation I tried to run the script but a message like this appears: "The action “Execute shell script” found an error". Also, when I right click a movie the action Services doesn't appear, only the Get Subtitles option directly.