- FLX Remove web device that seem to be not working
- CR update client and header
This commit is contained in:
@@ -23,10 +23,12 @@ class FLX(Service):
|
||||
|
||||
\b
|
||||
Original-Author: [SeFree]
|
||||
Version: 1.1.0
|
||||
Authorization: Credentials + Cookies
|
||||
Version: 1.0.0
|
||||
Authorization: Cookies (No login require) + Credential (No need but can be provide)
|
||||
Security: FHD@L3
|
||||
\b
|
||||
Notes:
|
||||
- Dont care about account or vip. can bypass all content
|
||||
"""
|
||||
|
||||
TITLE_RE = r"^(?:https?://(?:www\.)?flixerapp\.com/video/)?(?P<id>\d+)"
|
||||
@@ -49,9 +51,6 @@ class FLX(Service):
|
||||
help="BiliBili not provide Season in info, so specify it manually.")
|
||||
@click.option("-m", "--movie", is_flag=True, default=False,
|
||||
help="Download series as movie if listed as a series.)")
|
||||
@click.option("-d", "--device_type", default='android', required=False, type=str,
|
||||
help="Device type to use for API requests. Default is 'android'.")
|
||||
|
||||
@click.option("-c", "--cdn", default=None, required=False, type=str,
|
||||
help="Overwrite CDN settings. Default is 'vps1'.")
|
||||
@click.pass_context
|
||||
@@ -66,7 +65,7 @@ class FLX(Service):
|
||||
series_id = match.group("id")
|
||||
return series_id
|
||||
|
||||
def __init__(self, ctx, title, original_lang, season,movie,device_type,cdn):
|
||||
def __init__(self, ctx, title, original_lang, season,movie,cdn):
|
||||
super().__init__(ctx)
|
||||
self.title=self.parse_series_id(title)
|
||||
|
||||
@@ -74,7 +73,6 @@ class FLX(Service):
|
||||
self.season = season
|
||||
|
||||
self.is_movie=movie
|
||||
self.device_type = device_type
|
||||
self.cdn=cdn
|
||||
|
||||
# def get_session(self):
|
||||
@@ -85,32 +83,19 @@ class FLX(Service):
|
||||
def authenticate(self, cookies=None, credential=None) -> None:
|
||||
"""Authenticate using username and password credentials, with refresh token support."""
|
||||
super().authenticate(cookies, credential)
|
||||
|
||||
if self.device_type == "android":
|
||||
|
||||
if credential:
|
||||
data = f'screen-density=xhdpi&password={credential.password}&email={credential.username}'
|
||||
|
||||
# self.session.headers.update(self.config['headers'])
|
||||
response = self.session.post(self.config['endpoints']['login'], headers=self.config['headers_android'], data=data)
|
||||
|
||||
elif self.device_type == "web":
|
||||
|
||||
|
||||
files = {
|
||||
'email': (None, credential.username),
|
||||
'password': (None, credential.password),
|
||||
'devicie_id': (None, 'web'),
|
||||
'screen_density': (None, 'xxhdpi'),
|
||||
'mac_address': (None, ''),
|
||||
}
|
||||
|
||||
response=self.session.post(self.config['endpoints']['login'], files=files)
|
||||
|
||||
if response.status_code == 200 and response.json()['error_code'] == 110:
|
||||
self.log.info("Login successful")
|
||||
|
||||
if response.status_code == 200 and response.json()['error_code'] == 110:
|
||||
self.log.info("Login successful")
|
||||
else:
|
||||
self.log.error("Login failed. Please check credential")
|
||||
exit(1)
|
||||
else:
|
||||
self.log.error("Login failed. Please check credential")
|
||||
exit(1)
|
||||
self.log.warning("Credential not found")
|
||||
|
||||
def get_titles(self) -> Titles_T:
|
||||
response=self.session.get(self.config['endpoints']['info'].format(id=self.title)).json()
|
||||
|
||||
Reference in New Issue
Block a user