Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ beautifulsoup4
pyoxipng
rich
Jinja2
pyotp
10 changes: 8 additions & 2 deletions src/trackers/MTV.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from pathlib import Path
from src.trackers.COMMON import COMMON


class MTV():
"""
Edit for Tracker:
Expand Down Expand Up @@ -504,9 +503,16 @@ async def login(self, cookiefile):

# handle 2fa
if resp.url.endswith('twofactor/login'):
otp_uri = self.config['TRACKERS'][self.tracker].get('otp_uri')
if otp_uri:
import pyotp
mfa_code = pyotp.parse_uri(otp_uri).now()
else:
mfa_code = console.input('[yellow]MTV 2FA Code: ')

two_factor_payload = {
'token' : resp.text.rsplit('name="token" value="', 1)[1][:48],
'code' : console.input('[yellow]MTV 2FA Code: '),
'code' : mfa_code,
'submit' : 'login'
}
resp = session.post(url="https://www.morethantv.me/twofactor/login", data=two_factor_payload)
Expand Down