luisgbr1el / kelle-telegram

Um simples bot para o Telegram que baixa vídeos e áudios do TikTok, clipes da Twitch & outras funcionalidades.
https://t.me/KelleEstellaBot
MIT License
4 stars 0 forks source link

Version 1.1 - Major Changes #3

Closed phaticusthiccy closed 2 years ago

phaticusthiccy commented 2 years ago

Innovations

  1. Replaced direct url with buffer ecosystem
  2. Added Two New Internal Functions
  3. Added Cache ( Send Quickly if Video ın Cache )
  4. Added Lısance Headers

Fixed Issues

Fixed the issue where videos other than webm type and mpeg encoding were not playing. Fixed the non-buffer data with the audios.

Known Issues

Must be tested an un-publısed local servers.

luisgbr1el commented 2 years ago

When clicks on "video" button, show this on console and the bot crashes.

node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open 'C:\git\kelle-telegram-patch-1\src\https:\tikdown.org\download?filename=tikdown.org-24026747680.mp4'
Emitted 'error' event on ReadStream instance at:
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\git\\kelle-telegram-patch-1\\src\\https:\\tikdown.org\\download?filename=tikdown.org-24026747680.mp4'
}
phaticusthiccy commented 2 years ago

Okey, i know where the error is. I needed to edit the URI data. I knew this but it slipped my mind. I'll try a slightly different method.

phaticusthiccy commented 2 years ago

Also you can use $node --trace-warnings to see full error logs.

phaticusthiccy commented 2 years ago

Now, it must be work.

luisgbr1el commented 2 years ago

Now, it must be work.

Shows this another error when clicks on "video" button and the bot crashes.

node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open 'C:\git\kelle-telegram-patch-1\src\40216246635.mp4'
Emitted 'error' event on ReadStream instance at:
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\git\\kelle-telegram-patch-1\\src\\40216246635.mp4'
}
luisgbr1el commented 2 years ago

I think there is a error while creating and reading stream fs.createReadStream()

Can you try this { source: "./src/" + data.server1.video.split("org-")[1] } by replacing line#59 and line#66. ​I think it can be solve that. If even it wont work, i will test it directly. Sorry 😅 I thoght code will work perfectly, Thats way ı dont need to test it :)

It show this error and crashes again.

C:\git\kelle-telegram-patch-1\node_modules\telegraf\lib\core\network\client.js:263
            throw new error_1.default(data, { method, payload });
                  ^

TelegramError: 400: Bad Request: there is no video in the request
    at Telegram.callApi (C:\git\kelle-telegram-patch-1\node_modules\telegraf\lib\core\network\client.js:263:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async C:\git\kelle-telegram-patch-1\index.js:57:13
    at async execute (C:\git\kelle-telegram-patch-1\node_modules\telegraf\lib\composer.js:464:17)
    at async C:\git\kelle-telegram-patch-1\node_modules\telegraf\lib\composer.js:465:21
    at async execute (C:\git\kelle-telegram-patch-1\node_modules\telegraf\lib\composer.js:464:17)
    at async execute (C:\git\kelle-telegram-patch-1\node_modules\telegraf\lib\composer.js:464:17)
    at async execute (C:\git\kelle-telegram-patch-1\node_modules\telegraf\lib\composer.js:464:17)
    at async C:\git\kelle-telegram-patch-1\node_modules\telegraf\lib\composer.js:465:21
    at async execute (C:\git\kelle-telegram-patch-1\node_modules\telegraf\lib\composer.js:464:17) {
  response: {
    ok: false,
    error_code: 400,
    description: 'Bad Request: there is no video in the request'
  },
  on: {
    method: 'sendVideo',
    payload: { chat_id: 1032195659, video: { source: './src/22074570746.mp4' } }
  }
}
phaticusthiccy commented 2 years ago

Bulid: pass Test: pass BufferHealth: + (arraybuffer method)

luisgbr1el commented 2 years ago
  • Removed fs.createReadStream() (replaced with internal file sender)
  • Added Popularity Colon
  • Replaced oldschool fs accsess functions with simple one

Bulid: pass Test: pass BufferHealth: + (arraybuffer method)

It works now but still sending the same video/audio all the time.

phaticusthiccy commented 2 years ago

Oh sorry, ı just updating the APIs. Lemme check..