pymedusa / Medusa

Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic.
https://pymedusa.com
GNU General Public License v3.0
1.8k stars 276 forks source link

Error message in log, lacking sufficient details to identify problem clearly. #10845

Open jaxjexjox opened 2 years ago

jaxjexjox commented 2 years ago

Latest version. Docker build.

Error in log

"2022-07-30 18:52:05 WARNING FINDSUBTITLES :: [400903a] Failed to login, check your userid, password"

I have 4 subtitle providers enabled.

http://www.addic7ed.com Addic7ed http://www.opensubtitles.org Opensubtitles http://www.thesubdb.com Thesubdb http://www.tvsubtitles.net Tvsubtitles

How do I identify which of these 4 providers is the one with the issue in the log?

BenjV commented 2 years ago

By determination. Switch off all but one of and try again. If not the problem add another till you find the problem.

mmhere commented 2 years ago

That warning text only occurs in medusa/subtitle_providers/addic7ed.py, so that one is the culprit. See line 136 (public master in git for version 1.0.6).

My sense is that the addic7ed.py file is a bit new and has been suffering some teething problems. This is another one.

BenjV commented 2 years ago

Addic7ed uses currently a captcha during login, so a login by a program like Medusa is not possible anymore.

mmhere commented 2 years ago

from the Medusa Subtitles Plugin Settings page: "To bypass addic7ed captcha protection we authenticate using a set cookie. The cookie requires your user id and password."

This uses the numeric user ID you can get from the addic7ed website when logged in with your regular user name, so I'm guessing this is not captcha related.

mmhere commented 2 years ago

unless something changed recently

jaxjexjox commented 2 years ago

I had never done the cookie based userid and password method before (it worked fine for a while without it, to my knowledge?)

I've now done this and the problem persists.

Please note, I run medusa inside a docker image on another workstation in my network. So the cookie which is saved is on another PC (actual real web based cookie)

Am I going to have trouble due to this?

p0psicles commented 2 years ago

The only way for addic7ed to work. And bypass the captcha security. Is by using the userid/pass method. So for username enter the userid and password -> your password.

BenjV commented 2 years ago

To make that work you must have done a login on the addic7ed website with a browser running on the same machine to store the captcha in a cookie.

So if you for example where running medusa on a Nas this would not be possible.

mmhere commented 2 years ago

Correct me if I'm wrong, but numeric userid + password bypasses the interactive captcha (and its resulting cookies) that you get with a manual user login at the website in a browser, right? I don't recall having to get a captcha cookie in a browser, then somehow transfer that capture cookie from the browser to Medusa. I don't think that's how this works.

According to the code in medusa/subtitle_providers/addic7ed.py, the login is done purely with userid (numeric), and password. At this point cookies are generated in Medusa, and kept in class Addic7edSubtitle's "cookies" data member, and later used to validate all API requests via a Session object.

If I'm reading that code correctly, only the userid () and password are needed on the Medusa side. () userid must be obtained while logged into the website in a browser with username/password, having navigated the manual captcha required to login that way.

BenjV commented 2 years ago

Were is that userid to be found?

mmhere commented 2 years ago

login on the website in a browser (pass the captcha)

click My Profile

Click your username

URL bar (address field) shows https://www.addic7ed.com/user/NNNNNNN

NNNNNNN is what you plug into Medusa with your same password, then it all works with no Captcha required by Medusa

mmhere commented 2 years ago

Knowledge of the userid number is effectively the "secret", proving you've logged in once interactively in any browser anywhere, passing the captcha test. That secret in conjunction with the password bound to the userNAME is what lets Medusa access the API. Medusa does acquire cookie(s) upon first login using userid/password, then uses those cookies until they expire to validate future sessions.

BenjV commented 2 years ago

So when is does expire then you have to login again before Medusa is be able to work again?

p0psicles commented 2 years ago

It doesn't expire

jaxjexjox commented 2 years ago

If it's not possible via docker (yes on my NAS) no big deal, still really appreciate the work you guys do.

Did it work at one point? I feel like the error message I'm getting I've only had a month or two.