created qm session check
This commit is contained in:
parent
e5f505335c
commit
b767689470
4 changed files with 235 additions and 155 deletions
|
|
@ -2,6 +2,8 @@
|
|||
* Shared configuration for QM operations
|
||||
*/
|
||||
|
||||
import { getRandomUserAgent } from "@stock-bot/utils";
|
||||
|
||||
// QM Session IDs for different endpoints
|
||||
export const QM_SESSION_IDS = {
|
||||
LOOKUP: 'dc8c9930437f65d30f6597768800957017bac203a0a50342932757c8dfa158d6', // lookup endpoint
|
||||
|
|
@ -30,9 +32,20 @@ export const QM_CONFIG = {
|
|||
|
||||
// Session management settings
|
||||
export const SESSION_CONFIG = {
|
||||
MIN_SESSIONS: 15,
|
||||
MAX_SESSIONS: 50,
|
||||
MIN_SESSIONS: 2,
|
||||
MAX_SESSIONS: 5,
|
||||
MAX_FAILED_CALLS: 3,
|
||||
SESSION_TIMEOUT: 5000, // 10 seconds
|
||||
API_TIMEOUT: 30000, // 15 seconds
|
||||
} as const;
|
||||
|
||||
export function getQmHeaders(): Record<string, string> {
|
||||
return {
|
||||
'User-Agent': getRandomUserAgent(),
|
||||
Accept: '*/*',
|
||||
'Accept-Language': 'en',
|
||||
'Sec-Fetch-Mode': 'cors',
|
||||
Origin: 'https://www.quotemedia.com',
|
||||
Referer: 'https://www.quotemedia.com/',
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue