fixed login auth

This commit is contained in:
stratuma 2024-07-02 19:48:12 +02:00
parent 201c9bf045
commit f45f0b273a
2 changed files with 26 additions and 66 deletions

View File

@ -105,42 +105,21 @@ async function crunchyLoginFetchProxy(user: string, passw: string, geo: string)
return return
} }
if (endpoint !== 1) { headers = {
headers = { Authorization: 'Basic dC1rZGdwMmg4YzNqdWI4Zm4wZnE6eWZMRGZNZnJZdktYaDRKWFMxTEVJMmNDcXUxdjVXYW4=',
Authorization: 'Basic dm52cHJyN21ubW1la2Uyd2xwNTM6V19IdWlNekxUS1JqSnlKZTBHRlFYZXFoTldDREdUM2M=', 'Content-Type': 'application/json',
'Content-Type': 'application/json', 'User-Agent': 'Crunchyroll/3.46.2 Android/13 okhttp/4.12.0'
'User-Agent': 'Crunchyroll/4.51.0 (bundle_identifier:com.crunchyroll.iphone; build_number:3634220.454824296) iOS/17.4.1 Gravity/4.51.0'
}
body = {
username: user,
password: passw,
grant_type: 'password',
scope: 'offline_access',
device_name: 'iPhone',
device_type: 'iPhone 13',
ursa: 'Crunchyroll/4.51.0 (bundle_identifier:com.crunchyroll.iphone; build_number:3634220.454824296) iOS/17.4.1 Gravity/4.51.0',
token: 'Basic dm52cHJyN21ubW1la2Uyd2xwNTM6V19IdWlNekxUS1JqSnlKZTBHRlFYZXFoTldDREdUM2M='
}
} }
if (endpoint === 1) { body = {
headers = { username: user,
Authorization: 'Basic dC1rZGdwMmg4YzNqdWI4Zm4wZnE6eWZMRGZNZnJZdktYaDRKWFMxTEVJMmNDcXUxdjVXYW4=', password: passw,
'Content-Type': 'application/json', grant_type: 'password',
'User-Agent': 'Crunchyroll/3.46.2 Android/13 okhttp/4.12.0' scope: 'offline_access',
} device_name: 'RMX2170',
device_type: 'realme RMX2170',
body = { ursa: 'Crunchyroll/3.46.2 Android/13 okhttp/4.12.0',
username: user, token: 'Basic dC1rZGdwMmg4YzNqdWI4Zm4wZnE6eWZMRGZNZnJZdktYaDRKWFMxTEVJMmNDcXUxdjVXYW4='
password: passw,
grant_type: 'password',
scope: 'offline_access',
device_name: 'RMX2170',
device_type: 'realme RMX2170',
ursa: 'Crunchyroll/3.46.2 Android/13 okhttp/4.12.0',
token: 'Basic dC1rZGdwMmg4YzNqdWI4Zm4wZnE6eWZMRGZNZnJZdktYaDRKWFMxTEVJMmNDcXUxdjVXYW4='
}
} }
if (!headers || !body) return if (!headers || !body) return
@ -194,38 +173,19 @@ async function crunchyLoginFetch(user: string, passw: string) {
endpoint = 1 endpoint = 1
} }
if (endpoint !== 1) { headers = {
headers = { Authorization: 'Basic dC1rZGdwMmg4YzNqdWI4Zm4wZnE6eWZMRGZNZnJZdktYaDRKWFMxTEVJMmNDcXUxdjVXYW4=',
Authorization: 'Basic dm52cHJyN21ubW1la2Uyd2xwNTM6V19IdWlNekxUS1JqSnlKZTBHRlFYZXFoTldDREdUM2M=', 'Content-Type': 'application/x-www-form-urlencoded',
'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': 'Crunchyroll/3.46.2 Android/13 okhttp/4.12.0'
'User-Agent': 'Crunchyroll/4.51.0 (bundle_identifier:com.crunchyroll.iphone; build_number:3634220.454824296) iOS/17.4.1 Gravity/4.51.0'
}
body = {
username: user,
password: passw,
grant_type: 'password',
scope: 'offline_access',
device_name: 'iPhone',
device_type: 'iPhone 13'
}
} }
if (endpoint === 1) { body = {
headers = { username: user,
Authorization: 'Basic dC1rZGdwMmg4YzNqdWI4Zm4wZnE6eWZMRGZNZnJZdktYaDRKWFMxTEVJMmNDcXUxdjVXYW4=', password: passw,
'Content-Type': 'application/x-www-form-urlencoded', grant_type: 'password',
'User-Agent': 'Crunchyroll/3.46.2 Android/13 okhttp/4.12.0' scope: 'offline_access',
} device_name: 'RMX2170',
device_type: 'realme RMX2170'
body = {
username: user,
password: passw,
grant_type: 'password',
scope: 'offline_access',
device_name: 'RMX2170',
device_type: 'realme RMX2170'
}
} }
if (!headers || !body) return if (!headers || !body) return
@ -727,8 +687,7 @@ export async function crunchyGetPlaylistMPD(q: string, geo: string | undefined)
const headers = { const headers = {
Authorization: `Bearer ${login.access_token}`, Authorization: `Bearer ${login.access_token}`,
'User-Agent': 'Crunchyroll/1.8.0 Nintendo Switch/12.3.12.0 UE4/4.27', 'User-Agent': 'Crunchyroll/1.8.0 Nintendo Switch/12.3.12.0 UE4/4.27'
'x-cr-disable-drm': 'true'
} }
const regex = /\/manifest\/([A-Z0-9]+)\/.*\?playbackGuid=([^&]+)/ const regex = /\/manifest\/([A-Z0-9]+)\/.*\?playbackGuid=([^&]+)/

View File

@ -160,6 +160,7 @@ async function mergePartsAudio(
if (dn) { if (dn) {
dn.status = 'decrypting' dn.status = 'decrypting'
} }
console.log(`Audio Decryption started`) console.log(`Audio Decryption started`)
const command = `${shaka} input="${tmp}/temp-main.m4s",stream=audio,output="${tmp}/main.m4s" --enable_raw_key_decryption --keys key_id=${drmkeys[1].kid}:key=${drmkeys[1].key}` const command = `${shaka} input="${tmp}/temp-main.m4s",stream=audio,output="${tmp}/main.m4s" --enable_raw_key_decryption --keys key_id=${drmkeys[1].kid}:key=${drmkeys[1].key}`