work on qm
This commit is contained in:
parent
ca1f658be6
commit
3fb9df425c
5 changed files with 93 additions and 113 deletions
|
|
@ -2,7 +2,6 @@
|
|||
* Shared configuration for QM operations
|
||||
*/
|
||||
|
||||
import { getRandomUserAgent } from '@stock-bot/http';
|
||||
|
||||
// QM Session IDs for different endpoints
|
||||
export const QM_SESSION_IDS = {
|
||||
|
|
@ -28,8 +27,6 @@ export const QM_CONFIG = {
|
|||
BASE_URL: 'https://app.quotemedia.com',
|
||||
AUTH_PATH: '/auth/g/authenticate/dataTool/v0/500',
|
||||
LOOKUP_URL: 'https://app.quotemedia.com/datatool/lookup.json',
|
||||
ORIGIN: 'https://www.quotemedia.com',
|
||||
REFERER: 'https://www.quotemedia.com/',
|
||||
} as const;
|
||||
|
||||
// Session management settings
|
||||
|
|
@ -39,18 +36,4 @@ export const SESSION_CONFIG = {
|
|||
MAX_FAILED_CALLS: 10,
|
||||
SESSION_TIMEOUT: 10000, // 10 seconds
|
||||
API_TIMEOUT: 15000, // 15 seconds
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Generate standard QM headers
|
||||
*/
|
||||
export function getQmHeaders(): Record<string, string> {
|
||||
return {
|
||||
'User-Agent': getRandomUserAgent(),
|
||||
Accept: '*/*',
|
||||
'Accept-Language': 'en',
|
||||
'Sec-Fetch-Mode': 'cors',
|
||||
Origin: QM_CONFIG.ORIGIN,
|
||||
Referer: QM_CONFIG.REFERER,
|
||||
};
|
||||
}
|
||||
} as const;
|
||||
Loading…
Add table
Add a link
Reference in a new issue