Fix timeframe selection bug and syntax errors

- Fixed critical timeframe mapping bug where '4h' was interpreted as '4 minutes'
- Now prioritizes minute values: '4h' -> ['240', '240m', '4h', '4H']
- Added fallback mechanism to enter exact minutes (240) in custom interval input
- Fixed multiple syntax errors in tradingview-automation.ts:
  * Missing closing parentheses in console.log statements
  * Missing parentheses in writeFile and JSON.parse calls
  * Fixed import statements for fs and path modules
  * Added missing utility methods (fileExists, markCaptchaDetected, etc.)
- Enhanced timeframe selection with comprehensive hour mappings (1h, 2h, 4h, 6h, 12h)
- Added detailed logging for debugging timeframe selection
- Application now builds successfully without syntax errors
- Interval selection should work correctly for all common timeframes

Key improvements:
 4h chart selection now works correctly (240 minutes, not 4 minutes)
 All TypeScript compilation errors resolved
 Enhanced debugging output for timeframe mapping
 Robust fallback mechanisms for interval selection
 Docker integration and manual CAPTCHA handling maintained
This commit is contained in:
mindesbunister
2025-07-13 13:57:35 +02:00
parent 19d4020622
commit b91d35ad60
17 changed files with 1218 additions and 143 deletions

View File

@@ -0,0 +1,102 @@
[
{
"name": "_GRECAPTCHA",
"value": "09ANMylNB9mCz1WTS0NwZvsiCv6KCeDoFBGiYaV8FN57GD2Bjl6fkvwiQSn6lQXmTXn3_gRrbL-P4n3Qoygvsqz5g",
"domain": "www.recaptcha.net",
"path": "/recaptcha",
"expires": 1767956473.091451,
"httpOnly": true,
"secure": true,
"sameSite": "None"
},
{
"name": "device_t",
"value": "M2x1VUFROjA.f9Y71pHEyPLucfvwSYrB8LcR_rBrvQ7ox9Chj0bI7TM",
"domain": ".tradingview.com",
"path": "/",
"expires": 1783508479.576364,
"httpOnly": true,
"secure": true,
"sameSite": "None"
},
{
"name": "sessionid",
"value": "o4hcees7110n1dv96cclfeiir8b0dknh",
"domain": ".tradingview.com",
"path": "/",
"expires": 1760439679.576436,
"httpOnly": true,
"secure": true,
"sameSite": "Lax"
},
{
"name": "sessionid_sign",
"value": "v3:prq2Z24OdSQtVZQr7TZ7fuzSJH1exo/JV554mb+kTJQ=",
"domain": ".tradingview.com",
"path": "/",
"expires": 1760439679.576473,
"httpOnly": true,
"secure": true,
"sameSite": "Lax"
},
{
"name": "etg",
"value": "undefined",
"domain": ".tradingview.com",
"path": "/",
"expires": 1786964479.794484,
"httpOnly": false,
"secure": false,
"sameSite": "Lax"
},
{
"name": "cachec",
"value": "undefined",
"domain": ".tradingview.com",
"path": "/",
"expires": 1786964479.803436,
"httpOnly": false,
"secure": false,
"sameSite": "Lax"
},
{
"name": "_sp_ses.cf1a",
"value": "*",
"domain": ".tradingview.com",
"path": "/",
"expires": 1760180481,
"httpOnly": false,
"secure": true,
"sameSite": "None"
},
{
"name": "cookiePrivacyPreferenceBannerProduction",
"value": "ignored",
"domain": ".tradingview.com",
"path": "/",
"expires": 1786964481.740141,
"httpOnly": false,
"secure": false,
"sameSite": "Lax"
},
{
"name": "_sp_id.cf1a",
"value": ".1752404481.1.1752404482..f540bb6e-fa0b-496b-9640-1d4fec1e4c8e..656514fd-a0d5-4c9c-9763-be49bfa3bb6e.1752404481740.1",
"domain": ".tradingview.com",
"path": "/",
"expires": 1786964481.740595,
"httpOnly": false,
"secure": true,
"sameSite": "None"
},
{
"name": "sp",
"value": "476371e7-d9df-4cab-9f6c-9af104097490",
"domain": "snowplow-pixel.tradingview.com",
"path": "/",
"expires": 1783940482.306256,
"httpOnly": true,
"secure": true,
"sameSite": "None"
}
]

View File

@@ -0,0 +1,17 @@
{
"localStorage": {
"cookie_dialog_tracked": "1",
"snowplowOutQueue_tv_cf_post2.expires": "1815476481741",
"tvlocalstorage.available": "true",
"featuretoggle_seed": "983912",
"first_visit_time": "1752404384075",
"snowplowOutQueue_tv_cf_post2": "[]",
"auto-show-email-for-signin": "1",
"trial_availiable": "0",
"_grecaptcha": "09ANMylNBaIGTVsUxDDAB11tBaVKRevHvUG6E16KDP4nm97sYkmHshpfmxoAkcFfbj7mFb3zg4rncfzqc6A9g-20ErWdRAoBN59yOsTLvoV3Oc39otwCTzVeNmXMQoHwHs",
"last-crosstab-monotonic-timestamp": "1752404482390",
"last_username": "mindesbunister",
"signupSource": "auth page tvd"
},
"sessionStorage": {}
}