File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,6 +158,7 @@ module.exports = class Client {
158158 if ( ! this . isOpen ) return ;
159159
160160 protocol . parseWSPacket ( str ) . forEach ( ( packet ) => {
161+ console . dir ( packet , { depth : null } ) ;
161162 if ( global . TW_DEBUG ) console . log ( '§90§30§107 CLIENT §0 PACKET' , packet ) ;
162163 if ( typeof packet === 'number' ) { // Ping
163164 this . #ws. send ( protocol . formatWSPacket ( `~h~${ packet } ` ) ) ;
@@ -228,8 +229,14 @@ module.exports = class Client {
228229 if ( clientOptions . DEBUG ) global . TW_DEBUG = clientOptions . DEBUG ;
229230
230231 const server = clientOptions . server || 'data' ;
231- this . #ws = new WebSocket ( `wss://${ server } .tradingview.com/socket.io/websocket?type=chart` , {
232+ this . #ws = new WebSocket ( `wss://${ server } .tradingview.com/socket.io/websocket?from=chart& type=chart` , {
232233 origin : 'https://www.tradingview.com' ,
234+ headers : {
235+ 'User-Agent' : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36' ,
236+ 'Accept-Language' : 'en-US,en;q=0.9' ,
237+ 'Cache-Control' : 'no-cache' ,
238+ Pragma : 'no-cache' ,
239+ } ,
233240 } ) ;
234241
235242 if ( clientOptions . token ) {
You can’t perform that action at this time.
0 commit comments