- FLX Remove web device that seem to be not working
- CR update client and header
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# Crunchyroll API Configuration
|
# Crunchyroll API Configuration
|
||||||
client:
|
client:
|
||||||
id: "o7uowy7q4lgltbavyhjq"
|
id: "y2arvjb0h0rgvtizlovy"
|
||||||
secret: "lqrjETNx6W7uRnpcDm8wRVj8BChjC1er"
|
secret: "JVLvwdIpXvxU-qIBvT1M8oQTr1qlQJX2"
|
||||||
|
|
||||||
# API Endpoints
|
# API Endpoints
|
||||||
endpoints:
|
endpoints:
|
||||||
@@ -28,7 +28,7 @@ endpoints:
|
|||||||
|
|
||||||
# Headers for Android TV client
|
# Headers for Android TV client
|
||||||
headers:
|
headers:
|
||||||
user-agent: "Crunchyroll/ANDROIDTV/3.58.0_22336 (Android 11; en-US; SHIELD Android TV)"
|
user-agent: "Crunchyroll/ANDROIDTV/3.59.0_22338 (Android 12; en-US; SM-G9980)"
|
||||||
accept: "application/json"
|
accept: "application/json"
|
||||||
accept-charset: "UTF-8"
|
accept-charset: "UTF-8"
|
||||||
accept-encoding: "gzip"
|
accept-encoding: "gzip"
|
||||||
@@ -43,5 +43,5 @@ params:
|
|||||||
# Device parameters for authentication
|
# Device parameters for authentication
|
||||||
device:
|
device:
|
||||||
type: "ANDROIDTV"
|
type: "ANDROIDTV"
|
||||||
name: "SHIELD Android TV"
|
name: "p3q"
|
||||||
model: "SHIELD Android TV"
|
model: "SHIELD Android TV"
|
||||||
|
|||||||
@@ -23,10 +23,12 @@ class FLX(Service):
|
|||||||
|
|
||||||
\b
|
\b
|
||||||
Original-Author: [SeFree]
|
Original-Author: [SeFree]
|
||||||
Version: 1.1.0
|
Version: 1.0.0
|
||||||
Authorization: Credentials + Cookies
|
Authorization: Cookies (No login require) + Credential (No need but can be provide)
|
||||||
Security: FHD@L3
|
Security: FHD@L3
|
||||||
\b
|
\b
|
||||||
|
Notes:
|
||||||
|
- Dont care about account or vip. can bypass all content
|
||||||
"""
|
"""
|
||||||
|
|
||||||
TITLE_RE = r"^(?:https?://(?:www\.)?flixerapp\.com/video/)?(?P<id>\d+)"
|
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.")
|
help="BiliBili not provide Season in info, so specify it manually.")
|
||||||
@click.option("-m", "--movie", is_flag=True, default=False,
|
@click.option("-m", "--movie", is_flag=True, default=False,
|
||||||
help="Download series as movie if listed as a series.)")
|
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,
|
@click.option("-c", "--cdn", default=None, required=False, type=str,
|
||||||
help="Overwrite CDN settings. Default is 'vps1'.")
|
help="Overwrite CDN settings. Default is 'vps1'.")
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
@@ -66,7 +65,7 @@ class FLX(Service):
|
|||||||
series_id = match.group("id")
|
series_id = match.group("id")
|
||||||
return series_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)
|
super().__init__(ctx)
|
||||||
self.title=self.parse_series_id(title)
|
self.title=self.parse_series_id(title)
|
||||||
|
|
||||||
@@ -74,7 +73,6 @@ class FLX(Service):
|
|||||||
self.season = season
|
self.season = season
|
||||||
|
|
||||||
self.is_movie=movie
|
self.is_movie=movie
|
||||||
self.device_type = device_type
|
|
||||||
self.cdn=cdn
|
self.cdn=cdn
|
||||||
|
|
||||||
# def get_session(self):
|
# def get_session(self):
|
||||||
@@ -85,32 +83,19 @@ class FLX(Service):
|
|||||||
def authenticate(self, cookies=None, credential=None) -> None:
|
def authenticate(self, cookies=None, credential=None) -> None:
|
||||||
"""Authenticate using username and password credentials, with refresh token support."""
|
"""Authenticate using username and password credentials, with refresh token support."""
|
||||||
super().authenticate(cookies, credential)
|
super().authenticate(cookies, credential)
|
||||||
|
if credential:
|
||||||
if self.device_type == "android":
|
|
||||||
|
|
||||||
data = f'screen-density=xhdpi&password={credential.password}&email={credential.username}'
|
data = f'screen-density=xhdpi&password={credential.password}&email={credential.username}'
|
||||||
|
|
||||||
# self.session.headers.update(self.config['headers'])
|
# self.session.headers.update(self.config['headers'])
|
||||||
response = self.session.post(self.config['endpoints']['login'], headers=self.config['headers_android'], data=data)
|
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:
|
if response.status_code == 200 and response.json()['error_code'] == 110:
|
||||||
self.log.info("Login successful")
|
self.log.info("Login successful")
|
||||||
else:
|
else:
|
||||||
self.log.error("Login failed. Please check credential")
|
self.log.error("Login failed. Please check credential")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
else:
|
||||||
|
self.log.warning("Credential not found")
|
||||||
|
|
||||||
def get_titles(self) -> Titles_T:
|
def get_titles(self) -> Titles_T:
|
||||||
response=self.session.get(self.config['endpoints']['info'].format(id=self.title)).json()
|
response=self.session.get(self.config['endpoints']['info'].format(id=self.title)).json()
|
||||||
|
|||||||
Reference in New Issue
Block a user