bubonic / TGC.bundle

The Great Courses Agent for Plex
42 stars 7 forks source link

Being a little boneheaded... #11

Open italianbeef12 opened 3 years ago

italianbeef12 commented 3 years ago

...and I think I need some help. Doesn't seem to like the _lvenshetein import. Whatever that means. :) Here's the full log: com.plexapp.agents.tgc.log

bubonic commented 3 years ago

@italianbeef12 I'm assuming you are running on Windows. What version?

The Levenshtein library is used to do fuzzy matching in the SearchCourse() routine. I had to compile it on an old ubuntu, python 2.6 box, so it appears to not be working on Windows. I can't troubleshoot this at this time until I get a Windows box up and running.

As a workaround, comment out the the line of code toward the very top of init.py in Contents/Code that is:

import Levenshtein as lev

By placing a # Infront of the line. The repercussions will be that your search function won't work, so you need an exact naming scheme for your files to retrieve the metadata.

For the naming scheme, see: https://github.com/bubonic/TGC.bundle/issues/4#issuecomment-765490616

Once I get a Windows box up and running, I can look into this.

Best, buboes

italianbeef12 commented 3 years ago

Thanks - that got me past that point but I'm really struggling to get this work. I'm getting a "WebDriverException: Message: 'geckodriver' executable needs to be in PATH" message in the log. I put geckodriver.exe in c:\bin\geckodriver, added it to path in windows, tested that Windows sees it, and tried every combination I can think of in the code. This is the current configuration:

FIREFOX = "C:\Program Files\Mozilla Firefox" GECKODRIVER = "C:\bin\geckodriver" CONVERT = "C:\bin\convert"

Appreciate any suggestions. com.plexapp.agents.tgc.log

bubonic commented 3 years ago

Those global variables point to the location of the executable, i.e.,

GECKODRIVER="C:\bin\geckodriver\geckodriver.exe"

Same goes for the other two.

italianbeef12 commented 3 years ago

Thanks for patiently helping me. I'm now getting a "WebDriverException: Message: 'geckodriver.exe' executable needs to be in PATH" message in the log even after I added the folder to my system path. :( (and I confirmed the path works because I can run the .exe from any folder inside a command prompt)

bubonic commented 3 years ago

Did you use the Geckodriver that is included in the repo? That may be the problem since windows wouldn't see it as an executable.

Nevermind. You said you can execute it. Let me think about this and get back to you.

Can you attach the log?

italianbeef12 commented 3 years ago

Sure - attached. com.plexapp.agents.tgc.log

bubonic commented 3 years ago

Sure - attached. com.plexapp.agents.tgc.log

Looks like there might be a typo in where you have edited the GECKODRIVER global variable. Notice the following line of the log:

2021-02-19 15:41:49,858 (c08) :  INFO (logkit:16) - Assuming geckodriver location is: C:in\geckodriver\geckodriver.exe

That is not a proper path. First of all C: is followed by a unicode character and the the letters "i" and "n". I'm guessing those came from /local/usr/bin

There would be no other reason why the path would contain those characters. Check it out and get back to me.

italianbeef12 commented 3 years ago

I'm guessing that I'm updating the wrong file?

C:\Users\xxx\AppData\Local\Plex Media Server\Plug-ins\TGC.bundle\Contents\Code__init__.py

bubonic commented 3 years ago

Err /usr/local/bin

Not feeling that great today obviously

bubonic commented 3 years ago

That is the correct file. I suggest removing everything in quotes on the GECKODRIVER variable and typing out, in quotes, the location of geckodriver.exe

Paste the line for me here when you do that.

italianbeef12 commented 3 years ago

This is what I have in that file:

EDIT THIS

FIREFOX = "C:\Program Files\Mozilla Firefox\firefox.exe"

You can leave these alone or edit them if you feel like doing so

GECKODRIVER = "C:\bin\geckodriver\geckodriver.exe" CONVERT = "C:\Program Files\ImageMagick-7.0.11-Q16-HDRI\magick.exe"

bubonic commented 3 years ago

Looks perfect to me. The log contained a unicode character in the path, which I have no clue where that would come from.

Everything should be fine if your Geckodriver and firefox are windows executables. Try running it again and attach the log if it doesn't work

bubonic commented 3 years ago

There could be one other solution if it doesn't work and that is the following:

Screenshot_20210224-205716.jpg

Take that line that is brightened and remove everything after the "=" except "GECKODRIVER". So, the line should read

gecko_binary = GECKODRIVER
italianbeef12 commented 3 years ago

Here's the log file if I remove abspath as above:

com.plexapp.agents.tgc.log

bubonic commented 3 years ago

Same error as before. I hope you are using Geckodriver v0.26.0, if not, make sure you are. Also, do some googling about that error. I did, and there could be a number of solutions available. I will add a line of code that updates the path for a more general solution... So look for that in a few days.

Otherwise, I really can not be of much more help.

https://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in-path

italianbeef12 commented 3 years ago

Ok - did some more testing and made some more progress - getting close:

FIREFOX = "C:\Program Files\Mozilla Firefox\firefox.exe" GECKODRIVER = "C:\Program Files\geckodriver\geckodriver.exe" CONVERT = "C:\Program Files\ImageMagick-7.0.11-Q16-HDRI\magick.exe" gecko_binary = os.path.abspath(GECKODRIVER)

Latest log attached below:

com.plexapp.agents.tgc.log

bubonic commented 3 years ago

Okay. My apologies on the late response. For some reason my github apps on my phone and tablet don't send push notifications. It has a few times, so I have to check my e-mail to see these.

Anyway, from a previous issue with a Windows user (since I don't run Windows, I cannot verify) - but make sure you have Firefox v52.8.1esr

Supposedly that is what one user found that worked for him. Here is the link:

https://ftp.mozilla.org/pub/firefox/releases/52.8.1esr/win64/en-GB/

Hopefully, the issues you are having is caused by the version of firefox now. Try it and let me know.

Best, buboes

italianbeef12 commented 3 years ago

No apologies needed - you've been very patient. I am running this version of Firefox. Darn. :(

bubonic commented 3 years ago

So,when I ran into this error, I had to test different versions of firefox. Yes it was time consuming, but once you find a version that works with your system, it is worth it. For linux, Firefox v60.0 worked for me. You may want to try that version and keep going up or down the ladder until that error message disappears.

This may be of some help

https://stackoverflow.com/questions/43713445/selenium-unable-to-find-a-matching-set-of-capabilities-despite-driver-being-in

I don't have a windows box to test different versions, so you are on your own with that one. When you find one that works, please post your Windows version and working firefox version here so I can add the comparability to the Readme

Best of luck!

italianbeef12 commented 3 years ago

Tried a few different versions of Firefox - no luck. Noticed this error:

_2021-03-01 07:26:14,382 (2bcc) : INFO (logkit:16) - Staring Selenium driver... 2021-03-01 07:26:17,594 (2bcc) : CRITICAL (core:574) - Exception when calling function 'Start' (most recent call last): File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-1b7748a7b\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py", line 294, in call_namedfunction result = f(*args, **kwargs)

..wonder if I should upgrade the bundled selenium driver? Not sure how to do that tho.

bubonic commented 3 years ago

You're free to try whatever you want. Just know that the PLEX framework is built on Python 2.6, so you are most likely going to run into a lot of issues with newer versions of Selenium.

You may just want to hang tight until I add support for Chromium. It has a better propensity to work on more platforms.

italianbeef12 commented 3 years ago

Sounds good - thanks for being so responsive!